OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ic/handler-compiler.h" | 5 #include "src/ic/handler-compiler.h" |
6 | 6 |
7 #include "src/field-type.h" | 7 #include "src/field-type.h" |
8 #include "src/ic/call-optimization.h" | 8 #include "src/ic/call-optimization.h" |
9 #include "src/ic/ic-inl.h" | 9 #include "src/ic/ic-inl.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 } | 219 } |
220 GenerateLoadConstant(isolate()->factory()->undefined_value()); | 220 GenerateLoadConstant(isolate()->factory()->undefined_value()); |
221 FrontendFooter(name, &miss); | 221 FrontendFooter(name, &miss); |
222 return GetCode(kind(), name); | 222 return GetCode(kind(), name); |
223 } | 223 } |
224 | 224 |
225 | 225 |
226 Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback( | 226 Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback( |
227 Handle<Name> name, Handle<AccessorInfo> callback) { | 227 Handle<Name> name, Handle<AccessorInfo> callback) { |
228 Register reg = Frontend(name); | 228 Register reg = Frontend(name); |
229 GenerateLoadCallback(reg, callback); | 229 if (FLAG_runtime_call_stats) { |
| 230 TailCallBuiltin(masm(), Builtins::kLoadIC_Slow); |
| 231 } else { |
| 232 GenerateLoadCallback(reg, callback); |
| 233 } |
230 return GetCode(kind(), name); | 234 return GetCode(kind(), name); |
231 } | 235 } |
232 | 236 |
233 | 237 |
234 Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback( | 238 Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback( |
235 Handle<Name> name, const CallOptimization& call_optimization, | 239 Handle<Name> name, const CallOptimization& call_optimization, |
236 int accessor_index) { | 240 int accessor_index) { |
237 DCHECK(call_optimization.is_simple_api_call()); | 241 DCHECK(call_optimization.is_simple_api_call()); |
238 Register holder = Frontend(name); | 242 Register holder = Frontend(name); |
239 GenerateApiAccessorCall(masm(), call_optimization, map(), receiver(), | 243 if (FLAG_runtime_call_stats) { |
240 scratch2(), false, no_reg, holder, accessor_index); | 244 TailCallBuiltin(masm(), Builtins::kLoadIC_Slow); |
| 245 } else { |
| 246 GenerateApiAccessorCall(masm(), call_optimization, map(), receiver(), |
| 247 scratch2(), false, no_reg, holder, accessor_index); |
| 248 } |
241 return GetCode(kind(), name); | 249 return GetCode(kind(), name); |
242 } | 250 } |
243 | 251 |
244 | 252 |
245 void NamedLoadHandlerCompiler::InterceptorVectorSlotPush(Register holder_reg) { | 253 void NamedLoadHandlerCompiler::InterceptorVectorSlotPush(Register holder_reg) { |
246 if (IC::ICUseVector(kind())) { | 254 if (IC::ICUseVector(kind())) { |
247 if (holder_reg.is(receiver())) { | 255 if (holder_reg.is(receiver())) { |
248 PushVectorAndSlot(); | 256 PushVectorAndSlot(); |
249 } else { | 257 } else { |
250 DCHECK(holder_reg.is(scratch1())); | 258 DCHECK(holder_reg.is(scratch1())); |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 expected_arguments, scratch2()); | 562 expected_arguments, scratch2()); |
555 | 563 |
556 return GetCode(kind(), name); | 564 return GetCode(kind(), name); |
557 } | 565 } |
558 | 566 |
559 | 567 |
560 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 568 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
561 Handle<JSObject> object, Handle<Name> name, | 569 Handle<JSObject> object, Handle<Name> name, |
562 const CallOptimization& call_optimization, int accessor_index) { | 570 const CallOptimization& call_optimization, int accessor_index) { |
563 Register holder = Frontend(name); | 571 Register holder = Frontend(name); |
564 GenerateApiAccessorCall(masm(), call_optimization, handle(object->map()), | 572 if (FLAG_runtime_call_stats) { |
565 receiver(), scratch2(), true, value(), holder, | 573 GenerateRestoreName(name); |
566 accessor_index); | 574 TailCallBuiltin(masm(), Builtins::kStoreIC_Slow); |
| 575 } else { |
| 576 GenerateApiAccessorCall(masm(), call_optimization, handle(object->map()), |
| 577 receiver(), scratch2(), true, value(), holder, |
| 578 accessor_index); |
| 579 } |
567 return GetCode(kind(), name); | 580 return GetCode(kind(), name); |
568 } | 581 } |
569 | 582 |
570 | 583 |
571 #undef __ | 584 #undef __ |
572 | 585 |
573 void ElementHandlerCompiler::CompileElementHandlers( | 586 void ElementHandlerCompiler::CompileElementHandlers( |
574 MapHandleList* receiver_maps, CodeHandleList* handlers) { | 587 MapHandleList* receiver_maps, CodeHandleList* handlers) { |
575 for (int i = 0; i < receiver_maps->length(); ++i) { | 588 for (int i = 0; i < receiver_maps->length(); ++i) { |
576 Handle<Map> receiver_map = receiver_maps->at(i); | 589 Handle<Map> receiver_map = receiver_maps->at(i); |
(...skipping 29 matching lines...) Expand all Loading... |
606 LoadICState state = LoadICState(kNoExtraICState); | 619 LoadICState state = LoadICState(kNoExtraICState); |
607 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); | 620 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); |
608 } | 621 } |
609 } | 622 } |
610 | 623 |
611 handlers->Add(cached_stub); | 624 handlers->Add(cached_stub); |
612 } | 625 } |
613 } | 626 } |
614 } // namespace internal | 627 } // namespace internal |
615 } // namespace v8 | 628 } // namespace v8 |
OLD | NEW |