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

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

Issue 650073002: vector-based ICs did not update type feedback counts correctly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 2 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/heap/objects-visiting-inl.h ('k') | src/ia32/code-stubs-ia32.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ 6 #define V8_HYDROGEN_INSTRUCTIONS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/v8.h" 10 #include "src/v8.h"
(...skipping 5457 matching lines...) Expand 10 before | Expand all | Expand 10 after
5468 5468
5469 class HLoadGlobalGeneric FINAL : public HTemplateInstruction<2> { 5469 class HLoadGlobalGeneric FINAL : public HTemplateInstruction<2> {
5470 public: 5470 public:
5471 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadGlobalGeneric, HValue*, 5471 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadGlobalGeneric, HValue*,
5472 Handle<String>, bool); 5472 Handle<String>, bool);
5473 5473
5474 HValue* context() { return OperandAt(0); } 5474 HValue* context() { return OperandAt(0); }
5475 HValue* global_object() { return OperandAt(1); } 5475 HValue* global_object() { return OperandAt(1); }
5476 Handle<String> name() const { return name_; } 5476 Handle<String> name() const { return name_; }
5477 bool for_typeof() const { return for_typeof_; } 5477 bool for_typeof() const { return for_typeof_; }
5478 FeedbackVectorSlot slot() const { 5478 FeedbackVectorICSlot slot() const {
5479 DCHECK(FLAG_vector_ics && !slot_.IsInvalid()); 5479 DCHECK(FLAG_vector_ics && !slot_.IsInvalid());
5480 return slot_; 5480 return slot_;
5481 } 5481 }
5482 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } 5482 Handle<TypeFeedbackVector> feedback_vector() const {
5483 void SetVectorAndSlot(Handle<FixedArray> vector, FeedbackVectorSlot slot) { 5483 return feedback_vector_;
5484 }
5485 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector,
5486 FeedbackVectorICSlot slot) {
5484 DCHECK(FLAG_vector_ics); 5487 DCHECK(FLAG_vector_ics);
5485 feedback_vector_ = vector; 5488 feedback_vector_ = vector;
5486 slot_ = slot; 5489 slot_ = slot;
5487 } 5490 }
5488 5491
5489 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT 5492 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
5490 5493
5491 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { 5494 virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
5492 return Representation::Tagged(); 5495 return Representation::Tagged();
5493 } 5496 }
5494 5497
5495 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric) 5498 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric)
5496 5499
5497 private: 5500 private:
5498 HLoadGlobalGeneric(HValue* context, HValue* global_object, 5501 HLoadGlobalGeneric(HValue* context, HValue* global_object,
5499 Handle<String> name, bool for_typeof) 5502 Handle<String> name, bool for_typeof)
5500 : name_(name), 5503 : name_(name),
5501 for_typeof_(for_typeof), 5504 for_typeof_(for_typeof),
5502 slot_(FeedbackVectorSlot::Invalid()) { 5505 slot_(FeedbackVectorICSlot::Invalid()) {
5503 SetOperandAt(0, context); 5506 SetOperandAt(0, context);
5504 SetOperandAt(1, global_object); 5507 SetOperandAt(1, global_object);
5505 set_representation(Representation::Tagged()); 5508 set_representation(Representation::Tagged());
5506 SetAllSideEffects(); 5509 SetAllSideEffects();
5507 } 5510 }
5508 5511
5509 Handle<String> name_; 5512 Handle<String> name_;
5510 bool for_typeof_; 5513 bool for_typeof_;
5511 Handle<FixedArray> feedback_vector_; 5514 Handle<TypeFeedbackVector> feedback_vector_;
5512 FeedbackVectorSlot slot_; 5515 FeedbackVectorICSlot slot_;
5513 }; 5516 };
5514 5517
5515 5518
5516 class HAllocate FINAL : public HTemplateInstruction<2> { 5519 class HAllocate FINAL : public HTemplateInstruction<2> {
5517 public: 5520 public:
5518 static bool CompatibleInstanceTypes(InstanceType type1, 5521 static bool CompatibleInstanceTypes(InstanceType type1,
5519 InstanceType type2) { 5522 InstanceType type2) {
5520 return ComputeFlags(TENURED, type1) == ComputeFlags(TENURED, type2) && 5523 return ComputeFlags(TENURED, type1) == ComputeFlags(TENURED, type2) &&
5521 ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2); 5524 ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2);
5522 } 5525 }
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
6473 6476
6474 class HLoadNamedGeneric FINAL : public HTemplateInstruction<2> { 6477 class HLoadNamedGeneric FINAL : public HTemplateInstruction<2> {
6475 public: 6478 public:
6476 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadNamedGeneric, HValue*, 6479 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadNamedGeneric, HValue*,
6477 Handle<Object>); 6480 Handle<Object>);
6478 6481
6479 HValue* context() const { return OperandAt(0); } 6482 HValue* context() const { return OperandAt(0); }
6480 HValue* object() const { return OperandAt(1); } 6483 HValue* object() const { return OperandAt(1); }
6481 Handle<Object> name() const { return name_; } 6484 Handle<Object> name() const { return name_; }
6482 6485
6483 FeedbackVectorSlot slot() const { 6486 FeedbackVectorICSlot slot() const {
6484 DCHECK(FLAG_vector_ics && !slot_.IsInvalid()); 6487 DCHECK(FLAG_vector_ics && !slot_.IsInvalid());
6485 return slot_; 6488 return slot_;
6486 } 6489 }
6487 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } 6490 Handle<TypeFeedbackVector> feedback_vector() const {
6488 void SetVectorAndSlot(Handle<FixedArray> vector, FeedbackVectorSlot slot) { 6491 return feedback_vector_;
6492 }
6493 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector,
6494 FeedbackVectorICSlot slot) {
6489 DCHECK(FLAG_vector_ics); 6495 DCHECK(FLAG_vector_ics);
6490 feedback_vector_ = vector; 6496 feedback_vector_ = vector;
6491 slot_ = slot; 6497 slot_ = slot;
6492 } 6498 }
6493 6499
6494 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { 6500 virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
6495 return Representation::Tagged(); 6501 return Representation::Tagged();
6496 } 6502 }
6497 6503
6498 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT 6504 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
6499 6505
6500 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) 6506 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric)
6501 6507
6502 private: 6508 private:
6503 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name) 6509 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name)
6504 : name_(name), slot_(FeedbackVectorSlot::Invalid()) { 6510 : name_(name), slot_(FeedbackVectorICSlot::Invalid()) {
6505 SetOperandAt(0, context); 6511 SetOperandAt(0, context);
6506 SetOperandAt(1, object); 6512 SetOperandAt(1, object);
6507 set_representation(Representation::Tagged()); 6513 set_representation(Representation::Tagged());
6508 SetAllSideEffects(); 6514 SetAllSideEffects();
6509 } 6515 }
6510 6516
6511 Handle<Object> name_; 6517 Handle<Object> name_;
6512 Handle<FixedArray> feedback_vector_; 6518 Handle<TypeFeedbackVector> feedback_vector_;
6513 FeedbackVectorSlot slot_; 6519 FeedbackVectorICSlot slot_;
6514 }; 6520 };
6515 6521
6516 6522
6517 class HLoadFunctionPrototype FINAL : public HUnaryOperation { 6523 class HLoadFunctionPrototype FINAL : public HUnaryOperation {
6518 public: 6524 public:
6519 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*); 6525 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*);
6520 6526
6521 HValue* function() { return OperandAt(0); } 6527 HValue* function() { return OperandAt(0); }
6522 6528
6523 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { 6529 virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
6749 }; 6755 };
6750 6756
6751 6757
6752 class HLoadKeyedGeneric FINAL : public HTemplateInstruction<3> { 6758 class HLoadKeyedGeneric FINAL : public HTemplateInstruction<3> {
6753 public: 6759 public:
6754 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadKeyedGeneric, HValue*, 6760 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadKeyedGeneric, HValue*,
6755 HValue*); 6761 HValue*);
6756 HValue* object() const { return OperandAt(0); } 6762 HValue* object() const { return OperandAt(0); }
6757 HValue* key() const { return OperandAt(1); } 6763 HValue* key() const { return OperandAt(1); }
6758 HValue* context() const { return OperandAt(2); } 6764 HValue* context() const { return OperandAt(2); }
6759 FeedbackVectorSlot slot() const { 6765 FeedbackVectorICSlot slot() const {
6760 DCHECK(FLAG_vector_ics && !slot_.IsInvalid()); 6766 DCHECK(FLAG_vector_ics && !slot_.IsInvalid());
6761 return slot_; 6767 return slot_;
6762 } 6768 }
6763 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } 6769 Handle<TypeFeedbackVector> feedback_vector() const {
6764 void SetVectorAndSlot(Handle<FixedArray> vector, FeedbackVectorSlot slot) { 6770 return feedback_vector_;
6771 }
6772 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector,
6773 FeedbackVectorICSlot slot) {
6765 DCHECK(FLAG_vector_ics); 6774 DCHECK(FLAG_vector_ics);
6766 feedback_vector_ = vector; 6775 feedback_vector_ = vector;
6767 slot_ = slot; 6776 slot_ = slot;
6768 } 6777 }
6769 6778
6770 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT 6779 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
6771 6780
6772 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { 6781 virtual Representation RequiredInputRepresentation(int index) OVERRIDE {
6773 // tagged[tagged] 6782 // tagged[tagged]
6774 return Representation::Tagged(); 6783 return Representation::Tagged();
6775 } 6784 }
6776 6785
6777 virtual HValue* Canonicalize() OVERRIDE; 6786 virtual HValue* Canonicalize() OVERRIDE;
6778 6787
6779 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) 6788 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric)
6780 6789
6781 private: 6790 private:
6782 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key) 6791 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key)
6783 : slot_(FeedbackVectorSlot::Invalid()) { 6792 : slot_(FeedbackVectorICSlot::Invalid()) {
6784 set_representation(Representation::Tagged()); 6793 set_representation(Representation::Tagged());
6785 SetOperandAt(0, obj); 6794 SetOperandAt(0, obj);
6786 SetOperandAt(1, key); 6795 SetOperandAt(1, key);
6787 SetOperandAt(2, context); 6796 SetOperandAt(2, context);
6788 SetAllSideEffects(); 6797 SetAllSideEffects();
6789 } 6798 }
6790 6799
6791 Handle<FixedArray> feedback_vector_; 6800 Handle<TypeFeedbackVector> feedback_vector_;
6792 FeedbackVectorSlot slot_; 6801 FeedbackVectorICSlot slot_;
6793 }; 6802 };
6794 6803
6795 6804
6796 // Indicates whether the store is a store to an entry that was previously 6805 // Indicates whether the store is a store to an entry that was previously
6797 // initialized or not. 6806 // initialized or not.
6798 enum StoreFieldOrKeyedMode { 6807 enum StoreFieldOrKeyedMode {
6799 // The entry could be either previously initialized or not. 6808 // The entry could be either previously initialized or not.
6800 INITIALIZING_STORE, 6809 INITIALIZING_STORE,
6801 // At the time of this store it is guaranteed that the entry is already 6810 // At the time of this store it is guaranteed that the entry is already
6802 // initialized. 6811 // initialized.
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
7897 }; 7906 };
7898 7907
7899 7908
7900 7909
7901 #undef DECLARE_INSTRUCTION 7910 #undef DECLARE_INSTRUCTION
7902 #undef DECLARE_CONCRETE_INSTRUCTION 7911 #undef DECLARE_CONCRETE_INSTRUCTION
7903 7912
7904 } } // namespace v8::internal 7913 } } // namespace v8::internal
7905 7914
7906 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7915 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/heap/objects-visiting-inl.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698