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

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

Issue 2122953002: [crankshaft] do not restore rsi in stub for deferred number conversions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixing wrong registers Created 4 years, 5 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 4404 matching lines...) Expand 10 before | Expand all | Expand 10 after
4415 // Slow case: Call the runtime system to do the number allocation. 4415 // Slow case: Call the runtime system to do the number allocation.
4416 __ bind(&slow); 4416 __ bind(&slow);
4417 { 4417 {
4418 // TODO(3095996): Put a valid pointer value in the stack slot where the 4418 // TODO(3095996): Put a valid pointer value in the stack slot where the
4419 // result register is stored, as this register is in the pointer map, but 4419 // result register is stored, as this register is in the pointer map, but
4420 // contains an integer value. 4420 // contains an integer value.
4421 __ mov(dst, zero_reg); 4421 __ mov(dst, zero_reg);
4422 4422
4423 // Preserve the value of all registers. 4423 // Preserve the value of all registers.
4424 PushSafepointRegistersScope scope(this); 4424 PushSafepointRegistersScope scope(this);
4425 4425 // Reset the context register.
4426 // NumberTagI and NumberTagD use the context from the frame, rather than 4426 if (!dst.is(cp)) {
4427 // the environment's HContext or HInlinedContext value. 4427 __ mov(cp, zero_reg);
4428 // They only call Runtime::kAllocateHeapNumber. 4428 }
4429 // The corresponding HChange instructions are added in a phase that does
4430 // not have easy access to the local context.
4431 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
4432 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); 4429 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
4433 RecordSafepointWithRegisters( 4430 RecordSafepointWithRegisters(
4434 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); 4431 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
4435 __ StoreToSafepointRegisterSlot(v0, dst); 4432 __ StoreToSafepointRegisterSlot(v0, dst);
4436 } 4433 }
4437 4434
4438 // Done. Put the value in dbl_scratch into the value of the allocated heap 4435 // Done. Put the value in dbl_scratch into the value of the allocated heap
4439 // number. 4436 // number.
4440 __ bind(&done); 4437 __ bind(&done);
4441 __ sdc1(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset)); 4438 __ sdc1(dbl_scratch, FieldMemOperand(dst, HeapNumber::kValueOffset));
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
4474 4471
4475 4472
4476 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { 4473 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) {
4477 // TODO(3095996): Get rid of this. For now, we need to make the 4474 // TODO(3095996): Get rid of this. For now, we need to make the
4478 // result register contain a valid pointer because it is already 4475 // result register contain a valid pointer because it is already
4479 // contained in the register pointer map. 4476 // contained in the register pointer map.
4480 Register reg = ToRegister(instr->result()); 4477 Register reg = ToRegister(instr->result());
4481 __ mov(reg, zero_reg); 4478 __ mov(reg, zero_reg);
4482 4479
4483 PushSafepointRegistersScope scope(this); 4480 PushSafepointRegistersScope scope(this);
4484 // NumberTagI and NumberTagD use the context from the frame, rather than 4481 // Reset the context register.
4485 // the environment's HContext or HInlinedContext value. 4482 if (!dst.is(cp)) {
4486 // They only call Runtime::kAllocateHeapNumber. 4483 __ mov(cp, zero_reg);
4487 // The corresponding HChange instructions are added in a phase that does 4484 }
4488 // not have easy access to the local context.
4489 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
4490 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); 4485 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
4491 RecordSafepointWithRegisters( 4486 RecordSafepointWithRegisters(
4492 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); 4487 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
4493 __ StoreToSafepointRegisterSlot(v0, reg); 4488 __ StoreToSafepointRegisterSlot(v0, reg);
4494 } 4489 }
4495 4490
4496 4491
4497 void LCodeGen::DoSmiTag(LSmiTag* instr) { 4492 void LCodeGen::DoSmiTag(LSmiTag* instr) {
4498 HChange* hchange = instr->hydrogen(); 4493 HChange* hchange = instr->hydrogen();
4499 Register input = ToRegister(instr->value()); 4494 Register input = ToRegister(instr->value());
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
5530 __ lw(result, FieldMemOperand(scratch, 5525 __ lw(result, FieldMemOperand(scratch,
5531 FixedArray::kHeaderSize - kPointerSize)); 5526 FixedArray::kHeaderSize - kPointerSize));
5532 __ bind(deferred->exit()); 5527 __ bind(deferred->exit());
5533 __ bind(&done); 5528 __ bind(&done);
5534 } 5529 }
5535 5530
5536 #undef __ 5531 #undef __
5537 5532
5538 } // namespace internal 5533 } // namespace internal
5539 } // namespace v8 5534 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698