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 #include "src/bailout-reason.h" | 7 #include "src/bailout-reason.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/field-index.h" | 9 #include "src/field-index.h" |
10 #include "src/hydrogen.h" | 10 #include "src/hydrogen.h" |
(...skipping 2153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2164 strings_match.Then(); | 2164 strings_match.Then(); |
2165 TailCallMiss(receiver, name, slot, vector, true); | 2165 TailCallMiss(receiver, name, slot, vector, true); |
2166 strings_match.End(); | 2166 strings_match.End(); |
2167 } | 2167 } |
2168 recorded_name_is_zero.End(); | 2168 recorded_name_is_zero.End(); |
2169 | 2169 |
2170 HandleArrayCases(feedback, receiver, name, slot, vector, true); | 2170 HandleArrayCases(feedback, receiver, name, slot, vector, true); |
2171 } | 2171 } |
2172 array_checker.Else(); | 2172 array_checker.Else(); |
2173 { | 2173 { |
2174 // Check if the IC is in generic state. | 2174 // Check if the IC is in megamorphic state. |
2175 IfBuilder generic_checker(this); | 2175 IfBuilder megamorphic_checker(this); |
2176 HConstant* generic_symbol = | 2176 HConstant* megamorphic_symbol = |
2177 Add<HConstant>(isolate()->factory()->generic_symbol()); | 2177 Add<HConstant>(isolate()->factory()->megamorphic_symbol()); |
2178 generic_checker.If<HCompareObjectEqAndBranch>(feedback, generic_symbol); | 2178 megamorphic_checker.If<HCompareObjectEqAndBranch>(feedback, |
2179 generic_checker.Then(); | 2179 megamorphic_symbol); |
| 2180 megamorphic_checker.Then(); |
2180 { | 2181 { |
2181 // Tail-call to the generic KeyedLoadIC, treating it like a handler. | 2182 // Tail-call to the megamorphic KeyedLoadIC, treating it like a handler. |
2182 Handle<Code> stub = KeyedLoadIC::ChooseMegamorphicStub(isolate()); | 2183 Handle<Code> stub = KeyedLoadIC::ChooseMegamorphicStub(isolate()); |
2183 HValue* constant_stub = Add<HConstant>(stub); | 2184 HValue* constant_stub = Add<HConstant>(stub); |
2184 LoadDescriptor descriptor(isolate()); | 2185 LoadDescriptor descriptor(isolate()); |
2185 HValue* op_vals[] = {context(), receiver, name}; | 2186 HValue* op_vals[] = {context(), receiver, name}; |
2186 Add<HCallWithDescriptor>(constant_stub, 0, descriptor, | 2187 Add<HCallWithDescriptor>(constant_stub, 0, descriptor, |
2187 Vector<HValue*>(op_vals, 3), TAIL_CALL); | 2188 Vector<HValue*>(op_vals, 3), TAIL_CALL); |
2188 // We never return here, it is a tail call. | 2189 // We never return here, it is a tail call. |
2189 } | 2190 } |
2190 generic_checker.End(); | 2191 megamorphic_checker.End(); |
2191 } | 2192 } |
2192 array_checker.End(); | 2193 array_checker.End(); |
2193 | 2194 |
2194 TailCallMiss(receiver, name, slot, vector, true); | 2195 TailCallMiss(receiver, name, slot, vector, true); |
2195 return zero; | 2196 return zero; |
2196 } | 2197 } |
2197 | 2198 |
2198 | 2199 |
2199 Handle<Code> VectorKeyedLoadStub::GenerateCode() { | 2200 Handle<Code> VectorKeyedLoadStub::GenerateCode() { |
2200 return DoGenerateCode(this); | 2201 return DoGenerateCode(this); |
(...skipping 14 matching lines...) Expand all Loading... |
2215 // megamorphic case is handled as part of the default stub. | 2216 // megamorphic case is handled as part of the default stub. |
2216 DCHECK(!FLAG_vector_ics); | 2217 DCHECK(!FLAG_vector_ics); |
2217 | 2218 |
2218 // Probe the stub cache. | 2219 // Probe the stub cache. |
2219 Add<HTailCallThroughMegamorphicCache>(receiver, name); | 2220 Add<HTailCallThroughMegamorphicCache>(receiver, name); |
2220 | 2221 |
2221 // We never continue. | 2222 // We never continue. |
2222 return graph()->GetConstant0(); | 2223 return graph()->GetConstant0(); |
2223 } | 2224 } |
2224 } } // namespace v8::internal | 2225 } } // namespace v8::internal |
OLD | NEW |