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_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
7 | 7 |
8 #include <cstring> | 8 #include <cstring> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 | 10 |
(...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2388 } | 2388 } |
2389 | 2389 |
2390 Handle<JSFunction> known_function_; | 2390 Handle<JSFunction> known_function_; |
2391 int formal_parameter_count_; | 2391 int formal_parameter_count_; |
2392 bool has_stack_check_; | 2392 bool has_stack_check_; |
2393 }; | 2393 }; |
2394 | 2394 |
2395 | 2395 |
2396 class HCallFunction final : public HBinaryCall { | 2396 class HCallFunction final : public HBinaryCall { |
2397 public: | 2397 public: |
2398 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallFunction, HValue*, int, | 2398 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HCallFunction, HValue*, int, |
2399 ConvertReceiverMode); | 2399 ConvertReceiverMode, |
| 2400 TailCallMode); |
2400 | 2401 |
2401 HValue* context() const { return first(); } | 2402 HValue* context() const { return first(); } |
2402 HValue* function() const { return second(); } | 2403 HValue* function() const { return second(); } |
2403 | 2404 |
2404 ConvertReceiverMode convert_mode() const { return convert_mode_; } | 2405 ConvertReceiverMode convert_mode() const { |
| 2406 return ConvertReceiverModeField::decode(bit_field_); |
| 2407 } |
| 2408 TailCallMode tail_call_mode() const { |
| 2409 return TailCallModeField::decode(bit_field_); |
| 2410 } |
2405 FeedbackVectorSlot slot() const { return slot_; } | 2411 FeedbackVectorSlot slot() const { return slot_; } |
2406 Handle<TypeFeedbackVector> feedback_vector() const { | 2412 Handle<TypeFeedbackVector> feedback_vector() const { |
2407 return feedback_vector_; | 2413 return feedback_vector_; |
2408 } | 2414 } |
2409 bool HasVectorAndSlot() const { return !feedback_vector_.is_null(); } | 2415 bool HasVectorAndSlot() const { return !feedback_vector_.is_null(); } |
2410 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, | 2416 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, |
2411 FeedbackVectorSlot slot) { | 2417 FeedbackVectorSlot slot) { |
2412 feedback_vector_ = vector; | 2418 feedback_vector_ = vector; |
2413 slot_ = slot; | 2419 slot_ = slot; |
2414 } | 2420 } |
2415 | 2421 |
2416 DECLARE_CONCRETE_INSTRUCTION(CallFunction) | 2422 DECLARE_CONCRETE_INSTRUCTION(CallFunction) |
2417 | 2423 |
2418 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 2424 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
2419 | 2425 |
2420 int argument_delta() const override { return -argument_count(); } | 2426 int argument_delta() const override { return -argument_count(); } |
2421 | 2427 |
2422 private: | 2428 private: |
2423 HCallFunction(HValue* context, HValue* function, int argument_count, | 2429 HCallFunction(HValue* context, HValue* function, int argument_count, |
2424 ConvertReceiverMode convert_mode) | 2430 ConvertReceiverMode convert_mode, TailCallMode tail_call_mode) |
2425 : HBinaryCall(context, function, argument_count), | 2431 : HBinaryCall(context, function, argument_count), |
2426 convert_mode_(convert_mode) {} | 2432 bit_field_(ConvertReceiverModeField::encode(convert_mode) | |
| 2433 TailCallModeField::encode(tail_call_mode)) {} |
2427 Handle<TypeFeedbackVector> feedback_vector_; | 2434 Handle<TypeFeedbackVector> feedback_vector_; |
2428 FeedbackVectorSlot slot_; | 2435 FeedbackVectorSlot slot_; |
2429 ConvertReceiverMode convert_mode_; | 2436 |
| 2437 class ConvertReceiverModeField : public BitField<ConvertReceiverMode, 0, 2> { |
| 2438 }; |
| 2439 class TailCallModeField |
| 2440 : public BitField<TailCallMode, ConvertReceiverModeField::kNext, 1> {}; |
| 2441 |
| 2442 uint32_t bit_field_; |
2430 }; | 2443 }; |
2431 | 2444 |
2432 | 2445 |
2433 class HCallNewArray final : public HBinaryCall { | 2446 class HCallNewArray final : public HBinaryCall { |
2434 public: | 2447 public: |
2435 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HCallNewArray, HValue*, int, | 2448 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HCallNewArray, HValue*, int, |
2436 ElementsKind, | 2449 ElementsKind, |
2437 Handle<AllocationSite>); | 2450 Handle<AllocationSite>); |
2438 | 2451 |
2439 HValue* context() { return first(); } | 2452 HValue* context() { return first(); } |
(...skipping 5348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7788 | 7801 |
7789 | 7802 |
7790 | 7803 |
7791 #undef DECLARE_INSTRUCTION | 7804 #undef DECLARE_INSTRUCTION |
7792 #undef DECLARE_CONCRETE_INSTRUCTION | 7805 #undef DECLARE_CONCRETE_INSTRUCTION |
7793 | 7806 |
7794 } // namespace internal | 7807 } // namespace internal |
7795 } // namespace v8 | 7808 } // namespace v8 |
7796 | 7809 |
7797 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 7810 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |