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

Side by Side Diff: src/hydrogen-instructions.h

Issue 6707001: Store HValue uses in a custom small list structure. (Closed)
Patch Set: Review fixes Created 9 years, 9 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 11 matching lines...) Expand all
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ 28 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_
29 #define V8_HYDROGEN_INSTRUCTIONS_H_ 29 #define V8_HYDROGEN_INSTRUCTIONS_H_
30 30
31 #include "v8.h" 31 #include "v8.h"
32
32 #include "code-stubs.h" 33 #include "code-stubs.h"
34 #include "small-pointer-list.h"
33 #include "string-stream.h" 35 #include "string-stream.h"
34 #include "zone.h" 36 #include "zone.h"
35 37
36 namespace v8 { 38 namespace v8 {
37 namespace internal { 39 namespace internal {
38 40
39 // Forward declarations. 41 // Forward declarations.
40 class HBasicBlock; 42 class HBasicBlock;
41 class HEnvironment; 43 class HEnvironment;
42 class HInstruction; 44 class HInstruction;
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 enum Opcode { 446 enum Opcode {
445 // Declare a unique enum value for each hydrogen instruction. 447 // Declare a unique enum value for each hydrogen instruction.
446 #define DECLARE_DO(type) k##type, 448 #define DECLARE_DO(type) k##type,
447 HYDROGEN_ALL_INSTRUCTION_LIST(DECLARE_DO) 449 HYDROGEN_ALL_INSTRUCTION_LIST(DECLARE_DO)
448 #undef DECLARE_DO 450 #undef DECLARE_DO
449 kMaxInstructionClass 451 kMaxInstructionClass
450 }; 452 };
451 453
452 HValue() : block_(NULL), 454 HValue() : block_(NULL),
453 id_(kNoNumber), 455 id_(kNoNumber),
454 uses_(2),
455 type_(HType::Tagged()), 456 type_(HType::Tagged()),
456 range_(NULL), 457 range_(NULL),
457 flags_(0) {} 458 flags_(0) {}
458 virtual ~HValue() {} 459 virtual ~HValue() {}
459 460
460 HBasicBlock* block() const { return block_; } 461 HBasicBlock* block() const { return block_; }
461 void SetBlock(HBasicBlock* block); 462 void SetBlock(HBasicBlock* block);
462 463
463 int id() const { return id_; } 464 int id() const { return id_; }
464 void set_id(int id) { id_ = id; } 465 void set_id(int id) { id_ = id; }
465 466
466 ZoneList<HValue*>* uses() { return &uses_; } 467 SmallPointerList<HValue>* uses() { return &uses_; }
467 468
468 virtual bool EmitAtUses() { return false; } 469 virtual bool EmitAtUses() { return false; }
469 Representation representation() const { return representation_; } 470 Representation representation() const { return representation_; }
470 void ChangeRepresentation(Representation r) { 471 void ChangeRepresentation(Representation r) {
471 // Representation was already set and is allowed to be changed. 472 // Representation was already set and is allowed to be changed.
472 ASSERT(!representation_.IsNone()); 473 ASSERT(!representation_.IsNone());
473 ASSERT(!r.IsNone()); 474 ASSERT(!r.IsNone());
474 ASSERT(CheckFlag(kFlexibleRepresentation)); 475 ASSERT(CheckFlag(kFlexibleRepresentation));
475 RepresentationChanged(r); 476 RepresentationChanged(r);
476 representation_ = r; 477 representation_ = r;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 void InternalReplaceAtUse(HValue* use, HValue* other); 601 void InternalReplaceAtUse(HValue* use, HValue* other);
601 void RegisterUse(int index, HValue* new_value); 602 void RegisterUse(int index, HValue* new_value);
602 603
603 HBasicBlock* block_; 604 HBasicBlock* block_;
604 605
605 // The id of this instruction in the hydrogen graph, assigned when first 606 // The id of this instruction in the hydrogen graph, assigned when first
606 // added to the graph. Reflects creation order. 607 // added to the graph. Reflects creation order.
607 int id_; 608 int id_;
608 609
609 Representation representation_; 610 Representation representation_;
610 ZoneList<HValue*> uses_; 611 SmallPointerList<HValue> uses_;
611 HType type_; 612 HType type_;
612 Range* range_; 613 Range* range_;
613 int flags_; 614 int flags_;
614 615
615 DISALLOW_COPY_AND_ASSIGN(HValue); 616 DISALLOW_COPY_AND_ASSIGN(HValue);
616 }; 617 };
617 618
618 619
619 class HInstruction: public HValue { 620 class HInstruction: public HValue {
620 public: 621 public:
(...skipping 2900 matching lines...) Expand 10 before | Expand all | Expand 10 after
3521 HValue* object() { return left(); } 3522 HValue* object() { return left(); }
3522 HValue* key() { return right(); } 3523 HValue* key() { return right(); }
3523 }; 3524 };
3524 3525
3525 #undef DECLARE_INSTRUCTION 3526 #undef DECLARE_INSTRUCTION
3526 #undef DECLARE_CONCRETE_INSTRUCTION 3527 #undef DECLARE_CONCRETE_INSTRUCTION
3527 3528
3528 } } // namespace v8::internal 3529 } } // namespace v8::internal
3529 3530
3530 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 3531 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/small-pointer-list.h » ('j') | src/small-pointer-list.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698