| 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/code_patcher.h" | 9 #include "vm/code_patcher.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1429 UNREACHABLE(); | 1429 UNREACHABLE(); |
| 1430 return ""; | 1430 return ""; |
| 1431 } | 1431 } |
| 1432 } | 1432 } |
| 1433 | 1433 |
| 1434 | 1434 |
| 1435 void DeoptimizeAt(const Code& optimized_code, uword pc) { | 1435 void DeoptimizeAt(const Code& optimized_code, uword pc) { |
| 1436 ASSERT(optimized_code.is_optimized()); | 1436 ASSERT(optimized_code.is_optimized()); |
| 1437 ICData::DeoptReasonId deopt_reason = ICData::kDeoptUnknown; | 1437 ICData::DeoptReasonId deopt_reason = ICData::kDeoptUnknown; |
| 1438 uint32_t deopt_flags = 0; | 1438 uint32_t deopt_flags = 0; |
| 1439 const DeoptInfo& deopt_info = DeoptInfo::Handle( | 1439 const TypedData& deopt_info = TypedData::Handle( |
| 1440 optimized_code.GetDeoptInfoAtPc(pc, &deopt_reason, &deopt_flags)); | 1440 optimized_code.GetDeoptInfoAtPc(pc, &deopt_reason, &deopt_flags)); |
| 1441 ASSERT(!deopt_info.IsNull()); | 1441 ASSERT(!deopt_info.IsNull()); |
| 1442 const Function& function = Function::Handle(optimized_code.function()); | 1442 const Function& function = Function::Handle(optimized_code.function()); |
| 1443 Compiler::EnsureUnoptimizedCode(Thread::Current(), function); | 1443 Compiler::EnsureUnoptimizedCode(Thread::Current(), function); |
| 1444 const Code& unoptimized_code = Code::Handle(function.unoptimized_code()); | 1444 const Code& unoptimized_code = Code::Handle(function.unoptimized_code()); |
| 1445 ASSERT(!unoptimized_code.IsNull()); | 1445 ASSERT(!unoptimized_code.IsNull()); |
| 1446 // The switch to unoptimized code may have already occurred. | 1446 // The switch to unoptimized code may have already occurred. |
| 1447 if (function.HasOptimizedCode()) { | 1447 if (function.HasOptimizedCode()) { |
| 1448 function.SwitchToUnoptimizedCode(); | 1448 function.SwitchToUnoptimizedCode(); |
| 1449 } | 1449 } |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1672 const intptr_t elm_size = old_data.ElementSizeInBytes(); | 1672 const intptr_t elm_size = old_data.ElementSizeInBytes(); |
| 1673 const TypedData& new_data = | 1673 const TypedData& new_data = |
| 1674 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); | 1674 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); |
| 1675 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); | 1675 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); |
| 1676 typed_data_cell.SetAt(0, new_data); | 1676 typed_data_cell.SetAt(0, new_data); |
| 1677 arguments.SetReturn(new_data); | 1677 arguments.SetReturn(new_data); |
| 1678 } | 1678 } |
| 1679 | 1679 |
| 1680 | 1680 |
| 1681 } // namespace dart | 1681 } // namespace dart |
| OLD | NEW |