Chromium Code Reviews| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
| (...skipping 2921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2932 #ifdef DEBUG | 2932 #ifdef DEBUG |
| 2933 // We want to verify that RecordJSReturnSite gets called on all paths | 2933 // We want to verify that RecordJSReturnSite gets called on all paths |
| 2934 // through this function. Avoid early returns. | 2934 // through this function. Avoid early returns. |
| 2935 expr->return_is_recorded_ = false; | 2935 expr->return_is_recorded_ = false; |
| 2936 #endif | 2936 #endif |
| 2937 | 2937 |
| 2938 Comment cmnt(masm_, "[ Call"); | 2938 Comment cmnt(masm_, "[ Call"); |
| 2939 Expression* callee = expr->expression(); | 2939 Expression* callee = expr->expression(); |
| 2940 Call::CallType call_type = expr->GetCallType(isolate()); | 2940 Call::CallType call_type = expr->GetCallType(isolate()); |
| 2941 | 2941 |
| 2942 if (call_type == Call::POSSIBLY_EVAL_CALL) { | 2942 if (call_type == Call::POSSIBLY_EVAL_CALL) { |
|
rossberg
2015/10/29 13:14:30
Perhaps this should be turned into a switch now. (
Michael Starzinger
2015/10/29 13:20:49
Would you accept an "in a follow-up CL" voucher fo
rossberg
2015/10/29 13:22:21
Certainly. :)
| |
| 2943 // In a call to eval, we first call RuntimeHidden_ResolvePossiblyDirectEval | 2943 // In a call to eval, we first call RuntimeHidden_ResolvePossiblyDirectEval |
| 2944 // to resolve the function we need to call. Then we call the resolved | 2944 // to resolve the function we need to call. Then we call the resolved |
| 2945 // function using the given arguments. | 2945 // function using the given arguments. |
| 2946 ZoneList<Expression*>* args = expr->arguments(); | 2946 ZoneList<Expression*>* args = expr->arguments(); |
| 2947 int arg_count = args->length(); | 2947 int arg_count = args->length(); |
| 2948 | 2948 |
| 2949 PushCalleeAndWithBaseObject(expr); | 2949 PushCalleeAndWithBaseObject(expr); |
| 2950 | 2950 |
| 2951 // Push the arguments. | 2951 // Push the arguments. |
| 2952 for (int i = 0; i < arg_count; i++) { | 2952 for (int i = 0; i < arg_count; i++) { |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 2971 // Restore context register. | 2971 // Restore context register. |
| 2972 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 2972 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 2973 context()->DropAndPlug(1, eax); | 2973 context()->DropAndPlug(1, eax); |
| 2974 | 2974 |
| 2975 } else if (call_type == Call::GLOBAL_CALL) { | 2975 } else if (call_type == Call::GLOBAL_CALL) { |
| 2976 EmitCallWithLoadIC(expr); | 2976 EmitCallWithLoadIC(expr); |
| 2977 } else if (call_type == Call::LOOKUP_SLOT_CALL) { | 2977 } else if (call_type == Call::LOOKUP_SLOT_CALL) { |
| 2978 // Call to a lookup slot (dynamically introduced variable). | 2978 // Call to a lookup slot (dynamically introduced variable). |
| 2979 PushCalleeAndWithBaseObject(expr); | 2979 PushCalleeAndWithBaseObject(expr); |
| 2980 EmitCall(expr); | 2980 EmitCall(expr); |
| 2981 } else if (call_type == Call::PROPERTY_CALL) { | 2981 } else if (call_type == Call::NAMED_PROPERTY_CALL) { |
| 2982 Property* property = callee->AsProperty(); | 2982 Property* property = callee->AsProperty(); |
| 2983 bool is_named_call = property->key()->IsPropertyName(); | 2983 VisitForStackValue(property->obj()); |
| 2984 if (property->IsSuperAccess()) { | 2984 EmitCallWithLoadIC(expr); |
| 2985 if (is_named_call) { | 2985 } else if (call_type == Call::KEYED_PROPERTY_CALL) { |
| 2986 EmitSuperCallWithLoadIC(expr); | 2986 Property* property = callee->AsProperty(); |
| 2987 } else { | 2987 VisitForStackValue(property->obj()); |
| 2988 EmitKeyedSuperCallWithLoadIC(expr); | 2988 EmitKeyedCallWithLoadIC(expr, property->key()); |
| 2989 } | 2989 } else if (call_type == Call::NAMED_SUPER_PROPERTY_CALL) { |
| 2990 } else { | 2990 EmitSuperCallWithLoadIC(expr); |
| 2991 VisitForStackValue(property->obj()); | 2991 } else if (call_type == Call::KEYED_SUPER_PROPERTY_CALL) { |
| 2992 if (is_named_call) { | 2992 EmitKeyedSuperCallWithLoadIC(expr); |
| 2993 EmitCallWithLoadIC(expr); | |
| 2994 } else { | |
| 2995 EmitKeyedCallWithLoadIC(expr, property->key()); | |
| 2996 } | |
| 2997 } | |
| 2998 } else if (call_type == Call::SUPER_CALL) { | 2993 } else if (call_type == Call::SUPER_CALL) { |
| 2999 EmitSuperConstructorCall(expr); | 2994 EmitSuperConstructorCall(expr); |
| 3000 } else { | 2995 } else { |
| 3001 DCHECK(call_type == Call::OTHER_CALL); | 2996 DCHECK(call_type == Call::OTHER_CALL); |
| 3002 // Call to an arbitrary expression not handled specially above. | 2997 // Call to an arbitrary expression not handled specially above. |
| 3003 VisitForStackValue(callee); | 2998 VisitForStackValue(callee); |
| 3004 __ push(Immediate(isolate()->factory()->undefined_value())); | 2999 __ push(Immediate(isolate()->factory()->undefined_value())); |
| 3005 // Emit function call. | 3000 // Emit function call. |
| 3006 EmitCall(expr); | 3001 EmitCall(expr); |
| 3007 } | 3002 } |
| (...skipping 2053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5061 Assembler::target_address_at(call_target_address, | 5056 Assembler::target_address_at(call_target_address, |
| 5062 unoptimized_code)); | 5057 unoptimized_code)); |
| 5063 return OSR_AFTER_STACK_CHECK; | 5058 return OSR_AFTER_STACK_CHECK; |
| 5064 } | 5059 } |
| 5065 | 5060 |
| 5066 | 5061 |
| 5067 } // namespace internal | 5062 } // namespace internal |
| 5068 } // namespace v8 | 5063 } // namespace v8 |
| 5069 | 5064 |
| 5070 #endif // V8_TARGET_ARCH_IA32 | 5065 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |