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 4889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4931 if (!FLAG_support_debugger) { | 4932 if (!FLAG_support_debugger) { |
4932 return false; | 4933 return false; |
4933 } | 4934 } |
4934 Thread* thread = Thread::Current(); | 4935 Thread* thread = Thread::Current(); |
4935 return thread->isolate()->debugger()->HasBreakpoint(*this, thread->zone()); | 4936 return thread->isolate()->debugger()->HasBreakpoint(*this, thread->zone()); |
4936 } | 4937 } |
4937 | 4938 |
4938 | 4939 |
4939 void Function::InstallOptimizedCode(const Code& code, bool is_osr) const { | 4940 void Function::InstallOptimizedCode(const Code& code, bool is_osr) const { |
4940 DEBUG_ASSERT(IsMutatorOrAtSafepoint()); | 4941 DEBUG_ASSERT(IsMutatorOrAtSafepoint()); |
4941 // We may not have previous code if 'always_optimize' is set. | 4942 // We may not have previous code if FLAG_precompile is set. |
4942 if (!is_osr && HasCode()) { | 4943 if (!is_osr && HasCode()) { |
4943 Code::Handle(CurrentCode()).DisableDartCode(); | 4944 Code::Handle(CurrentCode()).DisableDartCode(); |
4944 } | 4945 } |
4945 AttachCode(code); | 4946 AttachCode(code); |
4946 } | 4947 } |
4947 | 4948 |
4948 | 4949 |
4949 void Function::SetInstructions(const Code& value) const { | 4950 void Function::SetInstructions(const Code& value) const { |
4950 DEBUG_ASSERT(IsMutatorOrAtSafepoint()); | 4951 DEBUG_ASSERT(IsMutatorOrAtSafepoint()); |
4951 SetInstructionsSafe(value); | 4952 SetInstructionsSafe(value); |
(...skipping 2383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7335 void Field::SetSavedInitialStaticValue(const Instance& value) const { | 7336 void Field::SetSavedInitialStaticValue(const Instance& value) const { |
7336 ASSERT(!HasPrecompiledInitializer()); | 7337 ASSERT(!HasPrecompiledInitializer()); |
7337 StorePointer(&raw_ptr()->initializer_.saved_value_, value.raw()); | 7338 StorePointer(&raw_ptr()->initializer_.saved_value_, value.raw()); |
7338 } | 7339 } |
7339 | 7340 |
7340 | 7341 |
7341 void Field::EvaluateInitializer() const { | 7342 void Field::EvaluateInitializer() const { |
7342 ASSERT(is_static()); | 7343 ASSERT(is_static()); |
7343 if (StaticValue() == Object::sentinel().raw()) { | 7344 if (StaticValue() == Object::sentinel().raw()) { |
7344 SetStaticValue(Object::transition_sentinel()); | 7345 SetStaticValue(Object::transition_sentinel()); |
7345 Object& value = Object::Handle(Compiler::EvaluateStaticInitializer(*this)); | 7346 const Object& value = |
| 7347 Object::Handle(Compiler::EvaluateStaticInitializer(*this)); |
7346 if (value.IsError()) { | 7348 if (value.IsError()) { |
7347 SetStaticValue(Object::null_instance()); | 7349 SetStaticValue(Object::null_instance()); |
7348 Exceptions::PropagateError(Error::Cast(value)); | 7350 Exceptions::PropagateError(Error::Cast(value)); |
7349 UNREACHABLE(); | 7351 UNREACHABLE(); |
7350 } | 7352 } |
7351 ASSERT(value.IsNull() || value.IsInstance()); | 7353 ASSERT(value.IsNull() || value.IsInstance()); |
7352 SetStaticValue(value.IsNull() ? Instance::null_instance() | 7354 SetStaticValue(value.IsNull() ? Instance::null_instance() |
7353 : Instance::Cast(value)); | 7355 : Instance::Cast(value)); |
7354 return; | 7356 return; |
7355 } else if (StaticValue() == Object::transition_sentinel().raw()) { | 7357 } else if (StaticValue() == Object::transition_sentinel().raw()) { |
(...skipping 14031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21387 return UserTag::null(); | 21389 return UserTag::null(); |
21388 } | 21390 } |
21389 | 21391 |
21390 | 21392 |
21391 const char* UserTag::ToCString() const { | 21393 const char* UserTag::ToCString() const { |
21392 const String& tag_label = String::Handle(label()); | 21394 const String& tag_label = String::Handle(label()); |
21393 return tag_label.ToCString(); | 21395 return tag_label.ToCString(); |
21394 } | 21396 } |
21395 | 21397 |
21396 } // namespace dart | 21398 } // namespace dart |
OLD | NEW |