Chromium Code Reviews

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

Issue 1199983002: [strong] Implement strong property access semantics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Choose generic path less Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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 6379 matching lines...)
6390 6390
6391 bool IsDeletable() const override { return true; } 6391 bool IsDeletable() const override { return true; }
6392 6392
6393 HObjectAccess access_; 6393 HObjectAccess access_;
6394 const UniqueSet<Map>* maps_; 6394 const UniqueSet<Map>* maps_;
6395 }; 6395 };
6396 6396
6397 6397
6398 class HLoadNamedGeneric final : public HTemplateInstruction<2> { 6398 class HLoadNamedGeneric final : public HTemplateInstruction<2> {
6399 public: 6399 public:
6400 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadNamedGeneric, HValue*, 6400 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HLoadNamedGeneric, HValue*,
6401 Handle<Name>, InlineCacheState); 6401 Handle<Name>, LanguageMode,
6402 InlineCacheState);
6402 6403
6403 HValue* context() const { return OperandAt(0); } 6404 HValue* context() const { return OperandAt(0); }
6404 HValue* object() const { return OperandAt(1); } 6405 HValue* object() const { return OperandAt(1); }
6405 Handle<Name> name() const { return name_; } 6406 Handle<Name> name() const { return name_; }
6406 6407
6407 InlineCacheState initialization_state() const { 6408 InlineCacheState initialization_state() const {
6408 return initialization_state_; 6409 return initialization_state_;
6409 } 6410 }
6410 FeedbackVectorICSlot slot() const { return slot_; } 6411 FeedbackVectorICSlot slot() const { return slot_; }
6411 Handle<TypeFeedbackVector> feedback_vector() const { 6412 Handle<TypeFeedbackVector> feedback_vector() const {
6412 return feedback_vector_; 6413 return feedback_vector_;
6413 } 6414 }
6414 bool HasVectorAndSlot() const { return true; } 6415 bool HasVectorAndSlot() const { return true; }
6415 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, 6416 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector,
6416 FeedbackVectorICSlot slot) { 6417 FeedbackVectorICSlot slot) {
6417 feedback_vector_ = vector; 6418 feedback_vector_ = vector;
6418 slot_ = slot; 6419 slot_ = slot;
6419 } 6420 }
6420 6421
6421 Representation RequiredInputRepresentation(int index) override { 6422 Representation RequiredInputRepresentation(int index) override {
6422 return Representation::Tagged(); 6423 return Representation::Tagged();
6423 } 6424 }
6424 6425
6425 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT 6426 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT
6426 6427
6427 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) 6428 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric)
6428 6429
6430 LanguageMode language_mode() const { return language_mode_; }
6431
6429 private: 6432 private:
6430 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Name> name, 6433 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Name> name,
6434 LanguageMode language_mode,
6431 InlineCacheState initialization_state) 6435 InlineCacheState initialization_state)
6432 : name_(name), 6436 : name_(name),
6433 slot_(FeedbackVectorICSlot::Invalid()), 6437 slot_(FeedbackVectorICSlot::Invalid()),
6438 language_mode_(language_mode),
6434 initialization_state_(initialization_state) { 6439 initialization_state_(initialization_state) {
6435 SetOperandAt(0, context); 6440 SetOperandAt(0, context);
6436 SetOperandAt(1, object); 6441 SetOperandAt(1, object);
6437 set_representation(Representation::Tagged()); 6442 set_representation(Representation::Tagged());
6438 SetAllSideEffects(); 6443 SetAllSideEffects();
6439 } 6444 }
6440 6445
6441 Handle<Name> name_; 6446 Handle<Name> name_;
6442 Handle<TypeFeedbackVector> feedback_vector_; 6447 Handle<TypeFeedbackVector> feedback_vector_;
6443 FeedbackVectorICSlot slot_; 6448 FeedbackVectorICSlot slot_;
6449 LanguageMode language_mode_;
6444 InlineCacheState initialization_state_; 6450 InlineCacheState initialization_state_;
6445 }; 6451 };
6446 6452
6447 6453
6448 class HLoadFunctionPrototype final : public HUnaryOperation { 6454 class HLoadFunctionPrototype final : public HUnaryOperation {
6449 public: 6455 public:
6450 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*); 6456 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*);
6451 6457
6452 HValue* function() { return OperandAt(0); } 6458 HValue* function() { return OperandAt(0); }
6453 6459
(...skipping 219 matching lines...)
6673 {}; // NOLINT 6679 {}; // NOLINT
6674 class IsDehoistedField: 6680 class IsDehoistedField:
6675 public BitField<bool, kStartIsDehoisted, kBitsForIsDehoisted> 6681 public BitField<bool, kStartIsDehoisted, kBitsForIsDehoisted>
6676 {}; // NOLINT 6682 {}; // NOLINT
6677 uint32_t bit_field_; 6683 uint32_t bit_field_;
6678 }; 6684 };
6679 6685
6680 6686
6681 class HLoadKeyedGeneric final : public HTemplateInstruction<3> { 6687 class HLoadKeyedGeneric final : public HTemplateInstruction<3> {
6682 public: 6688 public:
6683 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadKeyedGeneric, HValue*, 6689 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HLoadKeyedGeneric, HValue*,
6684 HValue*, InlineCacheState); 6690 HValue*, LanguageMode,
6691 InlineCacheState);
6685 HValue* object() const { return OperandAt(0); } 6692 HValue* object() const { return OperandAt(0); }
6686 HValue* key() const { return OperandAt(1); } 6693 HValue* key() const { return OperandAt(1); }
6687 HValue* context() const { return OperandAt(2); } 6694 HValue* context() const { return OperandAt(2); }
6688 InlineCacheState initialization_state() const { 6695 InlineCacheState initialization_state() const {
6689 return initialization_state_; 6696 return initialization_state_;
6690 } 6697 }
6691 FeedbackVectorICSlot slot() const { return slot_; } 6698 FeedbackVectorICSlot slot() const { return slot_; }
6692 Handle<TypeFeedbackVector> feedback_vector() const { 6699 Handle<TypeFeedbackVector> feedback_vector() const {
6693 return feedback_vector_; 6700 return feedback_vector_;
6694 } 6701 }
(...skipping 11 matching lines...)
6706 6713
6707 Representation RequiredInputRepresentation(int index) override { 6714 Representation RequiredInputRepresentation(int index) override {
6708 // tagged[tagged] 6715 // tagged[tagged]
6709 return Representation::Tagged(); 6716 return Representation::Tagged();
6710 } 6717 }
6711 6718
6712 HValue* Canonicalize() override; 6719 HValue* Canonicalize() override;
6713 6720
6714 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) 6721 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric)
6715 6722
6723 LanguageMode language_mode() const { return language_mode_; }
6724
6716 private: 6725 private:
6717 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key, 6726 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key,
6727 LanguageMode language_mode,
6718 InlineCacheState initialization_state) 6728 InlineCacheState initialization_state)
6719 : slot_(FeedbackVectorICSlot::Invalid()), 6729 : slot_(FeedbackVectorICSlot::Invalid()),
6720 initialization_state_(initialization_state) { 6730 initialization_state_(initialization_state),
6731 language_mode_(language_mode) {
6721 set_representation(Representation::Tagged()); 6732 set_representation(Representation::Tagged());
6722 SetOperandAt(0, obj); 6733 SetOperandAt(0, obj);
6723 SetOperandAt(1, key); 6734 SetOperandAt(1, key);
6724 SetOperandAt(2, context); 6735 SetOperandAt(2, context);
6725 SetAllSideEffects(); 6736 SetAllSideEffects();
6726 } 6737 }
6727 6738
6728 Handle<TypeFeedbackVector> feedback_vector_; 6739 Handle<TypeFeedbackVector> feedback_vector_;
6729 FeedbackVectorICSlot slot_; 6740 FeedbackVectorICSlot slot_;
6730 InlineCacheState initialization_state_; 6741 InlineCacheState initialization_state_;
6742 LanguageMode language_mode_;
6731 }; 6743 };
6732 6744
6733 6745
6734 // Indicates whether the store is a store to an entry that was previously 6746 // Indicates whether the store is a store to an entry that was previously
6735 // initialized or not. 6747 // initialized or not.
6736 enum StoreFieldOrKeyedMode { 6748 enum StoreFieldOrKeyedMode {
6737 // The entry could be either previously initialized or not. 6749 // The entry could be either previously initialized or not.
6738 INITIALIZING_STORE, 6750 INITIALIZING_STORE,
6739 // At the time of this store it is guaranteed that the entry is already 6751 // At the time of this store it is guaranteed that the entry is already
6740 // initialized. 6752 // initialized.
(...skipping 1193 matching lines...)
7934 }; 7946 };
7935 7947
7936 7948
7937 7949
7938 #undef DECLARE_INSTRUCTION 7950 #undef DECLARE_INSTRUCTION
7939 #undef DECLARE_CONCRETE_INSTRUCTION 7951 #undef DECLARE_CONCRETE_INSTRUCTION
7940 7952
7941 } } // namespace v8::internal 7953 } } // namespace v8::internal
7942 7954
7943 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7955 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | src/ic/ic.cc » ('J')

Powered by Google App Engine