| 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/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/assembler_macros.h" | 9 #include "vm/assembler_macros.h" |
| 10 #include "vm/code_generator.h" | |
| 11 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| 11 #include "vm/flow_graph_compiler.h" |
| 12 #include "vm/object_store.h" | 12 #include "vm/object_store.h" |
| 13 #include "vm/pages.h" | 13 #include "vm/pages.h" |
| 14 #include "vm/resolver.h" | 14 #include "vm/resolver.h" |
| 15 #include "vm/scavenger.h" | 15 #include "vm/scavenger.h" |
| 16 #include "vm/stub_code.h" | 16 #include "vm/stub_code.h" |
| 17 | 17 |
| 18 | 18 |
| 19 #define __ assembler-> | 19 #define __ assembler-> |
| 20 | 20 |
| 21 namespace dart { | 21 namespace dart { |
| (...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1556 // - Match found -> jump to target. | 1556 // - Match found -> jump to target. |
| 1557 // - Match not found -> jump to IC miss. | 1557 // - Match not found -> jump to IC miss. |
| 1558 // TODO(srdjan): Change IC data to keep class ids as integers not as Smi-s. | 1558 // TODO(srdjan): Change IC data to keep class ids as integers not as Smi-s. |
| 1559 void StubCode::GenerateNArgsCheckInlineCacheStub(Assembler* assembler, | 1559 void StubCode::GenerateNArgsCheckInlineCacheStub(Assembler* assembler, |
| 1560 intptr_t num_args) { | 1560 intptr_t num_args) { |
| 1561 const Immediate raw_null = | 1561 const Immediate raw_null = |
| 1562 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 1562 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 1563 | 1563 |
| 1564 __ movl(EBX, FieldAddress(ECX, ICData::function_offset())); | 1564 __ movl(EBX, FieldAddress(ECX, ICData::function_offset())); |
| 1565 __ incl(FieldAddress(EBX, Function::usage_counter_offset())); | 1565 __ incl(FieldAddress(EBX, Function::usage_counter_offset())); |
| 1566 if (CodeGenerator::CanOptimize()) { | 1566 if (FlowGraphCompiler::CanOptimize()) { |
| 1567 __ cmpl(FieldAddress(EBX, Function::usage_counter_offset()), | 1567 __ cmpl(FieldAddress(EBX, Function::usage_counter_offset()), |
| 1568 Immediate(FLAG_optimization_counter_threshold)); | 1568 Immediate(FLAG_optimization_counter_threshold)); |
| 1569 Label not_yet_hot; | 1569 Label not_yet_hot; |
| 1570 __ j(LESS_EQUAL, ¬_yet_hot, Assembler::kNearJump); | 1570 __ j(LESS_EQUAL, ¬_yet_hot, Assembler::kNearJump); |
| 1571 // Create a stub frame as we are pushing some objects on the stack before | 1571 // Create a stub frame as we are pushing some objects on the stack before |
| 1572 // calling into the runtime. | 1572 // calling into the runtime. |
| 1573 AssemblerMacros::EnterStubFrame(assembler); | 1573 AssemblerMacros::EnterStubFrame(assembler); |
| 1574 __ pushl(ECX); // Preserve inline cache data object. | 1574 __ pushl(ECX); // Preserve inline cache data object. |
| 1575 __ pushl(EDX); // Preserve arguments array. | 1575 __ pushl(EDX); // Preserve arguments array. |
| 1576 __ pushl(EBX); // Argument for runtime: function object. | 1576 __ pushl(EBX); // Argument for runtime: function object. |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1948 __ movl(EAX, Address(ESP, 4 * kWordSize)); // Load error object. | 1948 __ movl(EAX, Address(ESP, 4 * kWordSize)); // Load error object. |
| 1949 __ movl(EBP, Address(ESP, 3 * kWordSize)); // Load target frame_pointer. | 1949 __ movl(EBP, Address(ESP, 3 * kWordSize)); // Load target frame_pointer. |
| 1950 __ movl(EBX, Address(ESP, 1 * kWordSize)); // Load target PC into EBX. | 1950 __ movl(EBX, Address(ESP, 1 * kWordSize)); // Load target PC into EBX. |
| 1951 __ movl(ESP, Address(ESP, 2 * kWordSize)); // Load target stack_pointer. | 1951 __ movl(ESP, Address(ESP, 2 * kWordSize)); // Load target stack_pointer. |
| 1952 __ jmp(EBX); // Jump to the exception handler code. | 1952 __ jmp(EBX); // Jump to the exception handler code. |
| 1953 } | 1953 } |
| 1954 | 1954 |
| 1955 } // namespace dart | 1955 } // namespace dart |
| 1956 | 1956 |
| 1957 #endif // defined TARGET_ARCH_IA32 | 1957 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |