Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index fa292e3b09c57d9edf6273c2442b4f240a2573bb..941afc84a482d77a67d8b6117e42390397e88f2c 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -7220,6 +7220,7 @@ RawField* Field::New(const String& name, |
result.set_owner(owner); |
result.set_token_pos(token_pos); |
result.set_has_initializer(false); |
+ result.set_initializer(Function::Handle()); |
result.set_is_unboxing_candidate(true); |
result.set_guarded_cid(FLAG_use_field_guards ? kIllegalCid : kDynamicCid); |
result.set_is_nullable(FLAG_use_field_guards ? false : true); |
@@ -7516,6 +7517,11 @@ bool Field::IsUninitialized() const { |
} |
+void Field::set_initializer(const Function& initializer) const { |
+ StorePointer(&raw_ptr()->initializer_, initializer.raw()); |
+} |
+ |
+ |
void Field::EvaluateInitializer() const { |
ASSERT(is_static()); |
if (value() == Object::sentinel().raw()) { |
@@ -12839,6 +12845,11 @@ RawCode* Code::New(intptr_t pointer_offsets_length) { |
RawCode* Code::FinalizeCode(const char* name, |
Assembler* assembler, |
bool optimized) { |
+ Isolate* isolate = Isolate::Current(); |
+ if (!isolate->compilation_allowed()) { |
+ FATAL1("Precompilation missed code %s\n", name); |
+ } |
+ |
ASSERT(assembler != NULL); |
const ObjectPool& object_pool = |
ObjectPool::Handle(assembler->object_pool_wrapper().MakeObjectPool()); |
@@ -12850,8 +12861,8 @@ RawCode* Code::FinalizeCode(const char* name, |
Code& code = Code::ZoneHandle(Code::New(pointer_offset_count)); |
Instructions& instrs = |
Instructions::ZoneHandle(Instructions::New(assembler->CodeSize())); |
- INC_STAT(Isolate::Current(), total_instr_size, assembler->CodeSize()); |
- INC_STAT(Isolate::Current(), total_code_size, assembler->CodeSize()); |
+ INC_STAT(isolate, total_instr_size, assembler->CodeSize()); |
+ INC_STAT(isolate, total_code_size, assembler->CodeSize()); |
// Copy the instructions into the instruction area and apply all fixups. |
// Embedded pointers are still in handles at this point. |
@@ -12891,7 +12902,7 @@ RawCode* Code::FinalizeCode(const char* name, |
code.set_is_alive(true); |
// Set object pool in Instructions object. |
- INC_STAT(Isolate::Current(), |
+ INC_STAT(isolate, |
total_code_size, object_pool.Length() * sizeof(uintptr_t)); |
instrs.set_object_pool(object_pool.raw()); |
@@ -12912,7 +12923,7 @@ RawCode* Code::FinalizeCode(const char* name, |
// pushed onto the stack. |
code.SetPrologueOffset(assembler->CodeSize()); |
} |
- INC_STAT(Isolate::Current(), |
+ INC_STAT(isolate, |
total_code_size, code.comments().comments_.Length()); |
return code.raw(); |
} |