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

Side by Side Diff: src/crankshaft/ia32/lithium-codegen-ia32.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 register overlap on arm64 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. 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 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h"
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 4247 matching lines...) Expand 10 before | Expand all | Expand 10 after
4258 // Slow case: Call the runtime system to do the number allocation. 4258 // Slow case: Call the runtime system to do the number allocation.
4259 __ bind(&slow); 4259 __ bind(&slow);
4260 { 4260 {
4261 // TODO(3095996): Put a valid pointer value in the stack slot where the 4261 // TODO(3095996): Put a valid pointer value in the stack slot where the
4262 // result register is stored, as this register is in the pointer map, but 4262 // result register is stored, as this register is in the pointer map, but
4263 // contains an integer value. 4263 // contains an integer value.
4264 __ Move(reg, Immediate(0)); 4264 __ Move(reg, Immediate(0));
4265 4265
4266 // Preserve the value of all registers. 4266 // Preserve the value of all registers.
4267 PushSafepointRegistersScope scope(this); 4267 PushSafepointRegistersScope scope(this);
4268 4268 // Reset the context register.
4269 // NumberTagI and NumberTagD use the context from the frame, rather than 4269 if (!reg.is(esi)) {
4270 // the environment's HContext or HInlinedContext value. 4270 __ Move(esi, Immediate(0));
4271 // They only call Runtime::kAllocateHeapNumber. 4271 }
4272 // The corresponding HChange instructions are added in a phase that does
4273 // not have easy access to the local context.
4274 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
4275 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); 4272 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
4276 RecordSafepointWithRegisters( 4273 RecordSafepointWithRegisters(
4277 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); 4274 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
4278 __ StoreToSafepointRegisterSlot(reg, eax); 4275 __ StoreToSafepointRegisterSlot(reg, eax);
4279 } 4276 }
4280 4277
4281 // Done. Put the value in xmm_scratch into the value of the allocated heap 4278 // Done. Put the value in xmm_scratch into the value of the allocated heap
4282 // number. 4279 // number.
4283 __ bind(&done); 4280 __ bind(&done);
4284 __ movsd(FieldOperand(reg, HeapNumber::kValueOffset), xmm_scratch); 4281 __ movsd(FieldOperand(reg, HeapNumber::kValueOffset), xmm_scratch);
(...skipping 29 matching lines...) Expand all
4314 4311
4315 4312
4316 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { 4313 void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) {
4317 // TODO(3095996): Get rid of this. For now, we need to make the 4314 // TODO(3095996): Get rid of this. For now, we need to make the
4318 // result register contain a valid pointer because it is already 4315 // result register contain a valid pointer because it is already
4319 // contained in the register pointer map. 4316 // contained in the register pointer map.
4320 Register reg = ToRegister(instr->result()); 4317 Register reg = ToRegister(instr->result());
4321 __ Move(reg, Immediate(0)); 4318 __ Move(reg, Immediate(0));
4322 4319
4323 PushSafepointRegistersScope scope(this); 4320 PushSafepointRegistersScope scope(this);
4324 // NumberTagI and NumberTagD use the context from the frame, rather than 4321 // Reset the context register.
4325 // the environment's HContext or HInlinedContext value. 4322 if (!reg.is(esi)) {
4326 // They only call Runtime::kAllocateHeapNumber. 4323 __ Move(esi, Immediate(0));
4327 // The corresponding HChange instructions are added in a phase that does 4324 }
4328 // not have easy access to the local context.
4329 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
4330 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); 4325 __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
4331 RecordSafepointWithRegisters( 4326 RecordSafepointWithRegisters(
4332 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); 4327 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
4333 __ StoreToSafepointRegisterSlot(reg, eax); 4328 __ StoreToSafepointRegisterSlot(reg, eax);
4334 } 4329 }
4335 4330
4336 4331
4337 void LCodeGen::DoSmiTag(LSmiTag* instr) { 4332 void LCodeGen::DoSmiTag(LSmiTag* instr) {
4338 HChange* hchange = instr->hydrogen(); 4333 HChange* hchange = instr->hydrogen();
4339 Register input = ToRegister(instr->value()); 4334 Register input = ToRegister(instr->value());
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
5290 __ bind(deferred->exit()); 5285 __ bind(deferred->exit());
5291 __ bind(&done); 5286 __ bind(&done);
5292 } 5287 }
5293 5288
5294 #undef __ 5289 #undef __
5295 5290
5296 } // namespace internal 5291 } // namespace internal
5297 } // namespace v8 5292 } // namespace v8
5298 5293
5299 #endif // V8_TARGET_ARCH_IA32 5294 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/crankshaft/arm64/lithium-codegen-arm64.cc ('k') | src/crankshaft/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698