| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/code_generator.h" | 8 #include "vm/code_generator.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
| (...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1517 // - Match found -> jump to target. | 1517 // - Match found -> jump to target. |
| 1518 // - Match not found -> jump to IC miss. | 1518 // - Match not found -> jump to IC miss. |
| 1519 void StubCode::GenerateNArgsCheckInlineCacheStub(Assembler* assembler, | 1519 void StubCode::GenerateNArgsCheckInlineCacheStub(Assembler* assembler, |
| 1520 intptr_t num_args) { | 1520 intptr_t num_args) { |
| 1521 __ movl(EBX, FieldAddress(ECX, ICData::function_offset())); | 1521 __ movl(EBX, FieldAddress(ECX, ICData::function_offset())); |
| 1522 __ incl(FieldAddress(EBX, Function::usage_counter_offset())); | 1522 __ incl(FieldAddress(EBX, Function::usage_counter_offset())); |
| 1523 if (CodeGenerator::CanOptimize()) { | 1523 if (CodeGenerator::CanOptimize()) { |
| 1524 __ cmpl(FieldAddress(EBX, Function::usage_counter_offset()), | 1524 __ cmpl(FieldAddress(EBX, Function::usage_counter_offset()), |
| 1525 Immediate(FLAG_optimization_counter_threshold)); | 1525 Immediate(FLAG_optimization_counter_threshold)); |
| 1526 Label not_yet_hot; | 1526 Label not_yet_hot; |
| 1527 __ j(LESS_EQUAL, ¬_yet_hot); | 1527 __ j(LESS_EQUAL, ¬_yet_hot, Assembler::kNearJump); |
| 1528 __ EnterFrame(0); | 1528 __ EnterFrame(0); |
| 1529 __ pushl(ECX); // Preserve inline cache data object. | 1529 __ pushl(ECX); // Preserve inline cache data object. |
| 1530 __ pushl(EDX); // Preserve arguments array. | 1530 __ pushl(EDX); // Preserve arguments array. |
| 1531 __ pushl(EBX); // Argument for runtime: function object. | 1531 __ pushl(EBX); // Argument for runtime: function object. |
| 1532 __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry); | 1532 __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry); |
| 1533 __ popl(EBX); // Remove argument. | 1533 __ popl(EBX); // Remove argument. |
| 1534 __ popl(EDX); // Restore arguments array. | 1534 __ popl(EDX); // Restore arguments array. |
| 1535 __ popl(ECX); // Restore inline cache data object. | 1535 __ popl(ECX); // Restore inline cache data object. |
| 1536 __ LeaveFrame(); | 1536 __ LeaveFrame(); |
| 1537 __ Bind(¬_yet_hot); | 1537 __ Bind(¬_yet_hot); |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1854 // TOS + 2: instance. | 1854 // TOS + 2: instance. |
| 1855 // TOS + 3: cache array. | 1855 // TOS + 3: cache array. |
| 1856 // Result in ECX: null -> not found, otherwise result (true or false). | 1856 // Result in ECX: null -> not found, otherwise result (true or false). |
| 1857 void StubCode::GenerateSubtype3TestCacheStub(Assembler* assembler) { | 1857 void StubCode::GenerateSubtype3TestCacheStub(Assembler* assembler) { |
| 1858 GenerateSubtypeNTestCacheStub(assembler, 3); | 1858 GenerateSubtypeNTestCacheStub(assembler, 3); |
| 1859 } | 1859 } |
| 1860 | 1860 |
| 1861 } // namespace dart | 1861 } // namespace dart |
| 1862 | 1862 |
| 1863 #endif // defined TARGET_ARCH_IA32 | 1863 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |