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/x64/lithium-codegen-x64.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/x64/ic-x64.cc ('k') | src/x64/stub-cache-x64.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 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 3232 matching lines...) Expand 10 before | Expand all | Expand 10 after
3243 Condition is_smi = __ CheckSmi(receiver); 3243 Condition is_smi = __ CheckSmi(receiver);
3244 DeoptimizeIf(is_smi, instr->environment()); 3244 DeoptimizeIf(is_smi, instr->environment());
3245 __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, kScratchRegister); 3245 __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, kScratchRegister);
3246 DeoptimizeIf(below, instr->environment()); 3246 DeoptimizeIf(below, instr->environment());
3247 __ jmp(&receiver_ok, Label::kNear); 3247 __ jmp(&receiver_ok, Label::kNear);
3248 3248
3249 __ bind(&global_object); 3249 __ bind(&global_object);
3250 // TODO(kmillikin): We have a hydrogen value for the global object. See 3250 // TODO(kmillikin): We have a hydrogen value for the global object. See
3251 // if it's better to use it than to explicitly fetch it from the context 3251 // if it's better to use it than to explicitly fetch it from the context
3252 // here. 3252 // here.
3253 __ movq(receiver, Operand(rbp, StandardFrameConstants::kContextOffset)); 3253 CallStubCompiler::FetchGlobalProxy(masm(), receiver, function);
3254 __ movq(receiver, ContextOperand(receiver, Context::GLOBAL_OBJECT_INDEX));
3255 __ movq(receiver,
3256 FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset));
3257 __ bind(&receiver_ok); 3254 __ bind(&receiver_ok);
3258 } 3255 }
3259 3256
3260 3257
3261 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { 3258 void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
3262 Register receiver = ToRegister(instr->receiver()); 3259 Register receiver = ToRegister(instr->receiver());
3263 Register function = ToRegister(instr->function()); 3260 Register function = ToRegister(instr->function());
3264 Register length = ToRegister(instr->length()); 3261 Register length = ToRegister(instr->length());
3265 Register elements = ToRegister(instr->elements()); 3262 Register elements = ToRegister(instr->elements());
3266 ASSERT(receiver.is(rax)); // Used for parameter count. 3263 ASSERT(receiver.is(rax)); // Used for parameter count.
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
3811 CallCode(ic, mode, instr); 3808 CallCode(ic, mode, instr);
3812 } 3809 }
3813 3810
3814 3811
3815 void LCodeGen::DoCallFunction(LCallFunction* instr) { 3812 void LCodeGen::DoCallFunction(LCallFunction* instr) {
3816 ASSERT(ToRegister(instr->context()).is(rsi)); 3813 ASSERT(ToRegister(instr->context()).is(rsi));
3817 ASSERT(ToRegister(instr->function()).is(rdi)); 3814 ASSERT(ToRegister(instr->function()).is(rdi));
3818 ASSERT(ToRegister(instr->result()).is(rax)); 3815 ASSERT(ToRegister(instr->result()).is(rax));
3819 3816
3820 int arity = instr->arity(); 3817 int arity = instr->arity();
3821 CallFunctionStub stub(arity, NO_CALL_FUNCTION_FLAGS); 3818 CallFunctionFlags flags =
3819 instr->hydrogen()->IsContextualCall() ?
3820 RECEIVER_IS_IMPLICIT : NO_CALL_FUNCTION_FLAGS;
3821 CallFunctionStub stub(arity, flags);
3822 if (instr->hydrogen()->IsTailCall()) { 3822 if (instr->hydrogen()->IsTailCall()) {
3823 if (NeedsEagerFrame()) __ leave(); 3823 if (NeedsEagerFrame()) __ leave();
3824 __ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); 3824 __ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
3825 } else { 3825 } else {
3826 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 3826 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
3827 } 3827 }
3828 } 3828 }
3829 3829
3830 3830
3831 void LCodeGen::DoCallGlobal(LCallGlobal* instr) { 3831 void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
(...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after
5634 FixedArray::kHeaderSize - kPointerSize)); 5634 FixedArray::kHeaderSize - kPointerSize));
5635 __ bind(&done); 5635 __ bind(&done);
5636 } 5636 }
5637 5637
5638 5638
5639 #undef __ 5639 #undef __
5640 5640
5641 } } // namespace v8::internal 5641 } } // namespace v8::internal
5642 5642
5643 #endif // V8_TARGET_ARCH_X64 5643 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « 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