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

Side by Side Diff: src/crankshaft/mips/lithium-codegen-mips.cc

Issue 1414883011: Remove receiver conversion from function prologue (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 if (strlen(FLAG_stop_at) > 0 && 131 if (strlen(FLAG_stop_at) > 0 &&
132 info_->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { 132 info_->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
133 __ stop("stop_at"); 133 __ stop("stop_at");
134 } 134 }
135 #endif 135 #endif
136 136
137 // a1: Callee's JS function. 137 // a1: Callee's JS function.
138 // cp: Callee's context. 138 // cp: Callee's context.
139 // fp: Caller's frame pointer. 139 // fp: Caller's frame pointer.
140 // lr: Caller's pc. 140 // lr: Caller's pc.
141
142 // Sloppy mode functions and builtins need to replace the receiver with the
143 // global proxy when called as functions (without an explicit receiver
144 // object).
145 if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) {
146 Label ok;
147 int receiver_offset = info_->scope()->num_parameters() * kPointerSize;
148 __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
149 __ lw(a2, MemOperand(sp, receiver_offset));
150 __ Branch(&ok, ne, a2, Operand(at));
151
152 __ lw(a2, GlobalObjectOperand());
153 __ lw(a2, FieldMemOperand(a2, JSGlobalObject::kGlobalProxyOffset));
154
155 __ sw(a2, MemOperand(sp, receiver_offset));
156
157 __ bind(&ok);
158 }
159 } 141 }
160 142
161 info()->set_prologue_offset(masm_->pc_offset()); 143 info()->set_prologue_offset(masm_->pc_offset());
162 if (NeedsEagerFrame()) { 144 if (NeedsEagerFrame()) {
163 if (info()->IsStub()) { 145 if (info()->IsStub()) {
164 __ StubPrologue(); 146 __ StubPrologue();
165 } else { 147 } else {
166 __ Prologue(info()->IsCodePreAgingActive()); 148 __ Prologue(info()->IsCodePreAgingActive());
167 } 149 }
168 frame_is_built_ = true; 150 frame_is_built_ = true;
(...skipping 5675 matching lines...) Expand 10 before | Expand all | Expand 10 after
5844 __ Push(at, ToRegister(instr->function())); 5826 __ Push(at, ToRegister(instr->function()));
5845 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5827 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5846 RecordSafepoint(Safepoint::kNoLazyDeopt); 5828 RecordSafepoint(Safepoint::kNoLazyDeopt);
5847 } 5829 }
5848 5830
5849 5831
5850 #undef __ 5832 #undef __
5851 5833
5852 } // namespace internal 5834 } // namespace internal
5853 } // namespace v8 5835 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/ia32/lithium-codegen-ia32.cc ('k') | src/crankshaft/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698