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

Side by Side Diff: src/x87/code-stubs-x87.cc

Issue 1258873002: X87: implement MathPow stub for X87. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698