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 5368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5379 return Isolate::Current()->debugger()->HasBreakpoint(*this); | 5379 return Isolate::Current()->debugger()->HasBreakpoint(*this); |
5380 } | 5380 } |
5381 | 5381 |
5382 | 5382 |
5383 void Function::SetInstructions(const Code& value) const { | 5383 void Function::SetInstructions(const Code& value) const { |
5384 StorePointer(&raw_ptr()->code_, value.raw()); | 5384 StorePointer(&raw_ptr()->code_, value.raw()); |
5385 StoreNonPointer(&raw_ptr()->entry_point_, value.EntryPoint()); | 5385 StoreNonPointer(&raw_ptr()->entry_point_, value.EntryPoint()); |
5386 } | 5386 } |
5387 | 5387 |
5388 void Function::AttachCode(const Code& value) const { | 5388 void Function::AttachCode(const Code& value) const { |
| 5389 // Finish setting up code before activating it. |
| 5390 value.set_owner(*this); |
5389 SetInstructions(value); | 5391 SetInstructions(value); |
5390 ASSERT(Function::Handle(value.function()).IsNull() || | 5392 ASSERT(Function::Handle(value.function()).IsNull() || |
5391 (value.function() == this->raw())); | 5393 (value.function() == this->raw())); |
5392 value.set_owner(*this); | |
5393 } | 5394 } |
5394 | 5395 |
5395 | 5396 |
5396 bool Function::HasCode() const { | 5397 bool Function::HasCode() const { |
5397 ASSERT(raw_ptr()->code_ != Code::null()); | 5398 ASSERT(raw_ptr()->code_ != Code::null()); |
5398 return raw_ptr()->code_ != StubCode::LazyCompile_entry()->code(); | 5399 return raw_ptr()->code_ != StubCode::LazyCompile_entry()->code(); |
5399 } | 5400 } |
5400 | 5401 |
5401 | 5402 |
5402 void Function::ClearCode() const { | 5403 void Function::ClearCode() const { |
(...skipping 16359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21762 return tag_label.ToCString(); | 21763 return tag_label.ToCString(); |
21763 } | 21764 } |
21764 | 21765 |
21765 | 21766 |
21766 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21767 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
21767 Instance::PrintJSONImpl(stream, ref); | 21768 Instance::PrintJSONImpl(stream, ref); |
21768 } | 21769 } |
21769 | 21770 |
21770 | 21771 |
21771 } // namespace dart | 21772 } // namespace dart |
OLD | NEW |