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/compiler/type-hints.h" | 8 #include "src/compiler/type-hints.h" |
9 #include "src/runtime/runtime.h" | 9 #include "src/runtime/runtime.h" |
10 | 10 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 bool operator==(ContextAccess const&, ContextAccess const&); | 206 bool operator==(ContextAccess const&, ContextAccess const&); |
207 bool operator!=(ContextAccess const&, ContextAccess const&); | 207 bool operator!=(ContextAccess const&, ContextAccess const&); |
208 | 208 |
209 size_t hash_value(ContextAccess const&); | 209 size_t hash_value(ContextAccess const&); |
210 | 210 |
211 std::ostream& operator<<(std::ostream&, ContextAccess const&); | 211 std::ostream& operator<<(std::ostream&, ContextAccess const&); |
212 | 212 |
213 ContextAccess const& ContextAccessOf(Operator const*); | 213 ContextAccess const& ContextAccessOf(Operator const*); |
214 | 214 |
215 | 215 |
216 // Defines the name for a dynamic variable lookup. This is used as a parameter | |
217 // by JSLoadDynamic and JSStoreDynamic operators. | |
218 class DynamicAccess final { | |
219 public: | |
220 DynamicAccess(const Handle<String>& name, TypeofMode typeof_mode); | |
221 | |
222 const Handle<String>& name() const { return name_; } | |
223 TypeofMode typeof_mode() const { return typeof_mode_; } | |
224 | |
225 private: | |
226 const Handle<String> name_; | |
227 const TypeofMode typeof_mode_; | |
228 }; | |
229 | |
230 size_t hash_value(DynamicAccess const&); | |
231 | |
232 bool operator==(DynamicAccess const&, DynamicAccess const&); | |
233 bool operator!=(DynamicAccess const&, DynamicAccess const&); | |
234 | |
235 std::ostream& operator<<(std::ostream&, DynamicAccess const&); | |
236 | |
237 DynamicAccess const& DynamicAccessOf(Operator const*); | |
238 | |
239 | |
240 // Defines the property of an object for a named access. This is | 216 // Defines the property of an object for a named access. This is |
241 // used as a parameter by the JSLoadNamed and JSStoreNamed operators. | 217 // used as a parameter by the JSLoadNamed and JSStoreNamed operators. |
242 class NamedAccess final { | 218 class NamedAccess final { |
243 public: | 219 public: |
244 NamedAccess(LanguageMode language_mode, Handle<Name> name, | 220 NamedAccess(LanguageMode language_mode, Handle<Name> name, |
245 VectorSlotPair const& feedback) | 221 VectorSlotPair const& feedback) |
246 : name_(name), feedback_(feedback), language_mode_(language_mode) {} | 222 : name_(name), feedback_(feedback), language_mode_(language_mode) {} |
247 | 223 |
248 Handle<Name> name() const { return name_; } | 224 Handle<Name> name() const { return name_; } |
249 LanguageMode language_mode() const { return language_mode_; } | 225 LanguageMode language_mode() const { return language_mode_; } |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 const Operator* LoadGlobal(const Handle<Name>& name, | 493 const Operator* LoadGlobal(const Handle<Name>& name, |
518 const VectorSlotPair& feedback, | 494 const VectorSlotPair& feedback, |
519 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); | 495 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); |
520 const Operator* StoreGlobal(LanguageMode language_mode, | 496 const Operator* StoreGlobal(LanguageMode language_mode, |
521 const Handle<Name>& name, | 497 const Handle<Name>& name, |
522 const VectorSlotPair& feedback); | 498 const VectorSlotPair& feedback); |
523 | 499 |
524 const Operator* LoadContext(size_t depth, size_t index, bool immutable); | 500 const Operator* LoadContext(size_t depth, size_t index, bool immutable); |
525 const Operator* StoreContext(size_t depth, size_t index); | 501 const Operator* StoreContext(size_t depth, size_t index); |
526 | 502 |
527 const Operator* LoadDynamic(const Handle<String>& name, | |
528 TypeofMode typeof_mode); | |
529 | |
530 const Operator* TypeOf(); | 503 const Operator* TypeOf(); |
531 const Operator* InstanceOf(); | 504 const Operator* InstanceOf(); |
532 | 505 |
533 const Operator* ForInDone(); | 506 const Operator* ForInDone(); |
534 const Operator* ForInNext(); | 507 const Operator* ForInNext(); |
535 const Operator* ForInPrepare(); | 508 const Operator* ForInPrepare(); |
536 const Operator* ForInStep(); | 509 const Operator* ForInStep(); |
537 | 510 |
538 const Operator* LoadMessage(); | 511 const Operator* LoadMessage(); |
539 const Operator* StoreMessage(); | 512 const Operator* StoreMessage(); |
(...skipping 14 matching lines...) Expand all Loading... |
554 Zone* const zone_; | 527 Zone* const zone_; |
555 | 528 |
556 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); | 529 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); |
557 }; | 530 }; |
558 | 531 |
559 } // namespace compiler | 532 } // namespace compiler |
560 } // namespace internal | 533 } // namespace internal |
561 } // namespace v8 | 534 } // namespace v8 |
562 | 535 |
563 #endif // V8_COMPILER_JS_OPERATOR_H_ | 536 #endif // V8_COMPILER_JS_OPERATOR_H_ |
OLD | NEW |