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_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1950 | 1950 |
1951 // result = receiver[f](arg); | 1951 // result = receiver[f](arg); |
1952 __ bind(&l_call); | 1952 __ bind(&l_call); |
1953 __ mov(load_receiver, Operand(esp, kPointerSize)); | 1953 __ mov(load_receiver, Operand(esp, kPointerSize)); |
1954 __ mov(LoadDescriptor::SlotRegister(), | 1954 __ mov(LoadDescriptor::SlotRegister(), |
1955 Immediate(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); | 1955 Immediate(SmiFromSlot(expr->KeyedLoadFeedbackSlot()))); |
1956 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code(); | 1956 Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code(); |
1957 CallIC(ic, TypeFeedbackId::None()); | 1957 CallIC(ic, TypeFeedbackId::None()); |
1958 __ mov(edi, eax); | 1958 __ mov(edi, eax); |
1959 __ mov(Operand(esp, 2 * kPointerSize), edi); | 1959 __ mov(Operand(esp, 2 * kPointerSize), edi); |
1960 SetCallPosition(expr, 1); | 1960 SetCallPosition(expr); |
1961 __ Set(eax, 1); | 1961 __ Set(eax, 1); |
1962 __ Call( | 1962 __ Call( |
1963 isolate()->builtins()->Call(ConvertReceiverMode::kNotNullOrUndefined), | 1963 isolate()->builtins()->Call(ConvertReceiverMode::kNotNullOrUndefined), |
1964 RelocInfo::CODE_TARGET); | 1964 RelocInfo::CODE_TARGET); |
1965 | 1965 |
1966 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 1966 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
1967 __ Drop(1); // The function is still on the stack; drop it. | 1967 __ Drop(1); // The function is still on the stack; drop it. |
1968 | 1968 |
1969 // if (!result.done) goto l_try; | 1969 // if (!result.done) goto l_try; |
1970 __ bind(&l_loop); | 1970 __ bind(&l_loop); |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2748 | 2748 |
2749 void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) { | 2749 void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) { |
2750 // Load the arguments. | 2750 // Load the arguments. |
2751 ZoneList<Expression*>* args = expr->arguments(); | 2751 ZoneList<Expression*>* args = expr->arguments(); |
2752 int arg_count = args->length(); | 2752 int arg_count = args->length(); |
2753 for (int i = 0; i < arg_count; i++) { | 2753 for (int i = 0; i < arg_count; i++) { |
2754 VisitForStackValue(args->at(i)); | 2754 VisitForStackValue(args->at(i)); |
2755 } | 2755 } |
2756 | 2756 |
2757 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); | 2757 PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
2758 SetCallPosition(expr, arg_count); | 2758 SetCallPosition(expr); |
2759 Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count, mode).code(); | 2759 Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count, mode).code(); |
2760 __ Move(edx, Immediate(SmiFromSlot(expr->CallFeedbackICSlot()))); | 2760 __ Move(edx, Immediate(SmiFromSlot(expr->CallFeedbackICSlot()))); |
2761 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); | 2761 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); |
2762 // Don't assign a type feedback id to the IC, since type feedback is provided | 2762 // Don't assign a type feedback id to the IC, since type feedback is provided |
2763 // by the vector above. | 2763 // by the vector above. |
2764 CallIC(ic); | 2764 CallIC(ic); |
2765 | 2765 |
2766 RecordJSReturnSite(expr); | 2766 RecordJSReturnSite(expr); |
2767 | 2767 |
2768 // Restore context register. | 2768 // Restore context register. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2852 // Push a copy of the function (found below the arguments) and | 2852 // Push a copy of the function (found below the arguments) and |
2853 // resolve eval. | 2853 // resolve eval. |
2854 __ push(Operand(esp, (arg_count + 1) * kPointerSize)); | 2854 __ push(Operand(esp, (arg_count + 1) * kPointerSize)); |
2855 EmitResolvePossiblyDirectEval(arg_count); | 2855 EmitResolvePossiblyDirectEval(arg_count); |
2856 | 2856 |
2857 // Touch up the stack with the resolved function. | 2857 // Touch up the stack with the resolved function. |
2858 __ mov(Operand(esp, (arg_count + 1) * kPointerSize), eax); | 2858 __ mov(Operand(esp, (arg_count + 1) * kPointerSize), eax); |
2859 | 2859 |
2860 PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS); | 2860 PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS); |
2861 | 2861 |
2862 SetCallPosition(expr, arg_count); | 2862 SetCallPosition(expr); |
2863 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); | 2863 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); |
2864 __ Set(eax, arg_count); | 2864 __ Set(eax, arg_count); |
2865 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 2865 __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
2866 RecordJSReturnSite(expr); | 2866 RecordJSReturnSite(expr); |
2867 // Restore context register. | 2867 // Restore context register. |
2868 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 2868 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
2869 context()->DropAndPlug(1, eax); | 2869 context()->DropAndPlug(1, eax); |
2870 } | 2870 } |
2871 | 2871 |
2872 | 2872 |
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4058 __ push(Immediate(isolate()->factory()->undefined_value())); | 4058 __ push(Immediate(isolate()->factory()->undefined_value())); |
4059 | 4059 |
4060 __ LoadGlobalFunction(expr->context_index(), eax); | 4060 __ LoadGlobalFunction(expr->context_index(), eax); |
4061 } | 4061 } |
4062 | 4062 |
4063 | 4063 |
4064 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { | 4064 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
4065 ZoneList<Expression*>* args = expr->arguments(); | 4065 ZoneList<Expression*>* args = expr->arguments(); |
4066 int arg_count = args->length(); | 4066 int arg_count = args->length(); |
4067 | 4067 |
4068 SetCallPosition(expr, arg_count); | 4068 SetCallPosition(expr); |
4069 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); | 4069 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); |
4070 __ Set(eax, arg_count); | 4070 __ Set(eax, arg_count); |
4071 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), | 4071 __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), |
4072 RelocInfo::CODE_TARGET); | 4072 RelocInfo::CODE_TARGET); |
4073 } | 4073 } |
4074 | 4074 |
4075 | 4075 |
4076 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 4076 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
4077 ZoneList<Expression*>* args = expr->arguments(); | 4077 ZoneList<Expression*>* args = expr->arguments(); |
4078 int arg_count = args->length(); | 4078 int arg_count = args->length(); |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4864 Assembler::target_address_at(call_target_address, | 4864 Assembler::target_address_at(call_target_address, |
4865 unoptimized_code)); | 4865 unoptimized_code)); |
4866 return OSR_AFTER_STACK_CHECK; | 4866 return OSR_AFTER_STACK_CHECK; |
4867 } | 4867 } |
4868 | 4868 |
4869 | 4869 |
4870 } // namespace internal | 4870 } // namespace internal |
4871 } // namespace v8 | 4871 } // namespace v8 |
4872 | 4872 |
4873 #endif // V8_TARGET_ARCH_X87 | 4873 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |