| 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
| 8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
| 9 #include "src/ic/stub-cache.h" | 9 #include "src/ic/stub-cache.h" |
| 10 #include "src/interface-descriptors.h" | 10 #include "src/interface-descriptors.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // Check scratch register is valid, extra and extra2 are unused. | 103 // Check scratch register is valid, extra and extra2 are unused. |
| 104 DCHECK(!scratch.is(no_reg)); | 104 DCHECK(!scratch.is(no_reg)); |
| 105 DCHECK(extra2.is(no_reg)); | 105 DCHECK(extra2.is(no_reg)); |
| 106 DCHECK(extra3.is(no_reg)); | 106 DCHECK(extra3.is(no_reg)); |
| 107 | 107 |
| 108 #ifdef DEBUG | 108 #ifdef DEBUG |
| 109 // If vector-based ics are in use, ensure that scratch doesn't conflict with | 109 // If vector-based ics are in use, ensure that scratch doesn't conflict with |
| 110 // the vector and slot registers, which need to be preserved for a handler | 110 // the vector and slot registers, which need to be preserved for a handler |
| 111 // call or miss. | 111 // call or miss. |
| 112 if (IC::ICUseVector(ic_kind)) { | 112 if (IC::ICUseVector(ic_kind)) { |
| 113 if (ic_kind == Code::LOAD_IC || ic_kind == Code::KEYED_LOAD_IC) { | 113 Register vector = LoadWithVectorDescriptor::VectorRegister(); |
| 114 Register vector = LoadWithVectorDescriptor::VectorRegister(); | 114 Register slot = LoadDescriptor::SlotRegister(); |
| 115 Register slot = LoadDescriptor::SlotRegister(); | 115 DCHECK(!AreAliased(vector, slot, scratch)); |
| 116 DCHECK(!AreAliased(vector, slot, scratch)); | |
| 117 } else { | |
| 118 DCHECK(ic_kind == Code::STORE_IC || ic_kind == Code::KEYED_STORE_IC); | |
| 119 Register vector = VectorStoreICDescriptor::VectorRegister(); | |
| 120 Register slot = VectorStoreICDescriptor::SlotRegister(); | |
| 121 DCHECK(!AreAliased(vector, slot, scratch)); | |
| 122 } | |
| 123 } | 116 } |
| 124 #endif | 117 #endif |
| 125 | 118 |
| 126 Counters* counters = masm->isolate()->counters(); | 119 Counters* counters = masm->isolate()->counters(); |
| 127 __ IncrementCounter(counters->megamorphic_stub_cache_probes(), 1); | 120 __ IncrementCounter(counters->megamorphic_stub_cache_probes(), 1); |
| 128 | 121 |
| 129 // Check that the receiver isn't a smi. | 122 // Check that the receiver isn't a smi. |
| 130 __ JumpIfSmi(receiver, &miss); | 123 __ JumpIfSmi(receiver, &miss); |
| 131 | 124 |
| 132 // Get the map of the receiver and compute the hash. | 125 // Get the map of the receiver and compute the hash. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 159 __ bind(&miss); | 152 __ bind(&miss); |
| 160 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1); | 153 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1); |
| 161 } | 154 } |
| 162 | 155 |
| 163 | 156 |
| 164 #undef __ | 157 #undef __ |
| 165 } // namespace internal | 158 } // namespace internal |
| 166 } // namespace v8 | 159 } // namespace v8 |
| 167 | 160 |
| 168 #endif // V8_TARGET_ARCH_X64 | 161 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |