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

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

Issue 945313003: emit premonomorphic ics for keyed loads/stores in optimized code (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-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 <cstring> 8 #include <cstring>
9 #include <iosfwd> 9 #include <iosfwd>
10 10
(...skipping 6776 matching lines...) Expand 10 before | Expand all | Expand 10 after
6787 {}; // NOLINT 6787 {}; // NOLINT
6788 class IsDehoistedField: 6788 class IsDehoistedField:
6789 public BitField<bool, kStartIsDehoisted, kBitsForIsDehoisted> 6789 public BitField<bool, kStartIsDehoisted, kBitsForIsDehoisted>
6790 {}; // NOLINT 6790 {}; // NOLINT
6791 uint32_t bit_field_; 6791 uint32_t bit_field_;
6792 }; 6792 };
6793 6793
6794 6794
6795 class HLoadKeyedGeneric FINAL : public HTemplateInstruction<3> { 6795 class HLoadKeyedGeneric FINAL : public HTemplateInstruction<3> {
6796 public: 6796 public:
6797 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadKeyedGeneric, HValue*, 6797 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadKeyedGeneric, HValue*,
6798 HValue*); 6798 HValue*, InlineCacheState);
6799 HValue* object() const { return OperandAt(0); } 6799 HValue* object() const { return OperandAt(0); }
6800 HValue* key() const { return OperandAt(1); } 6800 HValue* key() const { return OperandAt(1); }
6801 HValue* context() const { return OperandAt(2); } 6801 HValue* context() const { return OperandAt(2); }
6802 InlineCacheState initialization_state() const {
6803 return initialization_state_;
6804 }
6802 FeedbackVectorICSlot slot() const { return slot_; } 6805 FeedbackVectorICSlot slot() const { return slot_; }
6803 Handle<TypeFeedbackVector> feedback_vector() const { 6806 Handle<TypeFeedbackVector> feedback_vector() const {
6804 return feedback_vector_; 6807 return feedback_vector_;
6805 } 6808 }
6806 bool HasVectorAndSlot() const { return FLAG_vector_ics; } 6809 bool HasVectorAndSlot() const { return FLAG_vector_ics; }
6807 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, 6810 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector,
6808 FeedbackVectorICSlot slot) { 6811 FeedbackVectorICSlot slot) {
6809 DCHECK(FLAG_vector_ics); 6812 DCHECK(FLAG_vector_ics);
6810 feedback_vector_ = vector; 6813 feedback_vector_ = vector;
6811 slot_ = slot; 6814 slot_ = slot;
6812 } 6815 }
6813 6816
6814 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT 6817 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
6815 6818
6816 Representation RequiredInputRepresentation(int index) OVERRIDE { 6819 Representation RequiredInputRepresentation(int index) OVERRIDE {
6817 // tagged[tagged] 6820 // tagged[tagged]
6818 return Representation::Tagged(); 6821 return Representation::Tagged();
6819 } 6822 }
6820 6823
6821 HValue* Canonicalize() OVERRIDE; 6824 HValue* Canonicalize() OVERRIDE;
6822 6825
6823 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) 6826 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric)
6824 6827
6825 private: 6828 private:
6826 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key) 6829 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key,
6827 : slot_(FeedbackVectorICSlot::Invalid()) { 6830 InlineCacheState initialization_state)
6831 : slot_(FeedbackVectorICSlot::Invalid()),
6832 initialization_state_(initialization_state) {
6828 set_representation(Representation::Tagged()); 6833 set_representation(Representation::Tagged());
6829 SetOperandAt(0, obj); 6834 SetOperandAt(0, obj);
6830 SetOperandAt(1, key); 6835 SetOperandAt(1, key);
6831 SetOperandAt(2, context); 6836 SetOperandAt(2, context);
6832 SetAllSideEffects(); 6837 SetAllSideEffects();
6833 } 6838 }
6834 6839
6835 Handle<TypeFeedbackVector> feedback_vector_; 6840 Handle<TypeFeedbackVector> feedback_vector_;
6836 FeedbackVectorICSlot slot_; 6841 FeedbackVectorICSlot slot_;
6842 InlineCacheState initialization_state_;
6837 }; 6843 };
6838 6844
6839 6845
6840 // Indicates whether the store is a store to an entry that was previously 6846 // Indicates whether the store is a store to an entry that was previously
6841 // initialized or not. 6847 // initialized or not.
6842 enum StoreFieldOrKeyedMode { 6848 enum StoreFieldOrKeyedMode {
6843 // The entry could be either previously initialized or not. 6849 // The entry could be either previously initialized or not.
6844 INITIALIZING_STORE, 6850 INITIALIZING_STORE,
6845 // At the time of this store it is guaranteed that the entry is already 6851 // At the time of this store it is guaranteed that the entry is already
6846 // initialized. 6852 // initialized.
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
7226 class ElementsKindField : public BitField<ElementsKind, 3, 5> {}; 7232 class ElementsKindField : public BitField<ElementsKind, 3, 5> {};
7227 7233
7228 uint32_t base_offset_; 7234 uint32_t base_offset_;
7229 uint32_t bit_field_; 7235 uint32_t bit_field_;
7230 HValue* dominator_; 7236 HValue* dominator_;
7231 }; 7237 };
7232 7238
7233 7239
7234 class HStoreKeyedGeneric FINAL : public HTemplateInstruction<4> { 7240 class HStoreKeyedGeneric FINAL : public HTemplateInstruction<4> {
7235 public: 7241 public:
7236 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreKeyedGeneric, HValue*, 7242 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P5(HStoreKeyedGeneric, HValue*,
7237 HValue*, HValue*, LanguageMode); 7243 HValue*, HValue*, LanguageMode,
7244 InlineCacheState);
7238 7245
7239 HValue* object() const { return OperandAt(0); } 7246 HValue* object() const { return OperandAt(0); }
7240 HValue* key() const { return OperandAt(1); } 7247 HValue* key() const { return OperandAt(1); }
7241 HValue* value() const { return OperandAt(2); } 7248 HValue* value() const { return OperandAt(2); }
7242 HValue* context() const { return OperandAt(3); } 7249 HValue* context() const { return OperandAt(3); }
7243 LanguageMode language_mode() const { return language_mode_; } 7250 LanguageMode language_mode() const { return language_mode_; }
7251 InlineCacheState initialization_state() const {
7252 return initialization_state_;
7253 }
7244 7254
7245 Representation RequiredInputRepresentation(int index) OVERRIDE { 7255 Representation RequiredInputRepresentation(int index) OVERRIDE {
7246 // tagged[tagged] = tagged 7256 // tagged[tagged] = tagged
7247 return Representation::Tagged(); 7257 return Representation::Tagged();
7248 } 7258 }
7249 7259
7250 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT 7260 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
7251 7261
7252 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric) 7262 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric)
7253 7263
7254 private: 7264 private:
7255 HStoreKeyedGeneric(HValue* context, HValue* object, HValue* key, 7265 HStoreKeyedGeneric(HValue* context, HValue* object, HValue* key,
7256 HValue* value, LanguageMode language_mode) 7266 HValue* value, LanguageMode language_mode,
7257 : language_mode_(language_mode) { 7267 InlineCacheState initialization_state)
7268 : language_mode_(language_mode),
7269 initialization_state_(initialization_state) {
7258 SetOperandAt(0, object); 7270 SetOperandAt(0, object);
7259 SetOperandAt(1, key); 7271 SetOperandAt(1, key);
7260 SetOperandAt(2, value); 7272 SetOperandAt(2, value);
7261 SetOperandAt(3, context); 7273 SetOperandAt(3, context);
7262 SetAllSideEffects(); 7274 SetAllSideEffects();
7263 } 7275 }
7264 7276
7265 LanguageMode language_mode_; 7277 LanguageMode language_mode_;
7278 InlineCacheState initialization_state_;
7266 }; 7279 };
7267 7280
7268 7281
7269 class HTransitionElementsKind FINAL : public HTemplateInstruction<2> { 7282 class HTransitionElementsKind FINAL : public HTemplateInstruction<2> {
7270 public: 7283 public:
7271 inline static HTransitionElementsKind* New(Isolate* isolate, Zone* zone, 7284 inline static HTransitionElementsKind* New(Isolate* isolate, Zone* zone,
7272 HValue* context, HValue* object, 7285 HValue* context, HValue* object,
7273 Handle<Map> original_map, 7286 Handle<Map> original_map,
7274 Handle<Map> transitioned_map) { 7287 Handle<Map> transitioned_map) {
7275 return new(zone) HTransitionElementsKind(context, object, 7288 return new(zone) HTransitionElementsKind(context, object,
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
7951 }; 7964 };
7952 7965
7953 7966
7954 7967
7955 #undef DECLARE_INSTRUCTION 7968 #undef DECLARE_INSTRUCTION
7956 #undef DECLARE_CONCRETE_INSTRUCTION 7969 #undef DECLARE_CONCRETE_INSTRUCTION
7957 7970
7958 } } // namespace v8::internal 7971 } } // namespace v8::internal
7959 7972
7960 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7973 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698