| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 return reinterpret_cast<intptr_t*>( | 508 return reinterpret_cast<intptr_t*>( |
| 509 reinterpret_cast<Address>(this) + frame_content_offset() + offset); | 509 reinterpret_cast<Address>(this) + frame_content_offset() + offset); |
| 510 } | 510 } |
| 511 | 511 |
| 512 int ComputeFixedSize(); | 512 int ComputeFixedSize(); |
| 513 }; | 513 }; |
| 514 | 514 |
| 515 | 515 |
| 516 class TranslationBuffer BASE_EMBEDDED { | 516 class TranslationBuffer BASE_EMBEDDED { |
| 517 public: | 517 public: |
| 518 TranslationBuffer() : contents_(256) { } | 518 explicit TranslationBuffer(Zone* zone) : contents_(256, zone) { } |
| 519 | 519 |
| 520 int CurrentIndex() const { return contents_.length(); } | 520 int CurrentIndex() const { return contents_.length(); } |
| 521 void Add(int32_t value); | 521 void Add(int32_t value, Zone* zone); |
| 522 | 522 |
| 523 Handle<ByteArray> CreateByteArray(); | 523 Handle<ByteArray> CreateByteArray(); |
| 524 | 524 |
| 525 private: | 525 private: |
| 526 ZoneList<uint8_t> contents_; | 526 ZoneList<uint8_t> contents_; |
| 527 }; | 527 }; |
| 528 | 528 |
| 529 | 529 |
| 530 class TranslationIterator BASE_EMBEDDED { | 530 class TranslationIterator BASE_EMBEDDED { |
| 531 public: | 531 public: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 562 INT32_STACK_SLOT, | 562 INT32_STACK_SLOT, |
| 563 DOUBLE_STACK_SLOT, | 563 DOUBLE_STACK_SLOT, |
| 564 LITERAL, | 564 LITERAL, |
| 565 ARGUMENTS_OBJECT, | 565 ARGUMENTS_OBJECT, |
| 566 | 566 |
| 567 // A prefix indicating that the next command is a duplicate of the one | 567 // A prefix indicating that the next command is a duplicate of the one |
| 568 // that follows it. | 568 // that follows it. |
| 569 DUPLICATE | 569 DUPLICATE |
| 570 }; | 570 }; |
| 571 | 571 |
| 572 Translation(TranslationBuffer* buffer, int frame_count, int jsframe_count) | 572 Translation(TranslationBuffer* buffer, int frame_count, int jsframe_count, |
| 573 Zone* zone) |
| 573 : buffer_(buffer), | 574 : buffer_(buffer), |
| 574 index_(buffer->CurrentIndex()) { | 575 index_(buffer->CurrentIndex()), |
| 575 buffer_->Add(BEGIN); | 576 zone_(zone) { |
| 576 buffer_->Add(frame_count); | 577 buffer_->Add(BEGIN, zone); |
| 577 buffer_->Add(jsframe_count); | 578 buffer_->Add(frame_count, zone); |
| 579 buffer_->Add(jsframe_count, zone); |
| 578 } | 580 } |
| 579 | 581 |
| 580 int index() const { return index_; } | 582 int index() const { return index_; } |
| 581 | 583 |
| 582 // Commands. | 584 // Commands. |
| 583 void BeginJSFrame(int node_id, int literal_id, unsigned height); | 585 void BeginJSFrame(int node_id, int literal_id, unsigned height); |
| 584 void BeginArgumentsAdaptorFrame(int literal_id, unsigned height); | 586 void BeginArgumentsAdaptorFrame(int literal_id, unsigned height); |
| 585 void BeginConstructStubFrame(int literal_id, unsigned height); | 587 void BeginConstructStubFrame(int literal_id, unsigned height); |
| 586 void StoreRegister(Register reg); | 588 void StoreRegister(Register reg); |
| 587 void StoreInt32Register(Register reg); | 589 void StoreInt32Register(Register reg); |
| 588 void StoreDoubleRegister(DoubleRegister reg); | 590 void StoreDoubleRegister(DoubleRegister reg); |
| 589 void StoreStackSlot(int index); | 591 void StoreStackSlot(int index); |
| 590 void StoreInt32StackSlot(int index); | 592 void StoreInt32StackSlot(int index); |
| 591 void StoreDoubleStackSlot(int index); | 593 void StoreDoubleStackSlot(int index); |
| 592 void StoreLiteral(int literal_id); | 594 void StoreLiteral(int literal_id); |
| 593 void StoreArgumentsObject(); | 595 void StoreArgumentsObject(); |
| 594 void MarkDuplicate(); | 596 void MarkDuplicate(); |
| 595 | 597 |
| 598 Zone* zone() { return zone_; } |
| 599 |
| 596 static int NumberOfOperandsFor(Opcode opcode); | 600 static int NumberOfOperandsFor(Opcode opcode); |
| 597 | 601 |
| 598 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER) | 602 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER) |
| 599 static const char* StringFor(Opcode opcode); | 603 static const char* StringFor(Opcode opcode); |
| 600 #endif | 604 #endif |
| 601 | 605 |
| 602 private: | 606 private: |
| 603 TranslationBuffer* buffer_; | 607 TranslationBuffer* buffer_; |
| 604 int index_; | 608 int index_; |
| 609 Zone* zone_; |
| 605 }; | 610 }; |
| 606 | 611 |
| 607 | 612 |
| 608 // Linked list holding deoptimizing code objects. The deoptimizing code objects | 613 // Linked list holding deoptimizing code objects. The deoptimizing code objects |
| 609 // are kept as weak handles until they are no longer activated on the stack. | 614 // are kept as weak handles until they are no longer activated on the stack. |
| 610 class DeoptimizingCodeListNode : public Malloced { | 615 class DeoptimizingCodeListNode : public Malloced { |
| 611 public: | 616 public: |
| 612 explicit DeoptimizingCodeListNode(Code* code); | 617 explicit DeoptimizingCodeListNode(Code* code); |
| 613 ~DeoptimizingCodeListNode(); | 618 ~DeoptimizingCodeListNode(); |
| 614 | 619 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 Object** expression_stack_; | 781 Object** expression_stack_; |
| 777 int source_position_; | 782 int source_position_; |
| 778 | 783 |
| 779 friend class Deoptimizer; | 784 friend class Deoptimizer; |
| 780 }; | 785 }; |
| 781 #endif | 786 #endif |
| 782 | 787 |
| 783 } } // namespace v8::internal | 788 } } // namespace v8::internal |
| 784 | 789 |
| 785 #endif // V8_DEOPTIMIZER_H_ | 790 #endif // V8_DEOPTIMIZER_H_ |
| OLD | NEW |