| 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 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1380 // called like a regular function and can't be entered via OSR. | 1380 // called like a regular function and can't be entered via OSR. |
| 1381 if (!CanOptimizeFunction(function, isolate) || function.is_intrinsic()) { | 1381 if (!CanOptimizeFunction(function, isolate) || function.is_intrinsic()) { |
| 1382 return; | 1382 return; |
| 1383 } | 1383 } |
| 1384 | 1384 |
| 1385 // The unoptimized code is on the stack and should never be detached from | 1385 // The unoptimized code is on the stack and should never be detached from |
| 1386 // the function at this point. | 1386 // the function at this point. |
| 1387 ASSERT(function.unoptimized_code() != Object::null()); | 1387 ASSERT(function.unoptimized_code() != Object::null()); |
| 1388 intptr_t osr_id = | 1388 intptr_t osr_id = |
| 1389 Code::Handle(function.unoptimized_code()).GetDeoptIdForOsr(frame->pc()); | 1389 Code::Handle(function.unoptimized_code()).GetDeoptIdForOsr(frame->pc()); |
| 1390 ASSERT(osr_id != Isolate::kNoDeoptId); | 1390 ASSERT(osr_id != Thread::kNoDeoptId); |
| 1391 if (FLAG_trace_osr) { | 1391 if (FLAG_trace_osr) { |
| 1392 OS::Print("Attempting OSR for %s at id=%" Pd ", count=%" Pd "\n", | 1392 OS::Print("Attempting OSR for %s at id=%" Pd ", count=%" Pd "\n", |
| 1393 function.ToFullyQualifiedCString(), | 1393 function.ToFullyQualifiedCString(), |
| 1394 osr_id, | 1394 osr_id, |
| 1395 function.usage_counter()); | 1395 function.usage_counter()); |
| 1396 } | 1396 } |
| 1397 | 1397 |
| 1398 const Code& original_code = Code::Handle(function.CurrentCode()); | 1398 const Code& original_code = Code::Handle(function.CurrentCode()); |
| 1399 // Since the code is referenced from the frame and the ZoneHandle, | 1399 // Since the code is referenced from the frame and the ZoneHandle, |
| 1400 // it cannot have been removed from the function. | 1400 // it cannot have been removed from the function. |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1835 const intptr_t elm_size = old_data.ElementSizeInBytes(); | 1835 const intptr_t elm_size = old_data.ElementSizeInBytes(); |
| 1836 const TypedData& new_data = | 1836 const TypedData& new_data = |
| 1837 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); | 1837 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); |
| 1838 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); | 1838 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); |
| 1839 typed_data_cell.SetAt(0, new_data); | 1839 typed_data_cell.SetAt(0, new_data); |
| 1840 arguments.SetReturn(new_data); | 1840 arguments.SetReturn(new_data); |
| 1841 } | 1841 } |
| 1842 | 1842 |
| 1843 | 1843 |
| 1844 } // namespace dart | 1844 } // namespace dart |
| OLD | NEW |