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

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

Issue 1696043002: [runtime] Unify and simplify how frames are marked (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix merge problems Created 4 years, 9 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 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 // a1: Callee's JS function. 130 // a1: Callee's JS function.
131 // cp: Callee's context. 131 // cp: Callee's context.
132 // fp: Caller's frame pointer. 132 // fp: Caller's frame pointer.
133 // lr: Caller's pc. 133 // lr: Caller's pc.
134 } 134 }
135 135
136 info()->set_prologue_offset(masm_->pc_offset()); 136 info()->set_prologue_offset(masm_->pc_offset());
137 if (NeedsEagerFrame()) { 137 if (NeedsEagerFrame()) {
138 if (info()->IsStub()) { 138 if (info()->IsStub()) {
139 __ StubPrologue(); 139 __ StubPrologue(StackFrame::STUB);
140 } else { 140 } else {
141 __ Prologue(info()->GeneratePreagedPrologue()); 141 __ Prologue(info()->GeneratePreagedPrologue());
142 } 142 }
143 frame_is_built_ = true; 143 frame_is_built_ = true;
144 } 144 }
145 145
146 // Reserve space for the stack slots needed by the code. 146 // Reserve space for the stack slots needed by the code.
147 int slots = GetStackSlotCount(); 147 int slots = GetStackSlotCount();
148 if (slots > 0) { 148 if (slots > 0) {
149 if (FLAG_debug_code) { 149 if (FLAG_debug_code) {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 "-------------------- Deferred %s --------------------", 271 "-------------------- Deferred %s --------------------",
272 code->instruction_index(), 272 code->instruction_index(),
273 code->instr()->hydrogen_value()->id(), 273 code->instr()->hydrogen_value()->id(),
274 code->instr()->Mnemonic()); 274 code->instr()->Mnemonic());
275 __ bind(code->entry()); 275 __ bind(code->entry());
276 if (NeedsDeferredFrame()) { 276 if (NeedsDeferredFrame()) {
277 Comment(";;; Build frame"); 277 Comment(";;; Build frame");
278 DCHECK(!frame_is_built_); 278 DCHECK(!frame_is_built_);
279 DCHECK(info()->IsStub()); 279 DCHECK(info()->IsStub());
280 frame_is_built_ = true; 280 frame_is_built_ = true;
281 __ MultiPush(cp.bit() | fp.bit() | ra.bit());
282 __ li(scratch0(), Operand(Smi::FromInt(StackFrame::STUB))); 281 __ li(scratch0(), Operand(Smi::FromInt(StackFrame::STUB)));
283 __ push(scratch0()); 282 __ PushCommonFrame(scratch0());
284 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
285 Comment(";;; Deferred code"); 283 Comment(";;; Deferred code");
286 } 284 }
287 code->Generate(); 285 code->Generate();
288 if (NeedsDeferredFrame()) { 286 if (NeedsDeferredFrame()) {
289 Comment(";;; Destroy frame"); 287 Comment(";;; Destroy frame");
290 DCHECK(frame_is_built_); 288 DCHECK(frame_is_built_);
291 __ pop(at); 289 __ PopCommonFrame(scratch0());
292 __ MultiPop(cp.bit() | fp.bit() | ra.bit());
293 frame_is_built_ = false; 290 frame_is_built_ = false;
294 } 291 }
295 __ jmp(code->exit()); 292 __ jmp(code->exit());
296 } 293 }
297 } 294 }
298 // Deferred code is the last part of the instruction sequence. Mark 295 // Deferred code is the last part of the instruction sequence. Mark
299 // the generated code as done unless we bailed out. 296 // the generated code as done unless we bailed out.
300 if (!is_aborted()) status_ = DONE; 297 if (!is_aborted()) status_ = DONE;
301 return !is_aborted(); 298 return !is_aborted();
302 } 299 }
(...skipping 18 matching lines...) Expand all
321 DeoptComment(table_entry->deopt_info); 318 DeoptComment(table_entry->deopt_info);
322 319
323 // Second-level deopt table entries are contiguous and small, so instead 320 // Second-level deopt table entries are contiguous and small, so instead
324 // of loading the full, absolute address of each one, load an immediate 321 // of loading the full, absolute address of each one, load an immediate
325 // offset which will be added to the base address later. 322 // offset which will be added to the base address later.
326 __ li(entry_offset, Operand(entry - base)); 323 __ li(entry_offset, Operand(entry - base));
327 324
328 if (table_entry->needs_frame) { 325 if (table_entry->needs_frame) {
329 DCHECK(!info()->saves_caller_doubles()); 326 DCHECK(!info()->saves_caller_doubles());
330 Comment(";;; call deopt with frame"); 327 Comment(";;; call deopt with frame");
331 __ MultiPush(cp.bit() | fp.bit() | ra.bit()); 328 __ PushCommonFrame();
332 __ Call(&needs_frame); 329 __ Call(&needs_frame);
333 } else { 330 } else {
334 __ Call(&call_deopt_entry); 331 __ Call(&call_deopt_entry);
335 } 332 }
336 info()->LogDeoptCallPosition(masm()->pc_offset(), 333 info()->LogDeoptCallPosition(masm()->pc_offset(),
337 table_entry->deopt_info.inlining_id); 334 table_entry->deopt_info.inlining_id);
338 } 335 }
339 336
340 if (needs_frame.is_linked()) { 337 if (needs_frame.is_linked()) {
341 __ bind(&needs_frame); 338 __ bind(&needs_frame);
342 // This variant of deopt can only be used with stubs. Since we don't 339 // This variant of deopt can only be used with stubs. Since we don't
343 // have a function pointer to install in the stack frame that we're 340 // have a function pointer to install in the stack frame that we're
344 // building, install a special marker there instead. 341 // building, install a special marker there instead.
345 DCHECK(info()->IsStub());
346 __ li(at, Operand(Smi::FromInt(StackFrame::STUB))); 342 __ li(at, Operand(Smi::FromInt(StackFrame::STUB)));
347 __ push(at); 343 __ push(at);
348 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); 344 DCHECK(info()->IsStub());
349 } 345 }
350 346
351 Comment(";;; call deopt"); 347 Comment(";;; call deopt");
352 __ bind(&call_deopt_entry); 348 __ bind(&call_deopt_entry);
353 349
354 if (info()->saves_caller_doubles()) { 350 if (info()->saves_caller_doubles()) {
355 DCHECK(info()->IsStub()); 351 DCHECK(info()->IsStub());
356 RestoreCallerDoubles(); 352 RestoreCallerDoubles();
357 } 353 }
358 354
(...skipping 2626 matching lines...) Expand 10 before | Expand all | Expand 10 after
2985 Register scratch = scratch0(); 2981 Register scratch = scratch0();
2986 Register temp = scratch1(); 2982 Register temp = scratch1();
2987 Register result = ToRegister(instr->result()); 2983 Register result = ToRegister(instr->result());
2988 2984
2989 if (instr->hydrogen()->from_inlined()) { 2985 if (instr->hydrogen()->from_inlined()) {
2990 __ Subu(result, sp, 2 * kPointerSize); 2986 __ Subu(result, sp, 2 * kPointerSize);
2991 } else { 2987 } else {
2992 // Check if the calling frame is an arguments adaptor frame. 2988 // Check if the calling frame is an arguments adaptor frame.
2993 Label done, adapted; 2989 Label done, adapted;
2994 __ lw(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 2990 __ lw(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
2995 __ lw(result, MemOperand(scratch, StandardFrameConstants::kContextOffset)); 2991 __ lw(result,
2992 MemOperand(scratch, CommonFrameConstants::kContextOrFrameTypeOffset));
2996 __ Xor(temp, result, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 2993 __ Xor(temp, result, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
2997 2994
2998 // Result is the frame pointer for the frame if not adapted and for the real 2995 // Result is the frame pointer for the frame if not adapted and for the real
2999 // frame below the adaptor frame if adapted. 2996 // frame below the adaptor frame if adapted.
3000 __ Movn(result, fp, temp); // Move only if temp is not equal to zero (ne). 2997 __ Movn(result, fp, temp); // Move only if temp is not equal to zero (ne).
3001 __ Movz(result, scratch, temp); // Move only if temp is equal to zero (eq). 2998 __ Movz(result, scratch, temp); // Move only if temp is equal to zero (eq).
3002 } 2999 }
3003 } 3000 }
3004 3001
3005 3002
(...skipping 2563 matching lines...) Expand 10 before | Expand all | Expand 10 after
5569 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { 5566 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) {
5570 Register context = ToRegister(instr->context()); 5567 Register context = ToRegister(instr->context());
5571 __ sw(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); 5568 __ sw(context, MemOperand(fp, StandardFrameConstants::kContextOffset));
5572 } 5569 }
5573 5570
5574 5571
5575 #undef __ 5572 #undef __
5576 5573
5577 } // namespace internal 5574 } // namespace internal
5578 } // namespace v8 5575 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698