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

Side by Side Diff: src/deoptimizer.h

Issue 10443114: Progress towards making Zones independent of Isolates and Threads. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review. Created 8 years, 6 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
OLDNEW
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
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
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
danno 2012/06/04 10:46:46 nit: no space here, stay consistent with surroundi
sanjoy 2012/06/04 11:05:42 Removed space.
610 Zone* zone_;
605 }; 611 };
606 612
607 613
608 // Linked list holding deoptimizing code objects. The deoptimizing code objects 614 // 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. 615 // are kept as weak handles until they are no longer activated on the stack.
610 class DeoptimizingCodeListNode : public Malloced { 616 class DeoptimizingCodeListNode : public Malloced {
611 public: 617 public:
612 explicit DeoptimizingCodeListNode(Code* code); 618 explicit DeoptimizingCodeListNode(Code* code);
613 ~DeoptimizingCodeListNode(); 619 ~DeoptimizingCodeListNode();
614 620
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 Object** expression_stack_; 782 Object** expression_stack_;
777 int source_position_; 783 int source_position_;
778 784
779 friend class Deoptimizer; 785 friend class Deoptimizer;
780 }; 786 };
781 #endif 787 #endif
782 788
783 } } // namespace v8::internal 789 } } // namespace v8::internal
784 790
785 #endif // V8_DEOPTIMIZER_H_ 791 #endif // V8_DEOPTIMIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698