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 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 size_t hash_value(DynamicContextAccess const&); | 221 size_t hash_value(DynamicContextAccess const&); |
222 | 222 |
223 bool operator==(DynamicContextAccess const&, DynamicContextAccess const&); | 223 bool operator==(DynamicContextAccess const&, DynamicContextAccess const&); |
224 bool operator!=(DynamicContextAccess const&, DynamicContextAccess const&); | 224 bool operator!=(DynamicContextAccess const&, DynamicContextAccess const&); |
225 | 225 |
226 std::ostream& operator<<(std::ostream&, DynamicContextAccess const&); | 226 std::ostream& operator<<(std::ostream&, DynamicContextAccess const&); |
227 | 227 |
228 DynamicContextAccess const& DynamicContextAccessOf(Operator const*); | 228 DynamicContextAccess const& DynamicContextAccessOf(Operator const*); |
229 | 229 |
230 | 230 |
231 // Defines the property being loaded from an object by a named load. This is | 231 // Defines the property of an object for a named access. This is |
232 // used as a parameter by JSLoadNamed operators. | 232 // used as a parameter by the JSLoadNamed and JSStoreNamed operators. |
233 class LoadNamedParameters final { | 233 class NamedAccess final { |
234 public: | 234 public: |
235 LoadNamedParameters(const Handle<Name>& name, const VectorSlotPair& feedback, | 235 NamedAccess(LanguageMode language_mode, Handle<Name> name, |
236 LanguageMode language_mode) | 236 VectorSlotPair const& feedback) |
237 : name_(name), feedback_(feedback), language_mode_(language_mode) {} | 237 : name_(name), feedback_(feedback), language_mode_(language_mode) {} |
238 | 238 |
239 const Handle<Name>& name() const { return name_; } | 239 Handle<Name> name() const { return name_; } |
240 LanguageMode language_mode() const { return language_mode_; } | 240 LanguageMode language_mode() const { return language_mode_; } |
241 | 241 VectorSlotPair const& feedback() const { return feedback_; } |
242 const VectorSlotPair& feedback() const { return feedback_; } | |
243 | 242 |
244 private: | 243 private: |
245 const Handle<Name> name_; | 244 Handle<Name> const name_; |
246 const VectorSlotPair feedback_; | 245 VectorSlotPair const feedback_; |
247 const LanguageMode language_mode_; | 246 LanguageMode const language_mode_; |
248 }; | 247 }; |
249 | 248 |
250 bool operator==(LoadNamedParameters const&, LoadNamedParameters const&); | 249 bool operator==(NamedAccess const&, NamedAccess const&); |
251 bool operator!=(LoadNamedParameters const&, LoadNamedParameters const&); | 250 bool operator!=(NamedAccess const&, NamedAccess const&); |
252 | 251 |
253 size_t hash_value(LoadNamedParameters const&); | 252 size_t hash_value(NamedAccess const&); |
254 | 253 |
255 std::ostream& operator<<(std::ostream&, LoadNamedParameters const&); | 254 std::ostream& operator<<(std::ostream&, NamedAccess const&); |
256 | 255 |
257 const LoadNamedParameters& LoadNamedParametersOf(const Operator* op); | 256 const NamedAccess& NamedAccessOf(const Operator* op); |
258 | 257 |
259 | 258 |
260 // Defines the property being loaded from an object by a named load. This is | 259 // Defines the property being loaded from an object by a named load. This is |
261 // used as a parameter by JSLoadGlobal operator. | 260 // used as a parameter by JSLoadGlobal operator. |
262 class LoadGlobalParameters final { | 261 class LoadGlobalParameters final { |
263 public: | 262 public: |
264 LoadGlobalParameters(const Handle<Name>& name, const VectorSlotPair& feedback, | 263 LoadGlobalParameters(const Handle<Name>& name, const VectorSlotPair& feedback, |
265 TypeofMode typeof_mode, int slot_index) | 264 TypeofMode typeof_mode, int slot_index) |
266 : name_(name), | 265 : name_(name), |
267 feedback_(feedback), | 266 feedback_(feedback), |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 bool operator==(StoreGlobalParameters const&, StoreGlobalParameters const&); | 318 bool operator==(StoreGlobalParameters const&, StoreGlobalParameters const&); |
320 bool operator!=(StoreGlobalParameters const&, StoreGlobalParameters const&); | 319 bool operator!=(StoreGlobalParameters const&, StoreGlobalParameters const&); |
321 | 320 |
322 size_t hash_value(StoreGlobalParameters const&); | 321 size_t hash_value(StoreGlobalParameters const&); |
323 | 322 |
324 std::ostream& operator<<(std::ostream&, StoreGlobalParameters const&); | 323 std::ostream& operator<<(std::ostream&, StoreGlobalParameters const&); |
325 | 324 |
326 const StoreGlobalParameters& StoreGlobalParametersOf(const Operator* op); | 325 const StoreGlobalParameters& StoreGlobalParametersOf(const Operator* op); |
327 | 326 |
328 | 327 |
329 // Defines the property being loaded from an object. This is | 328 // Defines the property of an object for a keyed access. This is used |
330 // used as a parameter by JSLoadProperty operators. | 329 // as a parameter by the JSLoadProperty and JSStoreProperty operators. |
331 class LoadPropertyParameters final { | 330 class PropertyAccess final { |
332 public: | 331 public: |
333 explicit LoadPropertyParameters(const VectorSlotPair& feedback, | 332 PropertyAccess(LanguageMode language_mode, VectorSlotPair const& feedback) |
334 LanguageMode language_mode) | |
335 : feedback_(feedback), language_mode_(language_mode) {} | 333 : feedback_(feedback), language_mode_(language_mode) {} |
336 | 334 |
337 const VectorSlotPair& feedback() const { return feedback_; } | |
338 | |
339 LanguageMode language_mode() const { return language_mode_; } | 335 LanguageMode language_mode() const { return language_mode_; } |
| 336 VectorSlotPair const& feedback() const { return feedback_; } |
340 | 337 |
341 private: | 338 private: |
342 const VectorSlotPair feedback_; | 339 VectorSlotPair const feedback_; |
343 const LanguageMode language_mode_; | 340 LanguageMode const language_mode_; |
344 }; | 341 }; |
345 | 342 |
346 bool operator==(LoadPropertyParameters const&, LoadPropertyParameters const&); | 343 bool operator==(PropertyAccess const&, PropertyAccess const&); |
347 bool operator!=(LoadPropertyParameters const&, LoadPropertyParameters const&); | 344 bool operator!=(PropertyAccess const&, PropertyAccess const&); |
348 | 345 |
349 size_t hash_value(LoadPropertyParameters const&); | 346 size_t hash_value(PropertyAccess const&); |
350 | 347 |
351 std::ostream& operator<<(std::ostream&, LoadPropertyParameters const&); | 348 std::ostream& operator<<(std::ostream&, PropertyAccess const&); |
352 | 349 |
353 const LoadPropertyParameters& LoadPropertyParametersOf(const Operator* op); | 350 PropertyAccess const& PropertyAccessOf(const Operator* op); |
354 | |
355 | |
356 // Defines the property being stored to an object by a named store. This is | |
357 // used as a parameter by JSStoreNamed operator. | |
358 class StoreNamedParameters final { | |
359 public: | |
360 StoreNamedParameters(LanguageMode language_mode, | |
361 const VectorSlotPair& feedback, const Handle<Name>& name) | |
362 : language_mode_(language_mode), name_(name), feedback_(feedback) {} | |
363 | |
364 LanguageMode language_mode() const { return language_mode_; } | |
365 const VectorSlotPair& feedback() const { return feedback_; } | |
366 const Handle<Name>& name() const { return name_; } | |
367 | |
368 private: | |
369 const LanguageMode language_mode_; | |
370 const Handle<Name> name_; | |
371 const VectorSlotPair feedback_; | |
372 }; | |
373 | |
374 bool operator==(StoreNamedParameters const&, StoreNamedParameters const&); | |
375 bool operator!=(StoreNamedParameters const&, StoreNamedParameters const&); | |
376 | |
377 size_t hash_value(StoreNamedParameters const&); | |
378 | |
379 std::ostream& operator<<(std::ostream&, StoreNamedParameters const&); | |
380 | |
381 const StoreNamedParameters& StoreNamedParametersOf(const Operator* op); | |
382 | |
383 | |
384 // Defines the property being stored to an object. This is used as a parameter | |
385 // by JSStoreProperty operators. | |
386 class StorePropertyParameters final { | |
387 public: | |
388 StorePropertyParameters(LanguageMode language_mode, | |
389 const VectorSlotPair& feedback) | |
390 : language_mode_(language_mode), feedback_(feedback) {} | |
391 | |
392 LanguageMode language_mode() const { return language_mode_; } | |
393 const VectorSlotPair& feedback() const { return feedback_; } | |
394 | |
395 private: | |
396 const LanguageMode language_mode_; | |
397 const VectorSlotPair feedback_; | |
398 }; | |
399 | |
400 bool operator==(StorePropertyParameters const&, StorePropertyParameters const&); | |
401 bool operator!=(StorePropertyParameters const&, StorePropertyParameters const&); | |
402 | |
403 size_t hash_value(StorePropertyParameters const&); | |
404 | |
405 std::ostream& operator<<(std::ostream&, StorePropertyParameters const&); | |
406 | |
407 const StorePropertyParameters& StorePropertyParametersOf(const Operator* op); | |
408 | 351 |
409 | 352 |
410 // Defines specifics about arguments object or rest parameter creation. This is | 353 // Defines specifics about arguments object or rest parameter creation. This is |
411 // used as a parameter by JSCreateArguments operators. | 354 // used as a parameter by JSCreateArguments operators. |
412 class CreateArgumentsParameters final { | 355 class CreateArgumentsParameters final { |
413 public: | 356 public: |
414 enum Type { kMappedArguments, kUnmappedArguments, kRestArray }; | 357 enum Type { kMappedArguments, kUnmappedArguments, kRestArray }; |
415 CreateArgumentsParameters(Type type, int start_index) | 358 CreateArgumentsParameters(Type type, int start_index) |
416 : type_(type), start_index_(start_index) {} | 359 : type_(type), start_index_(start_index) {} |
417 | 360 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 const Operator* CreateLiteralObject(int literal_flags); | 449 const Operator* CreateLiteralObject(int literal_flags); |
507 | 450 |
508 const Operator* CallFunction( | 451 const Operator* CallFunction( |
509 size_t arity, CallFunctionFlags flags, LanguageMode language_mode, | 452 size_t arity, CallFunctionFlags flags, LanguageMode language_mode, |
510 VectorSlotPair const& feedback = VectorSlotPair(), | 453 VectorSlotPair const& feedback = VectorSlotPair(), |
511 TailCallMode tail_call_mode = NO_TAIL_CALLS); | 454 TailCallMode tail_call_mode = NO_TAIL_CALLS); |
512 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity); | 455 const Operator* CallRuntime(Runtime::FunctionId id, size_t arity); |
513 | 456 |
514 const Operator* CallConstruct(int arguments); | 457 const Operator* CallConstruct(int arguments); |
515 | 458 |
516 const Operator* LoadProperty(const VectorSlotPair& feedback, | 459 const Operator* LoadProperty(LanguageMode language_mode, |
517 LanguageMode language_mode); | 460 VectorSlotPair const& feedback); |
518 const Operator* LoadNamed(const Handle<Name>& name, | 461 const Operator* LoadNamed(LanguageMode language_mode, Handle<Name> name, |
519 const VectorSlotPair& feedback, | 462 VectorSlotPair const& feedback); |
520 LanguageMode language_mode); | |
521 | 463 |
522 const Operator* StoreProperty(LanguageMode language_mode, | 464 const Operator* StoreProperty(LanguageMode language_mode, |
523 const VectorSlotPair& feedback); | 465 VectorSlotPair const& feedback); |
524 const Operator* StoreNamed(LanguageMode language_mode, | 466 const Operator* StoreNamed(LanguageMode language_mode, Handle<Name> name, |
525 const Handle<Name>& name, | 467 VectorSlotPair const& feedback); |
526 const VectorSlotPair& feedback); | |
527 | 468 |
528 const Operator* DeleteProperty(LanguageMode language_mode); | 469 const Operator* DeleteProperty(LanguageMode language_mode); |
529 | 470 |
530 const Operator* HasProperty(); | 471 const Operator* HasProperty(); |
531 | 472 |
532 const Operator* LoadGlobal(const Handle<Name>& name, | 473 const Operator* LoadGlobal(const Handle<Name>& name, |
533 const VectorSlotPair& feedback, | 474 const VectorSlotPair& feedback, |
534 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF, | 475 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF, |
535 int slot_index = -1); | 476 int slot_index = -1); |
536 const Operator* StoreGlobal(LanguageMode language_mode, | 477 const Operator* StoreGlobal(LanguageMode language_mode, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 Zone* const zone_; | 514 Zone* const zone_; |
574 | 515 |
575 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); | 516 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); |
576 }; | 517 }; |
577 | 518 |
578 } // namespace compiler | 519 } // namespace compiler |
579 } // namespace internal | 520 } // namespace internal |
580 } // namespace v8 | 521 } // namespace v8 |
581 | 522 |
582 #endif // V8_COMPILER_JS_OPERATOR_H_ | 523 #endif // V8_COMPILER_JS_OPERATOR_H_ |
OLD | NEW |