| 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 4514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4525 | 4525 |
| 4526 | 4526 |
| 4527 void Function::SetCode(const Code& value) const { | 4527 void Function::SetCode(const Code& value) const { |
| 4528 StorePointer(&raw_ptr()->code_, value.raw()); | 4528 StorePointer(&raw_ptr()->code_, value.raw()); |
| 4529 ASSERT(Function::Handle(value.function()).IsNull() || | 4529 ASSERT(Function::Handle(value.function()).IsNull() || |
| 4530 (value.function() == this->raw())); | 4530 (value.function() == this->raw())); |
| 4531 value.set_owner(*this); | 4531 value.set_owner(*this); |
| 4532 } | 4532 } |
| 4533 | 4533 |
| 4534 | 4534 |
| 4535 void Function::ClearCode() const { |
| 4536 StorePointer(&raw_ptr()->code_, Code::null()); |
| 4537 StorePointer(&raw_ptr()->unoptimized_code_, Code::null()); |
| 4538 } |
| 4539 |
| 4540 |
| 4535 void Function::SwitchToUnoptimizedCode() const { | 4541 void Function::SwitchToUnoptimizedCode() const { |
| 4536 ASSERT(HasOptimizedCode()); | 4542 ASSERT(HasOptimizedCode()); |
| 4537 | 4543 |
| 4538 const Code& current_code = Code::Handle(CurrentCode()); | 4544 const Code& current_code = Code::Handle(CurrentCode()); |
| 4539 | 4545 |
| 4540 // Optimized code object might have been actually fully produced by the | 4546 // Optimized code object might have been actually fully produced by the |
| 4541 // intrinsifier in this case nothing has to be done. In fact an attempt to | 4547 // intrinsifier in this case nothing has to be done. In fact an attempt to |
| 4542 // patch such code will cause crash. | 4548 // patch such code will cause crash. |
| 4543 // TODO(vegorov): if intrisifier can fully intrinsify the function then we | 4549 // TODO(vegorov): if intrisifier can fully intrinsify the function then we |
| 4544 // should not later try to optimize it. | 4550 // should not later try to optimize it. |
| (...skipping 12928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17473 return "_MirrorReference"; | 17479 return "_MirrorReference"; |
| 17474 } | 17480 } |
| 17475 | 17481 |
| 17476 | 17482 |
| 17477 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 17483 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 17478 Instance::PrintToJSONStream(stream, ref); | 17484 Instance::PrintToJSONStream(stream, ref); |
| 17479 } | 17485 } |
| 17480 | 17486 |
| 17481 | 17487 |
| 17482 } // namespace dart | 17488 } // namespace dart |
| OLD | NEW |