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/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 __ mov(scratch, FieldOperand(eax, HeapObject::kMapOffset)); | 318 __ mov(scratch, FieldOperand(eax, HeapObject::kMapOffset)); |
319 __ cmp(scratch, factory->heap_number_map()); | 319 __ cmp(scratch, factory->heap_number_map()); |
320 __ j(not_equal, non_float); // argument in eax is not a number -> NaN | 320 __ j(not_equal, non_float); // argument in eax is not a number -> NaN |
321 | 321 |
322 // Fall-through: Both operands are numbers. | 322 // Fall-through: Both operands are numbers. |
323 __ bind(&done); | 323 __ bind(&done); |
324 } | 324 } |
325 | 325 |
326 | 326 |
327 void MathPowStub::Generate(MacroAssembler* masm) { | 327 void MathPowStub::Generate(MacroAssembler* masm) { |
328 // No SSE2 support | 328 const Register base = edx; |
329 UNREACHABLE(); | 329 const Register scratch = ecx; |
| 330 Counters* counters = isolate()->counters(); |
| 331 Label call_runtime; |
| 332 |
| 333 // We will call runtime helper function directly. |
| 334 if (exponent_type() == ON_STACK) { |
| 335 // The arguments are still on the stack. |
| 336 __ bind(&call_runtime); |
| 337 __ TailCallRuntime(Runtime::kMathPowRT, 2, 1); |
| 338 |
| 339 // The stub is called from non-optimized code, which expects the result |
| 340 // as heap number in exponent. |
| 341 __ AllocateHeapNumber(eax, scratch, base, &call_runtime); |
| 342 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); |
| 343 __ IncrementCounter(counters->math_pow(), 1); |
| 344 __ ret(2 * kPointerSize); |
| 345 } else { |
| 346 // Currently it's only called from full-compiler and exponent type is |
| 347 // ON_STACK. |
| 348 UNIMPLEMENTED(); |
| 349 } |
330 } | 350 } |
331 | 351 |
332 | 352 |
333 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { | 353 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { |
334 Label miss; | 354 Label miss; |
335 Register receiver = LoadDescriptor::ReceiverRegister(); | 355 Register receiver = LoadDescriptor::ReceiverRegister(); |
336 // With careful management, we won't have to save slot and vector on | 356 // With careful management, we won't have to save slot and vector on |
337 // the stack. Simply handle the possibly missing case first. | 357 // the stack. Simply handle the possibly missing case first. |
338 // TODO(mvstanton): this code can be more efficient. | 358 // TODO(mvstanton): this code can be more efficient. |
339 __ cmp(FieldOperand(receiver, JSFunction::kPrototypeOrInitialMapOffset), | 359 __ cmp(FieldOperand(receiver, JSFunction::kPrototypeOrInitialMapOffset), |
(...skipping 4984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5324 Operand(ebp, 7 * kPointerSize), NULL); | 5344 Operand(ebp, 7 * kPointerSize), NULL); |
5325 } | 5345 } |
5326 | 5346 |
5327 | 5347 |
5328 #undef __ | 5348 #undef __ |
5329 | 5349 |
5330 } // namespace internal | 5350 } // namespace internal |
5331 } // namespace v8 | 5351 } // namespace v8 |
5332 | 5352 |
5333 #endif // V8_TARGET_ARCH_X87 | 5353 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |