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

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

Issue 892383003: emit premonomorphic ics for loads/stores in optimized code (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase 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 6491 matching lines...) Expand 10 before | Expand all | Expand 10 after
6502 6502
6503 bool IsDeletable() const OVERRIDE { return true; } 6503 bool IsDeletable() const OVERRIDE { return true; }
6504 6504
6505 HObjectAccess access_; 6505 HObjectAccess access_;
6506 const UniqueSet<Map>* maps_; 6506 const UniqueSet<Map>* maps_;
6507 }; 6507 };
6508 6508
6509 6509
6510 class HLoadNamedGeneric FINAL : public HTemplateInstruction<2> { 6510 class HLoadNamedGeneric FINAL : public HTemplateInstruction<2> {
6511 public: 6511 public:
6512 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadNamedGeneric, HValue*, 6512 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadNamedGeneric, HValue*,
6513 Handle<Object>); 6513 Handle<Object>, InlineCacheState);
6514 6514
6515 HValue* context() const { return OperandAt(0); } 6515 HValue* context() const { return OperandAt(0); }
6516 HValue* object() const { return OperandAt(1); } 6516 HValue* object() const { return OperandAt(1); }
6517 Handle<Object> name() const { return name_; } 6517 Handle<Object> name() const { return name_; }
6518 6518
6519 InlineCacheState initialization_state() const {
6520 return initialization_state_;
6521 }
6519 FeedbackVectorICSlot slot() const { return slot_; } 6522 FeedbackVectorICSlot slot() const { return slot_; }
6520 Handle<TypeFeedbackVector> feedback_vector() const { 6523 Handle<TypeFeedbackVector> feedback_vector() const {
6521 return feedback_vector_; 6524 return feedback_vector_;
6522 } 6525 }
6523 bool HasVectorAndSlot() const { return FLAG_vector_ics; } 6526 bool HasVectorAndSlot() const { return FLAG_vector_ics; }
6524 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, 6527 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector,
6525 FeedbackVectorICSlot slot) { 6528 FeedbackVectorICSlot slot) {
6526 DCHECK(FLAG_vector_ics); 6529 DCHECK(FLAG_vector_ics);
6527 feedback_vector_ = vector; 6530 feedback_vector_ = vector;
6528 slot_ = slot; 6531 slot_ = slot;
6529 } 6532 }
6530 6533
6531 Representation RequiredInputRepresentation(int index) OVERRIDE { 6534 Representation RequiredInputRepresentation(int index) OVERRIDE {
6532 return Representation::Tagged(); 6535 return Representation::Tagged();
6533 } 6536 }
6534 6537
6535 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT 6538 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
6536 6539
6537 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) 6540 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric)
6538 6541
6539 private: 6542 private:
6540 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name) 6543 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name,
6541 : name_(name), slot_(FeedbackVectorICSlot::Invalid()) { 6544 InlineCacheState initialization_state)
6545 : name_(name),
6546 slot_(FeedbackVectorICSlot::Invalid()),
6547 initialization_state_(initialization_state) {
6542 SetOperandAt(0, context); 6548 SetOperandAt(0, context);
6543 SetOperandAt(1, object); 6549 SetOperandAt(1, object);
6544 set_representation(Representation::Tagged()); 6550 set_representation(Representation::Tagged());
6545 SetAllSideEffects(); 6551 SetAllSideEffects();
6546 } 6552 }
6547 6553
6548 Handle<Object> name_; 6554 Handle<Object> name_;
6549 Handle<TypeFeedbackVector> feedback_vector_; 6555 Handle<TypeFeedbackVector> feedback_vector_;
6550 FeedbackVectorICSlot slot_; 6556 FeedbackVectorICSlot slot_;
6557 InlineCacheState initialization_state_;
6551 }; 6558 };
6552 6559
6553 6560
6554 class HLoadFunctionPrototype FINAL : public HUnaryOperation { 6561 class HLoadFunctionPrototype FINAL : public HUnaryOperation {
6555 public: 6562 public:
6556 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*); 6563 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*);
6557 6564
6558 HValue* function() { return OperandAt(0); } 6565 HValue* function() { return OperandAt(0); }
6559 6566
6560 Representation RequiredInputRepresentation(int index) OVERRIDE { 6567 Representation RequiredInputRepresentation(int index) OVERRIDE {
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
6994 class ReceiverIsCellField : public BitField<bool, 2, 1> {}; 7001 class ReceiverIsCellField : public BitField<bool, 2, 1> {};
6995 7002
6996 HObjectAccess access_; 7003 HObjectAccess access_;
6997 HValue* dominator_; 7004 HValue* dominator_;
6998 uint32_t bit_field_; 7005 uint32_t bit_field_;
6999 }; 7006 };
7000 7007
7001 7008
7002 class HStoreNamedGeneric FINAL : public HTemplateInstruction<3> { 7009 class HStoreNamedGeneric FINAL : public HTemplateInstruction<3> {
7003 public: 7010 public:
7004 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*, 7011 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P5(HStoreNamedGeneric, HValue*,
7005 Handle<String>, HValue*, 7012 Handle<String>, HValue*,
7006 LanguageMode); 7013 LanguageMode, InlineCacheState);
7007 HValue* object() const { return OperandAt(0); } 7014 HValue* object() const { return OperandAt(0); }
7008 HValue* value() const { return OperandAt(1); } 7015 HValue* value() const { return OperandAt(1); }
7009 HValue* context() const { return OperandAt(2); } 7016 HValue* context() const { return OperandAt(2); }
7010 Handle<String> name() const { return name_; } 7017 Handle<String> name() const { return name_; }
7011 LanguageMode language_mode() const { return language_mode_; } 7018 LanguageMode language_mode() const { return language_mode_; }
7019 InlineCacheState initialization_state() const {
7020 return initialization_state_;
7021 }
7012 7022
7013 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT 7023 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
7014 7024
7015 Representation RequiredInputRepresentation(int index) OVERRIDE { 7025 Representation RequiredInputRepresentation(int index) OVERRIDE {
7016 return Representation::Tagged(); 7026 return Representation::Tagged();
7017 } 7027 }
7018 7028
7019 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric) 7029 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric)
7020 7030
7021 private: 7031 private:
7022 HStoreNamedGeneric(HValue* context, HValue* object, Handle<String> name, 7032 HStoreNamedGeneric(HValue* context, HValue* object, Handle<String> name,
7023 HValue* value, LanguageMode language_mode) 7033 HValue* value, LanguageMode language_mode,
7024 : name_(name), language_mode_(language_mode) { 7034 InlineCacheState initialization_state)
7035 : name_(name),
7036 language_mode_(language_mode),
7037 initialization_state_(initialization_state) {
7025 SetOperandAt(0, object); 7038 SetOperandAt(0, object);
7026 SetOperandAt(1, value); 7039 SetOperandAt(1, value);
7027 SetOperandAt(2, context); 7040 SetOperandAt(2, context);
7028 SetAllSideEffects(); 7041 SetAllSideEffects();
7029 } 7042 }
7030 7043
7031 Handle<String> name_; 7044 Handle<String> name_;
7032 LanguageMode language_mode_; 7045 LanguageMode language_mode_;
7046 InlineCacheState initialization_state_;
7033 }; 7047 };
7034 7048
7035 7049
7036 class HStoreKeyed FINAL 7050 class HStoreKeyed FINAL
7037 : public HTemplateInstruction<3>, public ArrayInstructionInterface { 7051 : public HTemplateInstruction<3>, public ArrayInstructionInterface {
7038 public: 7052 public:
7039 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, 7053 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*,
7040 ElementsKind); 7054 ElementsKind);
7041 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, 7055 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*,
7042 ElementsKind, StoreFieldOrKeyedMode); 7056 ElementsKind, StoreFieldOrKeyedMode);
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
7937 }; 7951 };
7938 7952
7939 7953
7940 7954
7941 #undef DECLARE_INSTRUCTION 7955 #undef DECLARE_INSTRUCTION
7942 #undef DECLARE_CONCRETE_INSTRUCTION 7956 #undef DECLARE_CONCRETE_INSTRUCTION
7943 7957
7944 } } // namespace v8::internal 7958 } } // namespace v8::internal
7945 7959
7946 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7960 #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