OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3235 Condition is_smi = __ CheckSmi(receiver); | 3235 Condition is_smi = __ CheckSmi(receiver); |
3236 DeoptimizeIf(is_smi, instr->environment()); | 3236 DeoptimizeIf(is_smi, instr->environment()); |
3237 __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, kScratchRegister); | 3237 __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, kScratchRegister); |
3238 DeoptimizeIf(below, instr->environment()); | 3238 DeoptimizeIf(below, instr->environment()); |
3239 __ jmp(&receiver_ok, Label::kNear); | 3239 __ jmp(&receiver_ok, Label::kNear); |
3240 | 3240 |
3241 __ bind(&global_object); | 3241 __ bind(&global_object); |
3242 // TODO(kmillikin): We have a hydrogen value for the global object. See | 3242 // TODO(kmillikin): We have a hydrogen value for the global object. See |
3243 // if it's better to use it than to explicitly fetch it from the context | 3243 // if it's better to use it than to explicitly fetch it from the context |
3244 // here. | 3244 // here. |
3245 __ movq(receiver, Operand(rbp, StandardFrameConstants::kContextOffset)); | 3245 CallStubCompiler::FetchGlobalProxy(masm(), function, receiver); |
3246 __ movq(receiver, ContextOperand(receiver, Context::GLOBAL_OBJECT_INDEX)); | |
3247 __ movq(receiver, | |
3248 FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset)); | |
3249 __ bind(&receiver_ok); | 3246 __ bind(&receiver_ok); |
3250 } | 3247 } |
3251 | 3248 |
3252 | 3249 |
3253 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { | 3250 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
3254 Register receiver = ToRegister(instr->receiver()); | 3251 Register receiver = ToRegister(instr->receiver()); |
3255 Register function = ToRegister(instr->function()); | 3252 Register function = ToRegister(instr->function()); |
3256 Register length = ToRegister(instr->length()); | 3253 Register length = ToRegister(instr->length()); |
3257 Register elements = ToRegister(instr->elements()); | 3254 Register elements = ToRegister(instr->elements()); |
3258 ASSERT(receiver.is(rax)); // Used for parameter count. | 3255 ASSERT(receiver.is(rax)); // Used for parameter count. |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3803 CallCode(ic, mode, instr); | 3800 CallCode(ic, mode, instr); |
3804 } | 3801 } |
3805 | 3802 |
3806 | 3803 |
3807 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 3804 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
3808 ASSERT(ToRegister(instr->context()).is(rsi)); | 3805 ASSERT(ToRegister(instr->context()).is(rsi)); |
3809 ASSERT(ToRegister(instr->function()).is(rdi)); | 3806 ASSERT(ToRegister(instr->function()).is(rdi)); |
3810 ASSERT(ToRegister(instr->result()).is(rax)); | 3807 ASSERT(ToRegister(instr->result()).is(rax)); |
3811 | 3808 |
3812 int arity = instr->arity(); | 3809 int arity = instr->arity(); |
3813 CallFunctionStub stub(arity, NO_CALL_FUNCTION_FLAGS); | 3810 CallFunctionFlags flags = |
| 3811 instr->hydrogen()->IsContextualCall() ? |
| 3812 RECEIVER_IS_IMPLICIT : NO_CALL_FUNCTION_FLAGS; |
| 3813 CallFunctionStub stub(arity, flags); |
3814 if (instr->hydrogen()->IsTailCall()) { | 3814 if (instr->hydrogen()->IsTailCall()) { |
3815 if (NeedsEagerFrame()) __ leave(); | 3815 if (NeedsEagerFrame()) __ leave(); |
3816 __ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); | 3816 __ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); |
3817 } else { | 3817 } else { |
3818 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 3818 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
3819 } | 3819 } |
3820 } | 3820 } |
3821 | 3821 |
3822 | 3822 |
3823 void LCodeGen::DoCallGlobal(LCallGlobal* instr) { | 3823 void LCodeGen::DoCallGlobal(LCallGlobal* instr) { |
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5592 FixedArray::kHeaderSize - kPointerSize)); | 5592 FixedArray::kHeaderSize - kPointerSize)); |
5593 __ bind(&done); | 5593 __ bind(&done); |
5594 } | 5594 } |
5595 | 5595 |
5596 | 5596 |
5597 #undef __ | 5597 #undef __ |
5598 | 5598 |
5599 } } // namespace v8::internal | 5599 } } // namespace v8::internal |
5600 | 5600 |
5601 #endif // V8_TARGET_ARCH_X64 | 5601 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |