OLD | NEW |
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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 private: | 430 private: |
431 Major MajorKey() { return NumberToString; } | 431 Major MajorKey() { return NumberToString; } |
432 int MinorKey() { return 0; } | 432 int MinorKey() { return 0; } |
433 | 433 |
434 void Generate(MacroAssembler* masm); | 434 void Generate(MacroAssembler* masm); |
435 | 435 |
436 const char* GetName() { return "NumberToStringStub"; } | 436 const char* GetName() { return "NumberToStringStub"; } |
437 }; | 437 }; |
438 | 438 |
439 | 439 |
440 class RecordWriteStub : public CodeStub { | |
441 public: | |
442 RecordWriteStub(Register object, Register offset, Register scratch) | |
443 : object_(object), offset_(offset), scratch_(scratch) { } | |
444 | |
445 void Generate(MacroAssembler* masm); | |
446 | |
447 private: | |
448 Register object_; | |
449 Register offset_; | |
450 Register scratch_; | |
451 | |
452 // Minor key encoding in 12 bits. 4 bits for each of the three | |
453 // registers (object, offset and scratch) OOOOAAAASSSS. | |
454 class ScratchBits: public BitField<uint32_t, 0, 4> {}; | |
455 class OffsetBits: public BitField<uint32_t, 4, 4> {}; | |
456 class ObjectBits: public BitField<uint32_t, 8, 4> {}; | |
457 | |
458 Major MajorKey() { return RecordWrite; } | |
459 | |
460 int MinorKey() { | |
461 // Encode the registers. | |
462 return ObjectBits::encode(object_.code()) | | |
463 OffsetBits::encode(offset_.code()) | | |
464 ScratchBits::encode(scratch_.code()); | |
465 } | |
466 | |
467 #ifdef DEBUG | |
468 void Print() { | |
469 PrintF("RecordWriteStub (object reg %d), (offset reg %d)," | |
470 " (scratch reg %d)\n", | |
471 object_.code(), offset_.code(), scratch_.code()); | |
472 } | |
473 #endif | |
474 }; | |
475 | |
476 | |
477 // Enter C code from generated RegExp code in a way that allows | 440 // Enter C code from generated RegExp code in a way that allows |
478 // the C code to fix the return address in case of a GC. | 441 // the C code to fix the return address in case of a GC. |
479 // Currently only needed on ARM. | 442 // Currently only needed on ARM. |
480 class RegExpCEntryStub: public CodeStub { | 443 class RegExpCEntryStub: public CodeStub { |
481 public: | 444 public: |
482 RegExpCEntryStub() {} | 445 RegExpCEntryStub() {} |
483 virtual ~RegExpCEntryStub() {} | 446 virtual ~RegExpCEntryStub() {} |
484 void Generate(MacroAssembler* masm); | 447 void Generate(MacroAssembler* masm); |
485 | 448 |
486 private: | 449 private: |
487 Major MajorKey() { return RegExpCEntry; } | 450 Major MajorKey() { return RegExpCEntry; } |
488 int MinorKey() { return 0; } | 451 int MinorKey() { return 0; } |
489 const char* GetName() { return "RegExpCEntryStub"; } | 452 const char* GetName() { return "RegExpCEntryStub"; } |
490 }; | 453 }; |
491 | 454 |
492 | 455 |
493 } } // namespace v8::internal | 456 } } // namespace v8::internal |
494 | 457 |
495 #endif // V8_ARM_CODE_STUBS_ARM_H_ | 458 #endif // V8_ARM_CODE_STUBS_ARM_H_ |
OLD | NEW |