Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 111613003: Load the global proxy from the context of the target function. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: don't embed global object or receiver in hydrogen Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 3218 matching lines...) Expand 10 before | Expand all | Expand 10 after
3229 Condition is_smi = __ CheckSmi(receiver); 3229 Condition is_smi = __ CheckSmi(receiver);
3230 DeoptimizeIf(is_smi, instr->environment()); 3230 DeoptimizeIf(is_smi, instr->environment());
3231 __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, kScratchRegister); 3231 __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, kScratchRegister);
3232 DeoptimizeIf(below, instr->environment()); 3232 DeoptimizeIf(below, instr->environment());
3233 __ jmp(&receiver_ok, Label::kNear); 3233 __ jmp(&receiver_ok, Label::kNear);
3234 3234
3235 __ bind(&global_object); 3235 __ bind(&global_object);
3236 // TODO(kmillikin): We have a hydrogen value for the global object. See 3236 // TODO(kmillikin): We have a hydrogen value for the global object. See
3237 // if it's better to use it than to explicitly fetch it from the context 3237 // if it's better to use it than to explicitly fetch it from the context
3238 // here. 3238 // here.
3239 __ movq(receiver, Operand(rbp, StandardFrameConstants::kContextOffset)); 3239 CallStubCompiler::FetchGlobalProxy(masm(), receiver, function);
3240 __ movq(receiver, ContextOperand(receiver, Context::GLOBAL_OBJECT_INDEX));
3241 __ movq(receiver,
3242 FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset));
3243 __ bind(&receiver_ok); 3240 __ bind(&receiver_ok);
3244 } 3241 }
3245 3242
3246 3243
3247 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { 3244 void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
3248 Register receiver = ToRegister(instr->receiver()); 3245 Register receiver = ToRegister(instr->receiver());
3249 Register function = ToRegister(instr->function()); 3246 Register function = ToRegister(instr->function());
3250 Register length = ToRegister(instr->length()); 3247 Register length = ToRegister(instr->length());
3251 Register elements = ToRegister(instr->elements()); 3248 Register elements = ToRegister(instr->elements());
3252 ASSERT(receiver.is(rax)); // Used for parameter count. 3249 ASSERT(receiver.is(rax)); // Used for parameter count.
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
3797 CallCode(ic, mode, instr); 3794 CallCode(ic, mode, instr);
3798 } 3795 }
3799 3796
3800 3797
3801 void LCodeGen::DoCallFunction(LCallFunction* instr) { 3798 void LCodeGen::DoCallFunction(LCallFunction* instr) {
3802 ASSERT(ToRegister(instr->context()).is(rsi)); 3799 ASSERT(ToRegister(instr->context()).is(rsi));
3803 ASSERT(ToRegister(instr->function()).is(rdi)); 3800 ASSERT(ToRegister(instr->function()).is(rdi));
3804 ASSERT(ToRegister(instr->result()).is(rax)); 3801 ASSERT(ToRegister(instr->result()).is(rax));
3805 3802
3806 int arity = instr->arity(); 3803 int arity = instr->arity();
3807 CallFunctionStub stub(arity, NO_CALL_FUNCTION_FLAGS); 3804 CallFunctionFlags flags =
3805 instr->hydrogen()->IsContextualCall() ?
3806 RECEIVER_IS_IMPLICIT : NO_CALL_FUNCTION_FLAGS;
3807 CallFunctionStub stub(arity, flags);
3808 if (instr->hydrogen()->IsTailCall()) { 3808 if (instr->hydrogen()->IsTailCall()) {
3809 if (NeedsEagerFrame()) __ leave(); 3809 if (NeedsEagerFrame()) __ leave();
3810 __ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); 3810 __ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
3811 } else { 3811 } else {
3812 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 3812 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
3813 } 3813 }
3814 } 3814 }
3815 3815
3816 3816
3817 void LCodeGen::DoCallGlobal(LCallGlobal* instr) { 3817 void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after
5586 FixedArray::kHeaderSize - kPointerSize)); 5586 FixedArray::kHeaderSize - kPointerSize));
5587 __ bind(&done); 5587 __ bind(&done);
5588 } 5588 }
5589 5589
5590 5590
5591 #undef __ 5591 #undef __
5592 5592
5593 } } // namespace v8::internal 5593 } } // namespace v8::internal
5594 5594
5595 #endif // V8_TARGET_ARCH_X64 5595 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/ia32/code-stubs-ia32.cc ('K') | « src/x64/ic-x64.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698