| 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/code_generator.h" | 5 #include "vm/code_generator.h" |
| 6 | 6 |
| 7 #include "vm/assembler_macros.h" | 7 #include "vm/assembler_macros.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 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 } | 1337 } |
| 1338 | 1338 |
| 1339 | 1339 |
| 1340 // This is called from function that needs to be optimized. | 1340 // This is called from function that needs to be optimized. |
| 1341 // The requesting function can be already optimized (reoptimization). | 1341 // The requesting function can be already optimized (reoptimization). |
| 1342 DEFINE_RUNTIME_ENTRY(OptimizeInvokedFunction, 1) { | 1342 DEFINE_RUNTIME_ENTRY(OptimizeInvokedFunction, 1) { |
| 1343 ASSERT(arguments.ArgCount() == | 1343 ASSERT(arguments.ArgCount() == |
| 1344 kOptimizeInvokedFunctionRuntimeEntry.argument_count()); | 1344 kOptimizeInvokedFunctionRuntimeEntry.argument_count()); |
| 1345 const intptr_t kLowInvocationCount = -100000000; | 1345 const intptr_t kLowInvocationCount = -100000000; |
| 1346 const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); | 1346 const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); |
| 1347 if (isolate->debugger()->IsActive()) { | 1347 if (isolate->debugger()->HasBreakpoint(function)) { |
| 1348 // We cannot set breakpoints in optimized code, so do not optimize | 1348 // We cannot set breakpoints in optimized code, so do not optimize |
| 1349 // the function. | 1349 // the function. |
| 1350 function.set_usage_counter(0); | 1350 function.set_usage_counter(0); |
| 1351 return; | 1351 return; |
| 1352 } | 1352 } |
| 1353 if (function.deoptimization_counter() >= | 1353 if (function.deoptimization_counter() >= |
| 1354 FLAG_deoptimization_counter_threshold) { | 1354 FLAG_deoptimization_counter_threshold) { |
| 1355 if (FLAG_trace_failed_optimization_attempts) { | 1355 if (FLAG_trace_failed_optimization_attempts) { |
| 1356 PrintCaller("Too Many Deoptimizations"); | 1356 PrintCaller("Too Many Deoptimizations"); |
| 1357 } | 1357 } |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1788 return; | 1788 return; |
| 1789 } | 1789 } |
| 1790 HeapTrace* heap_trace = Isolate::Current()->heap()->trace(); | 1790 HeapTrace* heap_trace = Isolate::Current()->heap()->trace(); |
| 1791 heap_trace->TraceStoreIntoObject(RawObject::ToAddr(object), | 1791 heap_trace->TraceStoreIntoObject(RawObject::ToAddr(object), |
| 1792 field_addr, | 1792 field_addr, |
| 1793 RawObject::ToAddr(value)); | 1793 RawObject::ToAddr(value)); |
| 1794 } | 1794 } |
| 1795 END_LEAF_RUNTIME_ENTRY | 1795 END_LEAF_RUNTIME_ENTRY |
| 1796 | 1796 |
| 1797 } // namespace dart | 1797 } // namespace dart |
| OLD | NEW |