| OLD | NEW | 
|    1 // Copyright 2013 the V8 project authors. All rights reserved. |    1 // Copyright 2013 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_COMPILER_JS_OPERATOR_H_ |    5 #ifndef V8_COMPILER_JS_OPERATOR_H_ | 
|    6 #define V8_COMPILER_JS_OPERATOR_H_ |    6 #define V8_COMPILER_JS_OPERATOR_H_ | 
|    7  |    7  | 
|    8 #include "src/runtime/runtime.h" |    8 #include "src/runtime/runtime.h" | 
|    9 #include "src/unique.h" |    9 #include "src/unique.h" | 
|   10  |   10  | 
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  105 bool operator==(ContextAccess const&, ContextAccess const&); |  105 bool operator==(ContextAccess const&, ContextAccess const&); | 
|  106 bool operator!=(ContextAccess const&, ContextAccess const&); |  106 bool operator!=(ContextAccess const&, ContextAccess const&); | 
|  107  |  107  | 
|  108 size_t hash_value(ContextAccess const&); |  108 size_t hash_value(ContextAccess const&); | 
|  109  |  109  | 
|  110 std::ostream& operator<<(std::ostream&, ContextAccess const&); |  110 std::ostream& operator<<(std::ostream&, ContextAccess const&); | 
|  111  |  111  | 
|  112 ContextAccess const& ContextAccessOf(Operator const*); |  112 ContextAccess const& ContextAccessOf(Operator const*); | 
|  113  |  113  | 
|  114  |  114  | 
 |  115 class VectorSlotPair { | 
 |  116  public: | 
 |  117   VectorSlotPair(Handle<TypeFeedbackVector> vector, FeedbackVectorICSlot slot) | 
 |  118       : vector_(vector), slot_(slot) {} | 
 |  119  | 
 |  120   Handle<TypeFeedbackVector> vector() const { return vector_; } | 
 |  121   FeedbackVectorICSlot slot() const { return slot_; } | 
 |  122  | 
 |  123   int index() const { return vector_->GetIndex(slot_); } | 
 |  124  | 
 |  125  private: | 
 |  126   const Handle<TypeFeedbackVector> vector_; | 
 |  127   const FeedbackVectorICSlot slot_; | 
 |  128 }; | 
 |  129  | 
 |  130  | 
 |  131 bool operator==(VectorSlotPair const& lhs, VectorSlotPair const& rhs); | 
 |  132  | 
 |  133  | 
|  115 // Defines the name for a dynamic variable lookup. The {check_bitset} allows to |  134 // Defines the name for a dynamic variable lookup. The {check_bitset} allows to | 
|  116 // inline checks whether the lookup yields in a global variable. This is used as |  135 // inline checks whether the lookup yields in a global variable. This is used as | 
|  117 // a parameter by JSLoadDynamicGlobal and JSStoreDynamicGlobal operators. |  136 // a parameter by JSLoadDynamicGlobal and JSStoreDynamicGlobal operators. | 
|  118 class DynamicGlobalAccess final { |  137 class DynamicGlobalAccess final { | 
|  119  public: |  138  public: | 
|  120   DynamicGlobalAccess(const Handle<String>& name, uint32_t check_bitset, |  139   DynamicGlobalAccess(const Handle<String>& name, uint32_t check_bitset, | 
|  121                       ContextualMode mode); |  140                       const VectorSlotPair& feedback, ContextualMode mode); | 
|  122  |  141  | 
|  123   const Handle<String>& name() const { return name_; } |  142   const Handle<String>& name() const { return name_; } | 
|  124   uint32_t check_bitset() const { return check_bitset_; } |  143   uint32_t check_bitset() const { return check_bitset_; } | 
 |  144   const VectorSlotPair& feedback() const { return feedback_; } | 
|  125   ContextualMode mode() const { return mode_; } |  145   ContextualMode mode() const { return mode_; } | 
|  126  |  146  | 
|  127   // Indicates that an inline check is disabled. |  147   // Indicates that an inline check is disabled. | 
|  128   bool RequiresFullCheck() const { |  148   bool RequiresFullCheck() const { | 
|  129     return check_bitset() == kFullCheckRequired; |  149     return check_bitset() == kFullCheckRequired; | 
|  130   } |  150   } | 
|  131  |  151  | 
|  132   // Limit of context chain length to which inline check is possible. |  152   // Limit of context chain length to which inline check is possible. | 
|  133   static const int kMaxCheckDepth = 30; |  153   static const int kMaxCheckDepth = 30; | 
|  134  |  154  | 
|  135   // Sentinel for {check_bitset} disabling inline checks. |  155   // Sentinel for {check_bitset} disabling inline checks. | 
|  136   static const uint32_t kFullCheckRequired = -1; |  156   static const uint32_t kFullCheckRequired = -1; | 
|  137  |  157  | 
|  138  private: |  158  private: | 
|  139   const Handle<String> name_; |  159   const Handle<String> name_; | 
|  140   const uint32_t check_bitset_; |  160   const uint32_t check_bitset_; | 
 |  161   const VectorSlotPair feedback_; | 
|  141   const ContextualMode mode_; |  162   const ContextualMode mode_; | 
|  142 }; |  163 }; | 
|  143  |  164  | 
|  144 size_t hash_value(DynamicGlobalAccess const&); |  165 size_t hash_value(DynamicGlobalAccess const&); | 
|  145  |  166  | 
|  146 bool operator==(DynamicGlobalAccess const&, DynamicGlobalAccess const&); |  167 bool operator==(DynamicGlobalAccess const&, DynamicGlobalAccess const&); | 
|  147 bool operator!=(DynamicGlobalAccess const&, DynamicGlobalAccess const&); |  168 bool operator!=(DynamicGlobalAccess const&, DynamicGlobalAccess const&); | 
|  148  |  169  | 
|  149 std::ostream& operator<<(std::ostream&, DynamicGlobalAccess const&); |  170 std::ostream& operator<<(std::ostream&, DynamicGlobalAccess const&); | 
|  150  |  171  | 
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  183 size_t hash_value(DynamicContextAccess const&); |  204 size_t hash_value(DynamicContextAccess const&); | 
|  184  |  205  | 
|  185 bool operator==(DynamicContextAccess const&, DynamicContextAccess const&); |  206 bool operator==(DynamicContextAccess const&, DynamicContextAccess const&); | 
|  186 bool operator!=(DynamicContextAccess const&, DynamicContextAccess const&); |  207 bool operator!=(DynamicContextAccess const&, DynamicContextAccess const&); | 
|  187  |  208  | 
|  188 std::ostream& operator<<(std::ostream&, DynamicContextAccess const&); |  209 std::ostream& operator<<(std::ostream&, DynamicContextAccess const&); | 
|  189  |  210  | 
|  190 DynamicContextAccess const& DynamicContextAccessOf(Operator const*); |  211 DynamicContextAccess const& DynamicContextAccessOf(Operator const*); | 
|  191  |  212  | 
|  192  |  213  | 
|  193 class VectorSlotPair { |  | 
|  194  public: |  | 
|  195   VectorSlotPair(Handle<TypeFeedbackVector> vector, FeedbackVectorICSlot slot) |  | 
|  196       : vector_(vector), slot_(slot) {} |  | 
|  197  |  | 
|  198   Handle<TypeFeedbackVector> vector() const { return vector_; } |  | 
|  199   FeedbackVectorICSlot slot() const { return slot_; } |  | 
|  200  |  | 
|  201   int index() const { return vector_->GetIndex(slot_); } |  | 
|  202  |  | 
|  203  private: |  | 
|  204   const Handle<TypeFeedbackVector> vector_; |  | 
|  205   const FeedbackVectorICSlot slot_; |  | 
|  206 }; |  | 
|  207  |  | 
|  208  |  | 
|  209 bool operator==(VectorSlotPair const& lhs, VectorSlotPair const& rhs); |  | 
|  210  |  | 
|  211  |  | 
|  212 // Defines the property being loaded from an object by a named load. This is |  214 // Defines the property being loaded from an object by a named load. This is | 
|  213 // used as a parameter by JSLoadNamed operators. |  215 // used as a parameter by JSLoadNamed operators. | 
|  214 class LoadNamedParameters final { |  216 class LoadNamedParameters final { | 
|  215  public: |  217  public: | 
|  216   LoadNamedParameters(const Unique<Name>& name, const VectorSlotPair& feedback, |  218   LoadNamedParameters(const Unique<Name>& name, const VectorSlotPair& feedback, | 
|  217                       ContextualMode contextual_mode) |  219                       ContextualMode contextual_mode) | 
|  218       : name_(name), feedback_(feedback), contextual_mode_(contextual_mode) {} |  220       : name_(name), feedback_(feedback), contextual_mode_(contextual_mode) {} | 
|  219  |  221  | 
|  220   const Unique<Name>& name() const { return name_; } |  222   const Unique<Name>& name() const { return name_; } | 
|  221   ContextualMode contextual_mode() const { return contextual_mode_; } |  223   ContextualMode contextual_mode() const { return contextual_mode_; } | 
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  369                              const Unique<Name>& name); |  371                              const Unique<Name>& name); | 
|  370  |  372  | 
|  371   const Operator* DeleteProperty(LanguageMode language_mode); |  373   const Operator* DeleteProperty(LanguageMode language_mode); | 
|  372  |  374  | 
|  373   const Operator* HasProperty(); |  375   const Operator* HasProperty(); | 
|  374  |  376  | 
|  375   const Operator* LoadContext(size_t depth, size_t index, bool immutable); |  377   const Operator* LoadContext(size_t depth, size_t index, bool immutable); | 
|  376   const Operator* StoreContext(size_t depth, size_t index); |  378   const Operator* StoreContext(size_t depth, size_t index); | 
|  377  |  379  | 
|  378   const Operator* LoadDynamicGlobal(const Handle<String>& name, |  380   const Operator* LoadDynamicGlobal(const Handle<String>& name, | 
|  379                                     uint32_t check_bitset, ContextualMode mode); |  381                                     uint32_t check_bitset, | 
 |  382                                     const VectorSlotPair& feedback, | 
 |  383                                     ContextualMode mode); | 
|  380   const Operator* LoadDynamicContext(const Handle<String>& name, |  384   const Operator* LoadDynamicContext(const Handle<String>& name, | 
|  381                                      uint32_t check_bitset, size_t depth, |  385                                      uint32_t check_bitset, size_t depth, | 
|  382                                      size_t index); |  386                                      size_t index); | 
|  383  |  387  | 
|  384   const Operator* TypeOf(); |  388   const Operator* TypeOf(); | 
|  385   const Operator* InstanceOf(); |  389   const Operator* InstanceOf(); | 
|  386  |  390  | 
|  387   const Operator* ForInDone(); |  391   const Operator* ForInDone(); | 
|  388   const Operator* ForInNext(); |  392   const Operator* ForInNext(); | 
|  389   const Operator* ForInPrepare(); |  393   const Operator* ForInPrepare(); | 
| (...skipping 16 matching lines...) Expand all  Loading... | 
|  406   Zone* const zone_; |  410   Zone* const zone_; | 
|  407  |  411  | 
|  408   DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); |  412   DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); | 
|  409 }; |  413 }; | 
|  410  |  414  | 
|  411 }  // namespace compiler |  415 }  // namespace compiler | 
|  412 }  // namespace internal |  416 }  // namespace internal | 
|  413 }  // namespace v8 |  417 }  // namespace v8 | 
|  414  |  418  | 
|  415 #endif  // V8_COMPILER_JS_OPERATOR_H_ |  419 #endif  // V8_COMPILER_JS_OPERATOR_H_ | 
| OLD | NEW |