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/ia32/lithium-codegen-ia32.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: Also fix bug on ARM. Created 6 years, 11 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
« no previous file with comments | « src/ia32/ic-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 3657 matching lines...) Expand 10 before | Expand all | Expand 10 after
3668 __ test(receiver, Immediate(kSmiTagMask)); 3668 __ test(receiver, Immediate(kSmiTagMask));
3669 DeoptimizeIf(equal, instr->environment()); 3669 DeoptimizeIf(equal, instr->environment());
3670 __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, scratch); 3670 __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, scratch);
3671 DeoptimizeIf(below, instr->environment()); 3671 DeoptimizeIf(below, instr->environment());
3672 __ jmp(&receiver_ok, Label::kNear); 3672 __ jmp(&receiver_ok, Label::kNear);
3673 3673
3674 __ bind(&global_object); 3674 __ bind(&global_object);
3675 // TODO(kmillikin): We have a hydrogen value for the global object. See 3675 // TODO(kmillikin): We have a hydrogen value for the global object. See
3676 // if it's better to use it than to explicitly fetch it from the context 3676 // if it's better to use it than to explicitly fetch it from the context
3677 // here. 3677 // here.
3678 __ mov(receiver, Operand(ebp, StandardFrameConstants::kContextOffset)); 3678 CallStubCompiler::FetchGlobalProxy(masm(), receiver, function);
3679 __ mov(receiver, ContextOperand(receiver, Context::GLOBAL_OBJECT_INDEX));
3680 __ mov(receiver,
3681 FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset));
3682 __ bind(&receiver_ok); 3679 __ bind(&receiver_ok);
3683 } 3680 }
3684 3681
3685 3682
3686 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { 3683 void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
3687 Register receiver = ToRegister(instr->receiver()); 3684 Register receiver = ToRegister(instr->receiver());
3688 Register function = ToRegister(instr->function()); 3685 Register function = ToRegister(instr->function());
3689 Register length = ToRegister(instr->length()); 3686 Register length = ToRegister(instr->length());
3690 Register elements = ToRegister(instr->elements()); 3687 Register elements = ToRegister(instr->elements());
3691 ASSERT(receiver.is(eax)); // Used for parameter count. 3688 ASSERT(receiver.is(eax)); // Used for parameter count.
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
4238 CallCode(ic, mode, instr); 4235 CallCode(ic, mode, instr);
4239 } 4236 }
4240 4237
4241 4238
4242 void LCodeGen::DoCallFunction(LCallFunction* instr) { 4239 void LCodeGen::DoCallFunction(LCallFunction* instr) {
4243 ASSERT(ToRegister(instr->context()).is(esi)); 4240 ASSERT(ToRegister(instr->context()).is(esi));
4244 ASSERT(ToRegister(instr->function()).is(edi)); 4241 ASSERT(ToRegister(instr->function()).is(edi));
4245 ASSERT(ToRegister(instr->result()).is(eax)); 4242 ASSERT(ToRegister(instr->result()).is(eax));
4246 4243
4247 int arity = instr->arity(); 4244 int arity = instr->arity();
4248 CallFunctionStub stub(arity, NO_CALL_FUNCTION_FLAGS); 4245 CallFunctionFlags flags =
4246 instr->hydrogen()->IsContextualCall() ?
4247 RECEIVER_IS_IMPLICIT : NO_CALL_FUNCTION_FLAGS;
4248 CallFunctionStub stub(arity, flags);
4249 if (instr->hydrogen()->IsTailCall()) { 4249 if (instr->hydrogen()->IsTailCall()) {
4250 if (NeedsEagerFrame()) __ leave(); 4250 if (NeedsEagerFrame()) __ leave();
4251 __ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); 4251 __ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
4252 } else { 4252 } else {
4253 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 4253 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
4254 } 4254 }
4255 } 4255 }
4256 4256
4257 4257
4258 void LCodeGen::DoCallGlobal(LCallGlobal* instr) { 4258 void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
(...skipping 2104 matching lines...) Expand 10 before | Expand all | Expand 10 after
6363 FixedArray::kHeaderSize - kPointerSize)); 6363 FixedArray::kHeaderSize - kPointerSize));
6364 __ bind(&done); 6364 __ bind(&done);
6365 } 6365 }
6366 6366
6367 6367
6368 #undef __ 6368 #undef __
6369 6369
6370 } } // namespace v8::internal 6370 } } // namespace v8::internal
6371 6371
6372 #endif // V8_TARGET_ARCH_IA32 6372 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/ic-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698