mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 01:13:04 +00:00
Change return value of ObjectStore::PreallocateObjects to return the error object or null instead of a bool. Most of the times the sticky error is cleared and returned as an error so returning a bool and querying the sticky error here does not work as the sticky error is a null object.
R=srdjan@google.com Review URL: https://codereview.chromium.org/1721053002 .
This commit is contained in:
parent
e9a6175489
commit
2964f9e750
|
@ -464,8 +464,9 @@ RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) {
|
|||
I->set_ic_miss_code(miss_code);
|
||||
|
||||
if (snapshot_buffer == NULL) {
|
||||
if (!I->object_store()->PreallocateObjects()) {
|
||||
return T->sticky_error();
|
||||
const Error& error = Error::Handle(I->object_store()->PreallocateObjects());
|
||||
if (!error.IsNull()) {
|
||||
return error.raw();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ void ObjectStore::Init(Isolate* isolate) {
|
|||
}
|
||||
|
||||
|
||||
bool ObjectStore::PreallocateObjects() {
|
||||
RawError* ObjectStore::PreallocateObjects() {
|
||||
Thread* thread = Thread::Current();
|
||||
Isolate* isolate = thread->isolate();
|
||||
Zone* zone = thread->zone();
|
||||
|
@ -126,7 +126,7 @@ bool ObjectStore::PreallocateObjects() {
|
|||
if (this->stack_overflow() != Instance::null()) {
|
||||
ASSERT(this->out_of_memory() != Instance::null());
|
||||
ASSERT(this->preallocated_stack_trace() != Stacktrace::null());
|
||||
return true;
|
||||
return Error::null();
|
||||
}
|
||||
ASSERT(this->stack_overflow() == Instance::null());
|
||||
ASSERT(this->out_of_memory() == Instance::null());
|
||||
|
@ -147,7 +147,7 @@ bool ObjectStore::PreallocateObjects() {
|
|||
Symbols::Dot(),
|
||||
Object::empty_array());
|
||||
if (result.IsError()) {
|
||||
return false;
|
||||
return Error::Cast(result).raw();
|
||||
}
|
||||
set_stack_overflow(Instance::Cast(result));
|
||||
|
||||
|
@ -156,7 +156,7 @@ bool ObjectStore::PreallocateObjects() {
|
|||
Symbols::Dot(),
|
||||
Object::empty_array());
|
||||
if (result.IsError()) {
|
||||
return false;
|
||||
return Error::Cast(result).raw();
|
||||
}
|
||||
set_out_of_memory(Instance::Cast(result));
|
||||
|
||||
|
@ -178,7 +178,7 @@ bool ObjectStore::PreallocateObjects() {
|
|||
stack_trace.set_expand_inlined(false);
|
||||
set_preallocated_stack_trace(stack_trace);
|
||||
|
||||
return true;
|
||||
return Error::null();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -478,9 +478,9 @@ class ObjectStore {
|
|||
void VisitObjectPointers(ObjectPointerVisitor* visitor);
|
||||
|
||||
// Called to initialize objects required by the vm but which invoke
|
||||
// dart code. If an error occurs then false is returned and error
|
||||
// information is stored in Thread::sticky_error().
|
||||
bool PreallocateObjects();
|
||||
// dart code. If an error occurs the error object is returned otherwise
|
||||
// a null object is returned.
|
||||
RawError* PreallocateObjects();
|
||||
|
||||
void InitKnownObjects();
|
||||
|
||||
|
|
Loading…
Reference in a new issue