| 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/handler-configuration-inl.h" | 9 #include "src/ic/handler-configuration-inl.h" |
| 10 #include "src/ic/ic-inl.h" | 10 #include "src/ic/ic-inl.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 if (IC::ShouldPushPopSlotAndVector(kind())) { | 202 if (IC::ShouldPushPopSlotAndVector(kind())) { |
| 203 DiscardVectorAndSlot(); | 203 DiscardVectorAndSlot(); |
| 204 } | 204 } |
| 205 GenerateLoadConstant(isolate()->factory()->undefined_value()); | 205 GenerateLoadConstant(isolate()->factory()->undefined_value()); |
| 206 FrontendFooter(name, &miss); | 206 FrontendFooter(name, &miss); |
| 207 return GetCode(kind(), name); | 207 return GetCode(kind(), name); |
| 208 } | 208 } |
| 209 | 209 |
| 210 Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback( | 210 Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback( |
| 211 Handle<Name> name, Handle<AccessorInfo> callback, Handle<Code> slow_stub) { | 211 Handle<Name> name, Handle<AccessorInfo> callback, Handle<Code> slow_stub) { |
| 212 if (FLAG_runtime_call_stats) { | 212 if (V8_UNLIKELY(FLAG_runtime_stats)) { |
| 213 GenerateTailCall(masm(), slow_stub); | 213 GenerateTailCall(masm(), slow_stub); |
| 214 } | 214 } |
| 215 Register reg = Frontend(name); | 215 Register reg = Frontend(name); |
| 216 GenerateLoadCallback(reg, callback); | 216 GenerateLoadCallback(reg, callback); |
| 217 return GetCode(kind(), name); | 217 return GetCode(kind(), name); |
| 218 } | 218 } |
| 219 | 219 |
| 220 Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback( | 220 Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback( |
| 221 Handle<Name> name, const CallOptimization& call_optimization, | 221 Handle<Name> name, const CallOptimization& call_optimization, |
| 222 int accessor_index, Handle<Code> slow_stub) { | 222 int accessor_index, Handle<Code> slow_stub) { |
| 223 DCHECK(call_optimization.is_simple_api_call()); | 223 DCHECK(call_optimization.is_simple_api_call()); |
| 224 if (FLAG_runtime_call_stats) { | 224 if (V8_UNLIKELY(FLAG_runtime_stats)) { |
| 225 GenerateTailCall(masm(), slow_stub); | 225 GenerateTailCall(masm(), slow_stub); |
| 226 } | 226 } |
| 227 Register holder = Frontend(name); | 227 Register holder = Frontend(name); |
| 228 GenerateApiAccessorCall(masm(), call_optimization, map(), receiver(), | 228 GenerateApiAccessorCall(masm(), call_optimization, map(), receiver(), |
| 229 scratch2(), false, no_reg, holder, accessor_index); | 229 scratch2(), false, no_reg, holder, accessor_index); |
| 230 return GetCode(kind(), name); | 230 return GetCode(kind(), name); |
| 231 } | 231 } |
| 232 | 232 |
| 233 | 233 |
| 234 void NamedLoadHandlerCompiler::InterceptorVectorSlotPush(Register holder_reg) { | 234 void NamedLoadHandlerCompiler::InterceptorVectorSlotPush(Register holder_reg) { |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 GenerateStoreViaSetter(masm(), map(), receiver(), holder, accessor_index, | 568 GenerateStoreViaSetter(masm(), map(), receiver(), holder, accessor_index, |
| 569 expected_arguments, scratch2()); | 569 expected_arguments, scratch2()); |
| 570 | 570 |
| 571 return GetCode(kind(), name); | 571 return GetCode(kind(), name); |
| 572 } | 572 } |
| 573 | 573 |
| 574 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 574 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
| 575 Handle<JSObject> object, Handle<Name> name, | 575 Handle<JSObject> object, Handle<Name> name, |
| 576 const CallOptimization& call_optimization, int accessor_index, | 576 const CallOptimization& call_optimization, int accessor_index, |
| 577 Handle<Code> slow_stub) { | 577 Handle<Code> slow_stub) { |
| 578 if (FLAG_runtime_call_stats) { | 578 if (V8_UNLIKELY(FLAG_runtime_stats)) { |
| 579 GenerateTailCall(masm(), slow_stub); | 579 GenerateTailCall(masm(), slow_stub); |
| 580 } | 580 } |
| 581 Register holder = Frontend(name); | 581 Register holder = Frontend(name); |
| 582 if (Descriptor::kPassLastArgsOnStack) { | 582 if (Descriptor::kPassLastArgsOnStack) { |
| 583 __ LoadParameterFromStack<Descriptor>(value(), Descriptor::kValue); | 583 __ LoadParameterFromStack<Descriptor>(value(), Descriptor::kValue); |
| 584 } | 584 } |
| 585 GenerateApiAccessorCall(masm(), call_optimization, handle(object->map()), | 585 GenerateApiAccessorCall(masm(), call_optimization, handle(object->map()), |
| 586 receiver(), scratch2(), true, value(), holder, | 586 receiver(), scratch2(), true, value(), holder, |
| 587 accessor_index); | 587 accessor_index); |
| 588 return GetCode(kind(), name); | 588 return GetCode(kind(), name); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 } | 644 } |
| 645 | 645 |
| 646 void ElementHandlerCompiler::CompileElementHandlers( | 646 void ElementHandlerCompiler::CompileElementHandlers( |
| 647 MapHandleList* receiver_maps, List<Handle<Object>>* handlers) { | 647 MapHandleList* receiver_maps, List<Handle<Object>>* handlers) { |
| 648 for (int i = 0; i < receiver_maps->length(); ++i) { | 648 for (int i = 0; i < receiver_maps->length(); ++i) { |
| 649 handlers->Add(GetKeyedLoadHandler(receiver_maps->at(i), isolate())); | 649 handlers->Add(GetKeyedLoadHandler(receiver_maps->at(i), isolate())); |
| 650 } | 650 } |
| 651 } | 651 } |
| 652 } // namespace internal | 652 } // namespace internal |
| 653 } // namespace v8 | 653 } // namespace v8 |
| OLD | NEW |