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

Side by Side Diff: src/arm/code-stubs-arm.h

Issue 6903060: Version 3.3.2.... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 private: 361 private:
362 Major MajorKey() { return DirectCEntry; } 362 Major MajorKey() { return DirectCEntry; }
363 int MinorKey() { return 0; } 363 int MinorKey() { return 0; }
364 364
365 bool NeedsImmovableCode() { return true; } 365 bool NeedsImmovableCode() { return true; }
366 366
367 const char* GetName() { return "DirectCEntryStub"; } 367 const char* GetName() { return "DirectCEntryStub"; }
368 }; 368 };
369 369
370 370
371 class FloatingPointHelper : public AllStatic {
372 public:
373
374 enum Destination {
375 kVFPRegisters,
376 kCoreRegisters
377 };
378
379
380 // Loads smis from r0 and r1 (right and left in binary operations) into
381 // floating point registers. Depending on the destination the values ends up
382 // either d7 and d6 or in r2/r3 and r0/r1 respectively. If the destination is
383 // floating point registers VFP3 must be supported. If core registers are
384 // requested when VFP3 is supported d6 and d7 will be scratched.
385 static void LoadSmis(MacroAssembler* masm,
386 Destination destination,
387 Register scratch1,
388 Register scratch2);
389
390 // Loads objects from r0 and r1 (right and left in binary operations) into
391 // floating point registers. Depending on the destination the values ends up
392 // either d7 and d6 or in r2/r3 and r0/r1 respectively. If the destination is
393 // floating point registers VFP3 must be supported. If core registers are
394 // requested when VFP3 is supported d6 and d7 will still be scratched. If
395 // either r0 or r1 is not a number (not smi and not heap number object) the
396 // not_number label is jumped to with r0 and r1 intact.
397 static void LoadOperands(MacroAssembler* masm,
398 FloatingPointHelper::Destination destination,
399 Register heap_number_map,
400 Register scratch1,
401 Register scratch2,
402 Label* not_number);
403
404 // Convert the smi or heap number in object to an int32 using the rules
405 // for ToInt32 as described in ECMAScript 9.5.: the value is truncated
406 // and brought into the range -2^31 .. +2^31 - 1.
407 static void ConvertNumberToInt32(MacroAssembler* masm,
408 Register object,
409 Register dst,
410 Register heap_number_map,
411 Register scratch1,
412 Register scratch2,
413 Register scratch3,
414 DwVfpRegister double_scratch,
415 Label* not_int32);
416
417 // Converts the integer (untagged smi) in |int_scratch| to a double, storing
418 // the result either in |double_dst| or |dst2:dst1|, depending on
419 // |destination|.
420 // Warning: The value in |int_scratch| will be changed in the process!
421 static void ConvertIntToDouble(MacroAssembler* masm,
422 Register int_scratch,
423 Destination destination,
424 DwVfpRegister double_dst,
425 Register dst1,
426 Register dst2,
427 Register scratch2,
428 SwVfpRegister single_scratch);
429
430 // Load the number from object into double_dst in the double format.
431 // Control will jump to not_int32 if the value cannot be exactly represented
432 // by a 32-bit integer.
433 // Floating point value in the 32-bit integer range that are not exact integer
434 // won't be loaded.
435 static void LoadNumberAsInt32Double(MacroAssembler* masm,
436 Register object,
437 Destination destination,
438 DwVfpRegister double_dst,
439 Register dst1,
440 Register dst2,
441 Register heap_number_map,
442 Register scratch1,
443 Register scratch2,
444 SwVfpRegister single_scratch,
445 Label* not_int32);
446
447 // Loads the number from object into dst as a 32-bit integer.
448 // Control will jump to not_int32 if the object cannot be exactly represented
449 // by a 32-bit integer.
450 // Floating point value in the 32-bit integer range that are not exact integer
451 // won't be converted.
452 // scratch3 is not used when VFP3 is supported.
453 static void LoadNumberAsInt32(MacroAssembler* masm,
454 Register object,
455 Register dst,
456 Register heap_number_map,
457 Register scratch1,
458 Register scratch2,
459 Register scratch3,
460 DwVfpRegister double_scratch,
461 Label* not_int32);
462
463 // Generate non VFP3 code to check if a double can be exactly represented by a
464 // 32-bit integer. This does not check for 0 or -0, which need
465 // to be checked for separately.
466 // Control jumps to not_int32 if the value is not a 32-bit integer, and falls
467 // through otherwise.
468 // src1 and src2 will be cloberred.
469 //
470 // Expected input:
471 // - src1: higher (exponent) part of the double value.
472 // - src2: lower (mantissa) part of the double value.
473 // Output status:
474 // - dst: 32 higher bits of the mantissa. (mantissa[51:20])
475 // - src2: contains 1.
476 // - other registers are clobbered.
477 static void DoubleIs32BitInteger(MacroAssembler* masm,
478 Register src1,
479 Register src2,
480 Register dst,
481 Register scratch,
482 Label* not_int32);
483
484 // Generates code to call a C function to do a double operation using core
485 // registers. (Used when VFP3 is not supported.)
486 // This code never falls through, but returns with a heap number containing
487 // the result in r0.
488 // Register heapnumber_result must be a heap number in which the
489 // result of the operation will be stored.
490 // Requires the following layout on entry:
491 // r0: Left value (least significant part of mantissa).
492 // r1: Left value (sign, exponent, top of mantissa).
493 // r2: Right value (least significant part of mantissa).
494 // r3: Right value (sign, exponent, top of mantissa).
495 static void CallCCodeForDoubleOperation(MacroAssembler* masm,
496 Token::Value op,
497 Register heap_number_result,
498 Register scratch);
499
500 private:
501 static void LoadNumber(MacroAssembler* masm,
502 FloatingPointHelper::Destination destination,
503 Register object,
504 DwVfpRegister dst,
505 Register dst1,
506 Register dst2,
507 Register heap_number_map,
508 Register scratch1,
509 Register scratch2,
510 Label* not_number);
511 };
512
513
371 } } // namespace v8::internal 514 } } // namespace v8::internal
372 515
373 #endif // V8_ARM_CODE_STUBS_ARM_H_ 516 #endif // V8_ARM_CODE_STUBS_ARM_H_
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698