| OLD | NEW |
| 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 "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 2432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2443 HCallFunction(HValue* context, | 2443 HCallFunction(HValue* context, |
| 2444 HValue* function, | 2444 HValue* function, |
| 2445 int argument_count, | 2445 int argument_count, |
| 2446 CallFunctionFlags flags = NO_CALL_FUNCTION_FLAGS) | 2446 CallFunctionFlags flags = NO_CALL_FUNCTION_FLAGS) |
| 2447 : HBinaryCall(context, function, argument_count), function_flags_(flags) { | 2447 : HBinaryCall(context, function, argument_count), function_flags_(flags) { |
| 2448 } | 2448 } |
| 2449 CallFunctionFlags function_flags_; | 2449 CallFunctionFlags function_flags_; |
| 2450 }; | 2450 }; |
| 2451 | 2451 |
| 2452 | 2452 |
| 2453 class HAllocationMode V8_FINAL BASE_EMBEDDED { |
| 2454 public: |
| 2455 HAllocationMode(Handle<AllocationSite> feedback_site, |
| 2456 HValue* current_site = NULL) |
| 2457 : current_site_(current_site), feedback_site_(feedback_site), |
| 2458 pretenure_flag_(NOT_TENURED) {} |
| 2459 explicit HAllocationMode(HValue* current_site) |
| 2460 : current_site_(current_site), pretenure_flag_(NOT_TENURED) {} |
| 2461 explicit HAllocationMode(PretenureFlag pretenure_flag) |
| 2462 : current_site_(NULL), pretenure_flag_(pretenure_flag) {} |
| 2463 HAllocationMode() |
| 2464 : current_site_(NULL), pretenure_flag_(NOT_TENURED) {} |
| 2465 |
| 2466 HValue* current_site() const { return current_site_; } |
| 2467 Handle<AllocationSite> feedback_site() const { return feedback_site_; } |
| 2468 |
| 2469 bool CreateAllocationMementos() const V8_WARN_UNUSED_RESULT { |
| 2470 return current_site() != NULL; |
| 2471 } |
| 2472 |
| 2473 PretenureFlag GetPretenureMode() const V8_WARN_UNUSED_RESULT { |
| 2474 if (!feedback_site().is_null()) return feedback_site()->GetPretenureMode(); |
| 2475 return pretenure_flag_; |
| 2476 } |
| 2477 |
| 2478 private: |
| 2479 HValue* current_site_; |
| 2480 Handle<AllocationSite> feedback_site_; |
| 2481 PretenureFlag pretenure_flag_; |
| 2482 }; |
| 2483 |
| 2484 |
| 2453 class HCallNew V8_FINAL : public HBinaryCall { | 2485 class HCallNew V8_FINAL : public HBinaryCall { |
| 2454 public: | 2486 public: |
| 2455 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallNew, HValue*, int); | 2487 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallNew, HValue*, int, |
| 2488 HAllocationMode); |
| 2456 | 2489 |
| 2457 HValue* context() { return first(); } | 2490 HValue* context() { return first(); } |
| 2458 HValue* constructor() { return second(); } | 2491 HValue* constructor() { return second(); } |
| 2492 HAllocationMode* allocation_mode() { return &mode_; } |
| 2459 | 2493 |
| 2460 DECLARE_CONCRETE_INSTRUCTION(CallNew) | 2494 DECLARE_CONCRETE_INSTRUCTION(CallNew) |
| 2461 | 2495 |
| 2462 private: | 2496 private: |
| 2463 HCallNew(HValue* context, HValue* constructor, int argument_count) | 2497 HCallNew(HValue* context, HValue* constructor, int argument_count, |
| 2464 : HBinaryCall(context, constructor, argument_count) {} | 2498 HAllocationMode mode) |
| 2499 : HBinaryCall(context, constructor, argument_count), |
| 2500 mode_(mode) {} |
| 2501 |
| 2502 HAllocationMode mode_; |
| 2465 }; | 2503 }; |
| 2466 | 2504 |
| 2467 | 2505 |
| 2468 class HCallNewArray V8_FINAL : public HBinaryCall { | 2506 class HCallNewArray V8_FINAL : public HBinaryCall { |
| 2469 public: | 2507 public: |
| 2470 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallNewArray, | 2508 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HCallNewArray, |
| 2471 HValue*, | 2509 HValue*, |
| 2472 int, | 2510 int, |
| 2473 ElementsKind); | 2511 ElementsKind, |
| 2512 HAllocationMode); |
| 2474 | 2513 |
| 2475 HValue* context() { return first(); } | 2514 HValue* context() { return first(); } |
| 2476 HValue* constructor() { return second(); } | 2515 HValue* constructor() { return second(); } |
| 2477 | 2516 |
| 2478 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2517 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 2479 | 2518 |
| 2480 ElementsKind elements_kind() const { return elements_kind_; } | 2519 ElementsKind elements_kind() const { return elements_kind_; } |
| 2520 HAllocationMode* allocation_mode() { return &mode_; } |
| 2481 | 2521 |
| 2482 DECLARE_CONCRETE_INSTRUCTION(CallNewArray) | 2522 DECLARE_CONCRETE_INSTRUCTION(CallNewArray) |
| 2483 | 2523 |
| 2484 private: | 2524 private: |
| 2485 HCallNewArray(HValue* context, HValue* constructor, int argument_count, | 2525 HCallNewArray(HValue* context, HValue* constructor, int argument_count, |
| 2486 ElementsKind elements_kind) | 2526 ElementsKind elements_kind, HAllocationMode mode) |
| 2487 : HBinaryCall(context, constructor, argument_count), | 2527 : HBinaryCall(context, constructor, argument_count), |
| 2488 elements_kind_(elements_kind) {} | 2528 elements_kind_(elements_kind), |
| 2529 mode_(mode) {} |
| 2489 | 2530 |
| 2490 ElementsKind elements_kind_; | 2531 ElementsKind elements_kind_; |
| 2532 HAllocationMode mode_; |
| 2491 }; | 2533 }; |
| 2492 | 2534 |
| 2493 | 2535 |
| 2494 class HCallRuntime V8_FINAL : public HCall<1> { | 2536 class HCallRuntime V8_FINAL : public HCall<1> { |
| 2495 public: | 2537 public: |
| 2496 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallRuntime, | 2538 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallRuntime, |
| 2497 Handle<String>, | 2539 Handle<String>, |
| 2498 const Runtime::Function*, | 2540 const Runtime::Function*, |
| 2499 int); | 2541 int); |
| 2500 | 2542 |
| (...skipping 5215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7716 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7758 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 7717 }; | 7759 }; |
| 7718 | 7760 |
| 7719 | 7761 |
| 7720 #undef DECLARE_INSTRUCTION | 7762 #undef DECLARE_INSTRUCTION |
| 7721 #undef DECLARE_CONCRETE_INSTRUCTION | 7763 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7722 | 7764 |
| 7723 } } // namespace v8::internal | 7765 } } // namespace v8::internal |
| 7724 | 7766 |
| 7725 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7767 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |