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