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

Side by Side Diff: src/crankshaft/arm/lithium-codegen-arm.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
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/crankshaft/arm64/lithium-codegen-arm64.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/crankshaft/arm/lithium-codegen-arm.h" 5 #include "src/crankshaft/arm/lithium-codegen-arm.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 info_->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { 108 info_->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
109 __ stop("stop_at"); 109 __ stop("stop_at");
110 } 110 }
111 #endif 111 #endif
112 112
113 // r1: Callee's JS function. 113 // r1: Callee's JS function.
114 // cp: Callee's context. 114 // cp: Callee's context.
115 // pp: Callee's constant pool pointer (if enabled) 115 // pp: Callee's constant pool pointer (if enabled)
116 // fp: Caller's frame pointer. 116 // fp: Caller's frame pointer.
117 // lr: Caller's pc. 117 // lr: Caller's pc.
118
119 // Sloppy mode functions and builtins need to replace the receiver with the
120 // global proxy when called as functions (without an explicit receiver
121 // object).
122 if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) {
123 Label ok;
124 int receiver_offset = info_->scope()->num_parameters() * kPointerSize;
125 __ ldr(r2, MemOperand(sp, receiver_offset));
126 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex);
127 __ b(ne, &ok);
128
129 __ ldr(r2, GlobalObjectOperand());
130 __ ldr(r2, FieldMemOperand(r2, JSGlobalObject::kGlobalProxyOffset));
131
132 __ str(r2, MemOperand(sp, receiver_offset));
133
134 __ bind(&ok);
135 }
136 } 118 }
137 119
138 info()->set_prologue_offset(masm_->pc_offset()); 120 info()->set_prologue_offset(masm_->pc_offset());
139 if (NeedsEagerFrame()) { 121 if (NeedsEagerFrame()) {
140 if (info()->IsStub()) { 122 if (info()->IsStub()) {
141 __ StubPrologue(); 123 __ StubPrologue();
142 } else { 124 } else {
143 __ Prologue(info()->IsCodePreAgingActive()); 125 __ Prologue(info()->IsCodePreAgingActive());
144 } 126 }
145 frame_is_built_ = true; 127 frame_is_built_ = true;
(...skipping 5642 matching lines...) Expand 10 before | Expand all | Expand 10 after
5788 __ push(ToRegister(instr->function())); 5770 __ push(ToRegister(instr->function()));
5789 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5771 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5790 RecordSafepoint(Safepoint::kNoLazyDeopt); 5772 RecordSafepoint(Safepoint::kNoLazyDeopt);
5791 } 5773 }
5792 5774
5793 5775
5794 #undef __ 5776 #undef __
5795 5777
5796 } // namespace internal 5778 } // namespace internal
5797 } // namespace v8 5779 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/crankshaft/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698