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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 const Register base = edx; | 328 const Register base = edx; |
329 const Register scratch = ecx; | 329 const Register scratch = ecx; |
330 Counters* counters = isolate()->counters(); | |
331 Label call_runtime; | 330 Label call_runtime; |
332 | 331 |
333 // We will call runtime helper function directly. | 332 // We will call runtime helper function directly. |
334 if (exponent_type() == ON_STACK) { | 333 if (exponent_type() == ON_STACK) { |
335 // The arguments are still on the stack. | 334 // The arguments are still on the stack. |
336 __ bind(&call_runtime); | 335 __ bind(&call_runtime); |
337 __ TailCallRuntime(Runtime::kMathPowRT); | 336 __ TailCallRuntime(Runtime::kMathPowRT); |
338 | 337 |
339 // The stub is called from non-optimized code, which expects the result | 338 // The stub is called from non-optimized code, which expects the result |
340 // as heap number in exponent. | 339 // as heap number in exponent. |
341 __ AllocateHeapNumber(eax, scratch, base, &call_runtime); | 340 __ AllocateHeapNumber(eax, scratch, base, &call_runtime); |
342 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); | 341 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); |
343 __ IncrementCounter(counters->math_pow(), 1); | |
344 __ ret(2 * kPointerSize); | 342 __ ret(2 * kPointerSize); |
345 } else { | 343 } else { |
346 // Currently it's only called from full-compiler and exponent type is | 344 // Currently it's only called from full-compiler and exponent type is |
347 // ON_STACK. | 345 // ON_STACK. |
348 UNIMPLEMENTED(); | 346 UNIMPLEMENTED(); |
349 } | 347 } |
350 } | 348 } |
351 | 349 |
352 | 350 |
353 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { | 351 void FunctionPrototypeStub::Generate(MacroAssembler* masm) { |
(...skipping 5073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5427 return_value_operand, NULL); | 5425 return_value_operand, NULL); |
5428 } | 5426 } |
5429 | 5427 |
5430 | 5428 |
5431 #undef __ | 5429 #undef __ |
5432 | 5430 |
5433 } // namespace internal | 5431 } // namespace internal |
5434 } // namespace v8 | 5432 } // namespace v8 |
5435 | 5433 |
5436 #endif // V8_TARGET_ARCH_X87 | 5434 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |