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

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

Issue 104013008: Reland v8:18458 "Load the global proxy from the context of the target function." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/arm/ic-arm.cc ('k') | src/arm/stub-cache-arm.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 3473 matching lines...) Expand 10 before | Expand all | Expand 10 after
3484 __ b(eq, &global_object); 3484 __ b(eq, &global_object);
3485 3485
3486 // Deoptimize if the receiver is not a JS object. 3486 // Deoptimize if the receiver is not a JS object.
3487 __ SmiTst(receiver); 3487 __ SmiTst(receiver);
3488 DeoptimizeIf(eq, instr->environment()); 3488 DeoptimizeIf(eq, instr->environment());
3489 __ CompareObjectType(receiver, scratch, scratch, FIRST_SPEC_OBJECT_TYPE); 3489 __ CompareObjectType(receiver, scratch, scratch, FIRST_SPEC_OBJECT_TYPE);
3490 DeoptimizeIf(lt, instr->environment()); 3490 DeoptimizeIf(lt, instr->environment());
3491 __ b(&result_in_receiver); 3491 __ b(&result_in_receiver);
3492 3492
3493 __ bind(&global_object); 3493 __ bind(&global_object);
3494 CallStubCompiler::FetchGlobalProxy(masm(), receiver, function);
3494 3495
3495 __ ldr(result, MemOperand(fp, StandardFrameConstants::kContextOffset));
3496 __ ldr(result, ContextOperand(result, Context::GLOBAL_OBJECT_INDEX));
3497 __ ldr(result,
3498 FieldMemOperand(result, JSGlobalObject::kGlobalReceiverOffset));
3499 if (result.is(receiver)) { 3496 if (result.is(receiver)) {
3500 __ bind(&result_in_receiver); 3497 __ bind(&result_in_receiver);
3501 } else { 3498 } else {
3502 Label result_ok; 3499 Label result_ok;
3503 __ b(&result_ok); 3500 __ b(&result_ok);
3504 __ bind(&result_in_receiver); 3501 __ bind(&result_in_receiver);
3505 __ mov(result, receiver); 3502 __ mov(result, receiver);
3506 __ bind(&result_ok); 3503 __ bind(&result_ok);
3507 } 3504 }
3508 } 3505 }
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
3986 CallCode(ic, mode, instr, NEVER_INLINE_TARGET_ADDRESS); 3983 CallCode(ic, mode, instr, NEVER_INLINE_TARGET_ADDRESS);
3987 } 3984 }
3988 3985
3989 3986
3990 void LCodeGen::DoCallFunction(LCallFunction* instr) { 3987 void LCodeGen::DoCallFunction(LCallFunction* instr) {
3991 ASSERT(ToRegister(instr->context()).is(cp)); 3988 ASSERT(ToRegister(instr->context()).is(cp));
3992 ASSERT(ToRegister(instr->function()).is(r1)); 3989 ASSERT(ToRegister(instr->function()).is(r1));
3993 ASSERT(ToRegister(instr->result()).is(r0)); 3990 ASSERT(ToRegister(instr->result()).is(r0));
3994 3991
3995 int arity = instr->arity(); 3992 int arity = instr->arity();
3996 CallFunctionStub stub(arity, NO_CALL_FUNCTION_FLAGS); 3993 CallFunctionFlags flags =
3994 instr->hydrogen()->IsContextualCall() ?
3995 RECEIVER_IS_IMPLICIT : NO_CALL_FUNCTION_FLAGS;
3996 CallFunctionStub stub(arity, flags);
3997 if (instr->hydrogen()->IsTailCall()) { 3997 if (instr->hydrogen()->IsTailCall()) {
3998 if (NeedsEagerFrame()) __ mov(sp, fp); 3998 if (NeedsEagerFrame()) __ mov(sp, fp);
3999 __ Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); 3999 __ Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
4000 } else { 4000 } else {
4001 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 4001 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
4002 } 4002 }
4003 } 4003 }
4004 4004
4005 4005
4006 void LCodeGen::DoCallGlobal(LCallGlobal* instr) { 4006 void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after
5811 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5811 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5812 __ ldr(result, FieldMemOperand(scratch, 5812 __ ldr(result, FieldMemOperand(scratch,
5813 FixedArray::kHeaderSize - kPointerSize)); 5813 FixedArray::kHeaderSize - kPointerSize));
5814 __ bind(&done); 5814 __ bind(&done);
5815 } 5815 }
5816 5816
5817 5817
5818 #undef __ 5818 #undef __
5819 5819
5820 } } // namespace v8::internal 5820 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/ic-arm.cc ('k') | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698