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

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

Issue 1412803014: PPC: Remove receiver conversion from function prologue (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | src/full-codegen/ppc/full-codegen-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/ppc/lithium-codegen-ppc.h" 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.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/hydrogen-osr.h" 10 #include "src/crankshaft/hydrogen-osr.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 __ stop("stop_at"); 110 __ stop("stop_at");
111 } 111 }
112 #endif 112 #endif
113 113
114 // r4: Callee's JS function. 114 // r4: Callee's JS function.
115 // cp: Callee's context. 115 // cp: Callee's context.
116 // pp: Callee's constant pool pointer (if enabled) 116 // pp: Callee's constant pool pointer (if enabled)
117 // fp: Caller's frame pointer. 117 // fp: Caller's frame pointer.
118 // lr: Caller's pc. 118 // lr: Caller's pc.
119 // ip: Our own function entry (required by the prologue) 119 // ip: Our own function entry (required by the prologue)
120
121 // Sloppy mode functions and builtins need to replace the receiver with the
122 // global proxy when called as functions (without an explicit receiver
123 // object).
124 if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) {
125 Label ok;
126 int receiver_offset = info_->scope()->num_parameters() * kPointerSize;
127 __ LoadP(r5, MemOperand(sp, receiver_offset));
128 __ CompareRoot(r5, Heap::kUndefinedValueRootIndex);
129 __ bne(&ok);
130
131 __ LoadP(r5, GlobalObjectOperand());
132 __ LoadP(r5, FieldMemOperand(r5, JSGlobalObject::kGlobalProxyOffset));
133
134 __ StoreP(r5, MemOperand(sp, receiver_offset));
135
136 __ bind(&ok);
137 }
138 } 120 }
139 121
140 int prologue_offset = masm_->pc_offset(); 122 int prologue_offset = masm_->pc_offset();
141 123
142 if (prologue_offset) { 124 if (prologue_offset) {
143 // Prologue logic requires it's starting address in ip and the 125 // Prologue logic requires it's starting address in ip and the
144 // corresponding offset from the function entry. 126 // corresponding offset from the function entry.
145 prologue_offset += Instruction::kInstrSize; 127 prologue_offset += Instruction::kInstrSize;
146 __ addi(ip, ip, Operand(prologue_offset)); 128 __ addi(ip, ip, Operand(prologue_offset));
147 } 129 }
(...skipping 5917 matching lines...) Expand 10 before | Expand all | Expand 10 after
6065 __ Push(scope_info); 6047 __ Push(scope_info);
6066 __ push(ToRegister(instr->function())); 6048 __ push(ToRegister(instr->function()));
6067 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6049 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6068 RecordSafepoint(Safepoint::kNoLazyDeopt); 6050 RecordSafepoint(Safepoint::kNoLazyDeopt);
6069 } 6051 }
6070 6052
6071 6053
6072 #undef __ 6054 #undef __
6073 } // namespace internal 6055 } // namespace internal
6074 } // namespace v8 6056 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698