| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
| 11 #include "src/interface-descriptors.h" |
| 11 | 12 |
| 12 namespace v8 { | 13 namespace v8 { |
| 13 namespace internal { | 14 namespace internal { |
| 14 | 15 |
| 15 #define __ ACCESS_MASM(masm) | 16 #define __ ACCESS_MASM(masm) |
| 16 | 17 |
| 17 | 18 |
| 18 static void ProbeTable(Isolate* isolate, MacroAssembler* masm, | 19 static void ProbeTable(Isolate* isolate, MacroAssembler* masm, |
| 19 Code::Flags flags, bool leave_frame, | 20 Code::Flags flags, bool leave_frame, |
| 20 StubCache::Table table, Register name, Register receiver, | 21 StubCache::Table table, Register name, Register receiver, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 49 __ j(not_equal, &miss); | 50 __ j(not_equal, &miss); |
| 50 | 51 |
| 51 #ifdef DEBUG | 52 #ifdef DEBUG |
| 52 if (FLAG_test_secondary_stub_cache && table == StubCache::kPrimary) { | 53 if (FLAG_test_secondary_stub_cache && table == StubCache::kPrimary) { |
| 53 __ jmp(&miss); | 54 __ jmp(&miss); |
| 54 } else if (FLAG_test_primary_stub_cache && table == StubCache::kSecondary) { | 55 } else if (FLAG_test_primary_stub_cache && table == StubCache::kSecondary) { |
| 55 __ jmp(&miss); | 56 __ jmp(&miss); |
| 56 } | 57 } |
| 57 #endif | 58 #endif |
| 58 | 59 |
| 60 if (FLAG_vector_ics) { |
| 61 // The vector and slot were pushed onto the stack before starting the |
| 62 // probe, and need to be restored for the miss handler. |
| 63 __ pop(VectorLoadICDescriptor::VectorRegister()); |
| 64 __ pop(VectorLoadICDescriptor::SlotRegister()); |
| 65 } |
| 66 |
| 59 if (leave_frame) __ leave(); | 67 if (leave_frame) __ leave(); |
| 60 | 68 |
| 61 // Jump to the first instruction in the code stub. | 69 // Jump to the first instruction in the code stub. |
| 62 __ add(extra, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 70 __ add(extra, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
| 63 __ jmp(extra); | 71 __ jmp(extra); |
| 64 | 72 |
| 65 __ bind(&miss); | 73 __ bind(&miss); |
| 66 } else { | 74 } else { |
| 67 // Save the offset on the stack. | 75 // Save the offset on the stack. |
| 68 __ push(offset); | 76 __ push(offset); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 __ bind(&miss); | 188 __ bind(&miss); |
| 181 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1); | 189 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1); |
| 182 } | 190 } |
| 183 | 191 |
| 184 | 192 |
| 185 #undef __ | 193 #undef __ |
| 186 } | 194 } |
| 187 } // namespace v8::internal | 195 } // namespace v8::internal |
| 188 | 196 |
| 189 #endif // V8_TARGET_ARCH_IA32 | 197 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |