| 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 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1445 const Function& function = Function::CheckedHandle(zone, | 1445 const Function& function = Function::CheckedHandle(zone, |
| 1446 arguments.ArgAt(0)); | 1446 arguments.ArgAt(0)); |
| 1447 ASSERT(!function.IsNull()); | 1447 ASSERT(!function.IsNull()); |
| 1448 ASSERT(function.HasCode()); | 1448 ASSERT(function.HasCode()); |
| 1449 | 1449 |
| 1450 if (CanOptimizeFunction(function, isolate)) { | 1450 if (CanOptimizeFunction(function, isolate)) { |
| 1451 // Reset usage counter for reoptimization before calling optimizer to | 1451 // Reset usage counter for reoptimization before calling optimizer to |
| 1452 // prevent recursive triggering of function optimization. | 1452 // prevent recursive triggering of function optimization. |
| 1453 function.set_usage_counter(0); | 1453 function.set_usage_counter(0); |
| 1454 if (FLAG_background_compilation) { | 1454 if (FLAG_background_compilation) { |
| 1455 BackgroundCompiler::EnsureInit(isolate); | 1455 BackgroundCompiler::EnsureInit(thread); |
| 1456 ASSERT(isolate->background_compiler() != NULL); | 1456 ASSERT(isolate->background_compiler() != NULL); |
| 1457 isolate->background_compiler()->CompileOptimized(function); | 1457 isolate->background_compiler()->CompileOptimized(function); |
| 1458 // Continue in the same code. | 1458 // Continue in the same code. |
| 1459 arguments.SetReturn(Code::Handle(zone, function.CurrentCode())); | 1459 arguments.SetReturn(Code::Handle(zone, function.CurrentCode())); |
| 1460 return; | 1460 return; |
| 1461 } | 1461 } |
| 1462 if (FLAG_trace_compiler) { | 1462 if (FLAG_trace_compiler) { |
| 1463 if (function.HasOptimizedCode()) { | 1463 if (function.HasOptimizedCode()) { |
| 1464 THR_Print("ReCompiling function: '%s' \n", | 1464 THR_Print("ReCompiling function: '%s' \n", |
| 1465 function.ToFullyQualifiedCString()); | 1465 function.ToFullyQualifiedCString()); |
| (...skipping 369 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 |