OLD | NEW |
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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 4047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4058 X87LoadForUsage(input); | 4058 X87LoadForUsage(input); |
4059 __ fstp_d(FieldOperand(temp_result, HeapNumber::kValueOffset)); | 4059 __ fstp_d(FieldOperand(temp_result, HeapNumber::kValueOffset)); |
4060 | 4060 |
4061 { | 4061 { |
4062 // Preserve the value of all registers. | 4062 // Preserve the value of all registers. |
4063 PushSafepointRegistersScope scope(this); | 4063 PushSafepointRegistersScope scope(this); |
4064 | 4064 |
4065 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 4065 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
4066 __ push(temp_result); | 4066 __ push(temp_result); |
4067 __ CallRuntimeSaveDoubles(Runtime::kMathSqrtRT); | 4067 __ CallRuntimeSaveDoubles(Runtime::kMathSqrtRT); |
4068 RecordSafepointWithRegisters( | 4068 RecordSafepointWithRegisters(instr->pointer_map(), 1, |
4069 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); | 4069 Safepoint::kNoLazyDeopt); |
4070 __ StoreToSafepointRegisterSlot(temp_result, eax); | 4070 __ StoreToSafepointRegisterSlot(temp_result, eax); |
4071 } | 4071 } |
4072 X87PrepareToWrite(result_reg); | 4072 X87PrepareToWrite(result_reg); |
4073 // return value of MathExpRT is Smi or Heap Number. | 4073 // return value of MathExpRT is Smi or Heap Number. |
4074 __ JumpIfSmi(temp_result, &smi); | 4074 __ JumpIfSmi(temp_result, &smi); |
4075 // Heap number(double) | 4075 // Heap number(double) |
4076 __ fld_d(FieldOperand(temp_result, HeapNumber::kValueOffset)); | 4076 __ fld_d(FieldOperand(temp_result, HeapNumber::kValueOffset)); |
4077 __ jmp(&finish); | 4077 __ jmp(&finish); |
4078 // SMI | 4078 // SMI |
4079 __ bind(&smi); | 4079 __ bind(&smi); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4273 X87LoadForUsage(input); | 4273 X87LoadForUsage(input); |
4274 __ fstp_d(FieldOperand(temp_result, HeapNumber::kValueOffset)); | 4274 __ fstp_d(FieldOperand(temp_result, HeapNumber::kValueOffset)); |
4275 | 4275 |
4276 { | 4276 { |
4277 // Preserve the value of all registers. | 4277 // Preserve the value of all registers. |
4278 PushSafepointRegistersScope scope(this); | 4278 PushSafepointRegistersScope scope(this); |
4279 | 4279 |
4280 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 4280 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
4281 __ push(temp_result); | 4281 __ push(temp_result); |
4282 __ CallRuntimeSaveDoubles(Runtime::kMathExpRT); | 4282 __ CallRuntimeSaveDoubles(Runtime::kMathExpRT); |
4283 RecordSafepointWithRegisters(instr->pointer_map(), 0, | 4283 RecordSafepointWithRegisters(instr->pointer_map(), 1, |
4284 Safepoint::kNoLazyDeopt); | 4284 Safepoint::kNoLazyDeopt); |
4285 __ StoreToSafepointRegisterSlot(temp_result, eax); | 4285 __ StoreToSafepointRegisterSlot(temp_result, eax); |
4286 } | 4286 } |
4287 X87PrepareToWrite(result_reg); | 4287 X87PrepareToWrite(result_reg); |
4288 // return value of MathExpRT is Smi or Heap Number. | 4288 // return value of MathExpRT is Smi or Heap Number. |
4289 __ JumpIfSmi(temp_result, &smi); | 4289 __ JumpIfSmi(temp_result, &smi); |
4290 // Heap number(double) | 4290 // Heap number(double) |
4291 __ fld_d(FieldOperand(temp_result, HeapNumber::kValueOffset)); | 4291 __ fld_d(FieldOperand(temp_result, HeapNumber::kValueOffset)); |
4292 __ jmp(&finish); | 4292 __ jmp(&finish); |
4293 // SMI | 4293 // SMI |
(...skipping 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6299 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6299 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6300 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6300 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6301 } | 6301 } |
6302 | 6302 |
6303 | 6303 |
6304 #undef __ | 6304 #undef __ |
6305 | 6305 |
6306 } } // namespace v8::internal | 6306 } } // namespace v8::internal |
6307 | 6307 |
6308 #endif // V8_TARGET_ARCH_X87 | 6308 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |