OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "vm/deopt_instructions.h" | 22 #include "vm/deopt_instructions.h" |
23 #include "vm/disassembler.h" | 23 #include "vm/disassembler.h" |
24 #include "vm/double_conversion.h" | 24 #include "vm/double_conversion.h" |
25 #include "vm/exceptions.h" | 25 #include "vm/exceptions.h" |
26 #include "vm/growable_array.h" | 26 #include "vm/growable_array.h" |
27 #include "vm/hash_table.h" | 27 #include "vm/hash_table.h" |
28 #include "vm/heap.h" | 28 #include "vm/heap.h" |
29 #include "vm/intrinsifier.h" | 29 #include "vm/intrinsifier.h" |
30 #include "vm/object_store.h" | 30 #include "vm/object_store.h" |
31 #include "vm/parser.h" | 31 #include "vm/parser.h" |
| 32 #include "vm/precompiler.h" |
32 #include "vm/profiler.h" | 33 #include "vm/profiler.h" |
33 #include "vm/report.h" | 34 #include "vm/report.h" |
34 #include "vm/reusable_handles.h" | 35 #include "vm/reusable_handles.h" |
35 #include "vm/runtime_entry.h" | 36 #include "vm/runtime_entry.h" |
36 #include "vm/scopes.h" | 37 #include "vm/scopes.h" |
37 #include "vm/stack_frame.h" | 38 #include "vm/stack_frame.h" |
38 #include "vm/symbols.h" | 39 #include "vm/symbols.h" |
39 #include "vm/tags.h" | 40 #include "vm/tags.h" |
40 #include "vm/thread_registry.h" | 41 #include "vm/thread_registry.h" |
41 #include "vm/timer.h" | 42 #include "vm/timer.h" |
(...skipping 5082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5124 | 5125 |
5125 | 5126 |
5126 bool Function::HasBreakpoint() const { | 5127 bool Function::HasBreakpoint() const { |
5127 Thread* thread = Thread::Current(); | 5128 Thread* thread = Thread::Current(); |
5128 return thread->isolate()->debugger()->HasBreakpoint(*this, thread->zone()); | 5129 return thread->isolate()->debugger()->HasBreakpoint(*this, thread->zone()); |
5129 } | 5130 } |
5130 | 5131 |
5131 | 5132 |
5132 void Function::InstallOptimizedCode(const Code& code, bool is_osr) const { | 5133 void Function::InstallOptimizedCode(const Code& code, bool is_osr) const { |
5133 DEBUG_ASSERT(IsMutatorOrAtSafepoint()); | 5134 DEBUG_ASSERT(IsMutatorOrAtSafepoint()); |
5134 // We may not have previous code if 'always_optimize' is set. | 5135 // We may not have previous code if FLAG_precompile is set. |
5135 if (!is_osr && HasCode()) { | 5136 if (!is_osr && HasCode()) { |
5136 Code::Handle(CurrentCode()).DisableDartCode(); | 5137 Code::Handle(CurrentCode()).DisableDartCode(); |
5137 } | 5138 } |
5138 AttachCode(code); | 5139 AttachCode(code); |
5139 } | 5140 } |
5140 | 5141 |
5141 | 5142 |
5142 void Function::SetInstructions(const Code& value) const { | 5143 void Function::SetInstructions(const Code& value) const { |
5143 DEBUG_ASSERT(IsMutatorOrAtSafepoint()); | 5144 DEBUG_ASSERT(IsMutatorOrAtSafepoint()); |
5144 SetInstructionsSafe(value); | 5145 SetInstructionsSafe(value); |
(...skipping 2552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7697 void Field::SetSavedInitialStaticValue(const Instance& value) const { | 7698 void Field::SetSavedInitialStaticValue(const Instance& value) const { |
7698 ASSERT(!HasPrecompiledInitializer()); | 7699 ASSERT(!HasPrecompiledInitializer()); |
7699 StorePointer(&raw_ptr()->initializer_.saved_value_, value.raw()); | 7700 StorePointer(&raw_ptr()->initializer_.saved_value_, value.raw()); |
7700 } | 7701 } |
7701 | 7702 |
7702 | 7703 |
7703 void Field::EvaluateInitializer() const { | 7704 void Field::EvaluateInitializer() const { |
7704 ASSERT(is_static()); | 7705 ASSERT(is_static()); |
7705 if (StaticValue() == Object::sentinel().raw()) { | 7706 if (StaticValue() == Object::sentinel().raw()) { |
7706 SetStaticValue(Object::transition_sentinel()); | 7707 SetStaticValue(Object::transition_sentinel()); |
7707 Object& value = Object::Handle(Compiler::EvaluateStaticInitializer(*this)); | 7708 const Object& value = |
| 7709 Object::Handle(Compiler::EvaluateStaticInitializer(*this)); |
7708 if (value.IsError()) { | 7710 if (value.IsError()) { |
7709 SetStaticValue(Object::null_instance()); | 7711 SetStaticValue(Object::null_instance()); |
7710 Exceptions::PropagateError(Error::Cast(value)); | 7712 Exceptions::PropagateError(Error::Cast(value)); |
7711 UNREACHABLE(); | 7713 UNREACHABLE(); |
7712 } | 7714 } |
7713 ASSERT(value.IsNull() || value.IsInstance()); | 7715 ASSERT(value.IsNull() || value.IsInstance()); |
7714 SetStaticValue(value.IsNull() ? Instance::null_instance() | 7716 SetStaticValue(value.IsNull() ? Instance::null_instance() |
7715 : Instance::Cast(value)); | 7717 : Instance::Cast(value)); |
7716 return; | 7718 return; |
7717 } else if (StaticValue() == Object::transition_sentinel().raw()) { | 7719 } else if (StaticValue() == Object::transition_sentinel().raw()) { |
(...skipping 15147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22865 return tag_label.ToCString(); | 22867 return tag_label.ToCString(); |
22866 } | 22868 } |
22867 | 22869 |
22868 | 22870 |
22869 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 22871 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
22870 Instance::PrintJSONImpl(stream, ref); | 22872 Instance::PrintJSONImpl(stream, ref); |
22871 } | 22873 } |
22872 | 22874 |
22873 | 22875 |
22874 } // namespace dart | 22876 } // namespace dart |
OLD | NEW |