| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/code_generator.h" | 5 #include "vm/code_generator.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
| 9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1479 ASSERT(!unoptimized_code.IsNull()); | 1479 ASSERT(!unoptimized_code.IsNull()); |
| 1480 // The switch to unoptimized code may have already occurred. | 1480 // The switch to unoptimized code may have already occurred. |
| 1481 if (function.HasOptimizedCode()) { | 1481 if (function.HasOptimizedCode()) { |
| 1482 function.SwitchToUnoptimizedCode(); | 1482 function.SwitchToUnoptimizedCode(); |
| 1483 } | 1483 } |
| 1484 // Patch call site (lazy deoptimization is quite rare, patching it twice | 1484 // Patch call site (lazy deoptimization is quite rare, patching it twice |
| 1485 // is not a performance issue). | 1485 // is not a performance issue). |
| 1486 uword lazy_deopt_jump = optimized_code.GetLazyDeoptPc(); | 1486 uword lazy_deopt_jump = optimized_code.GetLazyDeoptPc(); |
| 1487 ASSERT(lazy_deopt_jump != 0); | 1487 ASSERT(lazy_deopt_jump != 0); |
| 1488 CodePatcher::InsertCallAt(pc, lazy_deopt_jump); | 1488 CodePatcher::InsertCallAt(pc, lazy_deopt_jump); |
| 1489 if (FLAG_trace_patching) { |
| 1490 const String& name = String::Handle(function.name()); |
| 1491 OS::PrintErr("InsertCallAt: %" Px " to %" Px " for %s\n", pc, |
| 1492 lazy_deopt_jump, name.ToCString()); |
| 1493 } |
| 1489 // Mark code as dead (do not GC its embedded objects). | 1494 // Mark code as dead (do not GC its embedded objects). |
| 1490 optimized_code.set_is_alive(false); | 1495 optimized_code.set_is_alive(false); |
| 1491 } | 1496 } |
| 1492 | 1497 |
| 1493 | 1498 |
| 1494 // Currently checks only that all optimized frames have kDeoptIndex | 1499 // Currently checks only that all optimized frames have kDeoptIndex |
| 1495 // and unoptimized code has the kDeoptAfter. | 1500 // and unoptimized code has the kDeoptAfter. |
| 1496 void DeoptimizeAll() { | 1501 void DeoptimizeAll() { |
| 1497 DartFrameIterator iterator; | 1502 DartFrameIterator iterator; |
| 1498 StackFrame* frame = iterator.NextFrame(); | 1503 StackFrame* frame = iterator.NextFrame(); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1704 // of the given value. | 1709 // of the given value. |
| 1705 // Arg0: Field object; | 1710 // Arg0: Field object; |
| 1706 // Arg1: Value that is being stored. | 1711 // Arg1: Value that is being stored. |
| 1707 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { | 1712 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { |
| 1708 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); | 1713 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); |
| 1709 const Object& value = Object::Handle(arguments.ArgAt(1)); | 1714 const Object& value = Object::Handle(arguments.ArgAt(1)); |
| 1710 field.UpdateGuardedCidAndLength(value); | 1715 field.UpdateGuardedCidAndLength(value); |
| 1711 } | 1716 } |
| 1712 | 1717 |
| 1713 } // namespace dart | 1718 } // namespace dart |
| OLD | NEW |