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

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

Issue 1702593002: More simplification and unification of frame handling (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Platform ports Created 4 years, 10 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/arm64/lithium-codegen-arm64.h" 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h"
6 6
7 #include "src/arm64/frames-arm64.h" 7 #include "src/arm64/frames-arm64.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 environment->HasTaggedValueAt(env_offset + i), 270 environment->HasTaggedValueAt(env_offset + i),
271 environment->HasUint32ValueAt(env_offset + i), 271 environment->HasUint32ValueAt(env_offset + i),
272 object_index_pointer, 272 object_index_pointer,
273 dematerialized_index_pointer); 273 dematerialized_index_pointer);
274 } 274 }
275 return; 275 return;
276 } 276 }
277 277
278 if (op->IsStackSlot()) { 278 if (op->IsStackSlot()) {
279 int index = op->index(); 279 int index = op->index();
280 if (index >= 0) {
281 index += StandardFrameConstants::kFixedFrameSize / kPointerSize;
282 }
283 if (is_tagged) { 280 if (is_tagged) {
284 translation->StoreStackSlot(index); 281 translation->StoreStackSlot(index);
285 } else if (is_uint32) { 282 } else if (is_uint32) {
286 translation->StoreUint32StackSlot(index); 283 translation->StoreUint32StackSlot(index);
287 } else { 284 } else {
288 translation->StoreInt32StackSlot(index); 285 translation->StoreInt32StackSlot(index);
289 } 286 }
290 } else if (op->IsDoubleStackSlot()) { 287 } else if (op->IsDoubleStackSlot()) {
291 int index = op->index(); 288 int index = op->index();
292 if (index >= 0) {
293 index += StandardFrameConstants::kFixedFrameSize / kPointerSize;
294 }
295 translation->StoreDoubleStackSlot(index); 289 translation->StoreDoubleStackSlot(index);
296 } else if (op->IsRegister()) { 290 } else if (op->IsRegister()) {
297 Register reg = ToRegister(op); 291 Register reg = ToRegister(op);
298 if (is_tagged) { 292 if (is_tagged) {
299 translation->StoreRegister(reg); 293 translation->StoreRegister(reg);
300 } else if (is_uint32) { 294 } else if (is_uint32) {
301 translation->StoreUint32Register(reg); 295 translation->StoreUint32Register(reg);
302 } else { 296 } else {
303 translation->StoreInt32Register(reg); 297 translation->StoreInt32Register(reg);
304 } 298 }
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 if (!is_aborted()) status_ = DONE; 851 if (!is_aborted()) status_ = DONE;
858 return !is_aborted(); 852 return !is_aborted();
859 } 853 }
860 854
861 855
862 bool LCodeGen::GenerateSafepointTable() { 856 bool LCodeGen::GenerateSafepointTable() {
863 DCHECK(is_done()); 857 DCHECK(is_done());
864 // We do not know how much data will be emitted for the safepoint table, so 858 // We do not know how much data will be emitted for the safepoint table, so
865 // force emission of the veneer pool. 859 // force emission of the veneer pool.
866 masm()->CheckVeneerPool(true, true); 860 masm()->CheckVeneerPool(true, true);
867 safepoints_.Emit(masm(), GetStackSlotCount()); 861 safepoints_.Emit(masm(), GetTotalFrameSlotCount());
868 return !is_aborted(); 862 return !is_aborted();
869 } 863 }
870 864
871 865
872 void LCodeGen::FinishCode(Handle<Code> code) { 866 void LCodeGen::FinishCode(Handle<Code> code) {
873 DCHECK(is_done()); 867 DCHECK(is_done());
874 code->set_stack_slots(GetStackSlotCount()); 868 code->set_stack_slots(GetStackSlotCount());
875 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); 869 code->set_safepoint_table_offset(safepoints_.GetCodeOffset());
876 PopulateDeoptimizationData(code); 870 PopulateDeoptimizationData(code);
877 } 871 }
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 return -(index + 1) * kPointerSize; 1142 return -(index + 1) * kPointerSize;
1149 } 1143 }
1150 1144
1151 1145
1152 MemOperand LCodeGen::ToMemOperand(LOperand* op, StackMode stack_mode) const { 1146 MemOperand LCodeGen::ToMemOperand(LOperand* op, StackMode stack_mode) const {
1153 DCHECK(op != NULL); 1147 DCHECK(op != NULL);
1154 DCHECK(!op->IsRegister()); 1148 DCHECK(!op->IsRegister());
1155 DCHECK(!op->IsDoubleRegister()); 1149 DCHECK(!op->IsDoubleRegister());
1156 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); 1150 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot());
1157 if (NeedsEagerFrame()) { 1151 if (NeedsEagerFrame()) {
1158 int fp_offset = StackSlotOffset(op->index()); 1152 int fp_offset = FrameSlotToFPOffset(op->index());
1159 // Loads and stores have a bigger reach in positive offset than negative. 1153 // Loads and stores have a bigger reach in positive offset than negative.
1160 // We try to access using jssp (positive offset) first, then fall back to 1154 // We try to access using jssp (positive offset) first, then fall back to
1161 // fp (negative offset) if that fails. 1155 // fp (negative offset) if that fails.
1162 // 1156 //
1163 // We can reference a stack slot from jssp only if we know how much we've 1157 // We can reference a stack slot from jssp only if we know how much we've
1164 // put on the stack. We don't know this in the following cases: 1158 // put on the stack. We don't know this in the following cases:
1165 // - stack_mode != kCanUseStackPointer: this is the case when deferred 1159 // - stack_mode != kCanUseStackPointer: this is the case when deferred
1166 // code has saved the registers. 1160 // code has saved the registers.
1167 // - saves_caller_doubles(): some double registers have been pushed, jssp 1161 // - saves_caller_doubles(): some double registers have been pushed, jssp
1168 // references the end of the double registers and not the end of the stack 1162 // references the end of the double registers and not the end of the stack
(...skipping 4573 matching lines...) Expand 10 before | Expand all | Expand 10 after
5742 Handle<ScopeInfo> scope_info = instr->scope_info(); 5736 Handle<ScopeInfo> scope_info = instr->scope_info();
5743 __ Push(scope_info); 5737 __ Push(scope_info);
5744 __ Push(ToRegister(instr->function())); 5738 __ Push(ToRegister(instr->function()));
5745 CallRuntime(Runtime::kPushBlockContext, instr); 5739 CallRuntime(Runtime::kPushBlockContext, instr);
5746 RecordSafepoint(Safepoint::kNoLazyDeopt); 5740 RecordSafepoint(Safepoint::kNoLazyDeopt);
5747 } 5741 }
5748 5742
5749 5743
5750 } // namespace internal 5744 } // namespace internal
5751 } // namespace v8 5745 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698