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

Side by Side Diff: src/arm/lithium-codegen-arm.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 7 years 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 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 3476 matching lines...) Expand 10 before | Expand all | Expand 10 after
3487 __ b(eq, &global_object); 3487 __ b(eq, &global_object);
3488 3488
3489 // Deoptimize if the receiver is not a JS object. 3489 // Deoptimize if the receiver is not a JS object.
3490 __ SmiTst(receiver); 3490 __ SmiTst(receiver);
3491 DeoptimizeIf(eq, instr->environment()); 3491 DeoptimizeIf(eq, instr->environment());
3492 __ CompareObjectType(receiver, scratch, scratch, FIRST_SPEC_OBJECT_TYPE); 3492 __ CompareObjectType(receiver, scratch, scratch, FIRST_SPEC_OBJECT_TYPE);
3493 DeoptimizeIf(lt, instr->environment()); 3493 DeoptimizeIf(lt, instr->environment());
3494 __ b(&result_in_receiver); 3494 __ b(&result_in_receiver);
3495 3495
3496 __ bind(&global_object); 3496 __ bind(&global_object);
3497 __ ldr(result, GlobalObjectOperand()); 3497 CallStubCompiler::FetchGlobalProxy(masm(), receiver, function);
3498 __ ldr(result, 3498
3499 FieldMemOperand(result, JSGlobalObject::kGlobalReceiverOffset));
3500 if (result.is(receiver)) { 3499 if (result.is(receiver)) {
3501 __ bind(&result_in_receiver); 3500 __ bind(&result_in_receiver);
3502 } else { 3501 } else {
3503 Label result_ok; 3502 Label result_ok;
3504 __ b(&result_ok); 3503 __ b(&result_ok);
3505 __ bind(&result_in_receiver); 3504 __ bind(&result_in_receiver);
3506 __ mov(result, receiver); 3505 __ mov(result, receiver);
3507 __ bind(&result_ok); 3506 __ bind(&result_ok);
3508 } 3507 }
3509 } 3508 }
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
3987 CallCode(ic, mode, instr, NEVER_INLINE_TARGET_ADDRESS); 3986 CallCode(ic, mode, instr, NEVER_INLINE_TARGET_ADDRESS);
3988 } 3987 }
3989 3988
3990 3989
3991 void LCodeGen::DoCallFunction(LCallFunction* instr) { 3990 void LCodeGen::DoCallFunction(LCallFunction* instr) {
3992 ASSERT(ToRegister(instr->context()).is(cp)); 3991 ASSERT(ToRegister(instr->context()).is(cp));
3993 ASSERT(ToRegister(instr->function()).is(r1)); 3992 ASSERT(ToRegister(instr->function()).is(r1));
3994 ASSERT(ToRegister(instr->result()).is(r0)); 3993 ASSERT(ToRegister(instr->result()).is(r0));
3995 3994
3996 int arity = instr->arity(); 3995 int arity = instr->arity();
3997 CallFunctionStub stub(arity, NO_CALL_FUNCTION_FLAGS); 3996 CallFunctionFlags flags =
3997 instr->hydrogen()->IsContextualCall() ?
3998 RECEIVER_IS_IMPLICIT : NO_CALL_FUNCTION_FLAGS;
3999 CallFunctionStub stub(arity, flags);
3998 if (instr->hydrogen()->IsTailCall()) { 4000 if (instr->hydrogen()->IsTailCall()) {
3999 if (NeedsEagerFrame()) __ mov(sp, fp); 4001 if (NeedsEagerFrame()) __ mov(sp, fp);
4000 __ Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); 4002 __ Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
4001 } else { 4003 } else {
4002 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 4004 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
4003 } 4005 }
4004 } 4006 }
4005 4007
4006 4008
4007 void LCodeGen::DoCallGlobal(LCallGlobal* instr) { 4009 void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
(...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after
5815 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5817 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5816 __ ldr(result, FieldMemOperand(scratch, 5818 __ ldr(result, FieldMemOperand(scratch,
5817 FixedArray::kHeaderSize - kPointerSize)); 5819 FixedArray::kHeaderSize - kPointerSize));
5818 __ bind(&done); 5820 __ bind(&done);
5819 } 5821 }
5820 5822
5821 5823
5822 #undef __ 5824 #undef __
5823 5825
5824 } } // namespace v8::internal 5826 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698