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 2378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2389 } | 2389 } |
2390 | 2390 |
2391 Handle<JSFunction> known_function_; | 2391 Handle<JSFunction> known_function_; |
2392 int formal_parameter_count_; | 2392 int formal_parameter_count_; |
2393 bool has_stack_check_; | 2393 bool has_stack_check_; |
2394 }; | 2394 }; |
2395 | 2395 |
2396 | 2396 |
2397 class HCallFunction final : public HBinaryCall { | 2397 class HCallFunction final : public HBinaryCall { |
2398 public: | 2398 public: |
2399 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallFunction, HValue*, int, | 2399 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HCallFunction, HValue*, int, |
2400 ConvertReceiverMode); | 2400 ConvertReceiverMode, |
| 2401 TailCallMode); |
2401 | 2402 |
2402 HValue* context() const { return first(); } | 2403 HValue* context() const { return first(); } |
2403 HValue* function() const { return second(); } | 2404 HValue* function() const { return second(); } |
2404 | 2405 |
2405 ConvertReceiverMode convert_mode() const { return convert_mode_; } | 2406 ConvertReceiverMode convert_mode() const { |
| 2407 return ConvertReceiverModeField::decode(bit_field_); |
| 2408 } |
| 2409 TailCallMode tail_call_mode() const { |
| 2410 return TailCallModeField::decode(bit_field_); |
| 2411 } |
2406 FeedbackVectorSlot slot() const { return slot_; } | 2412 FeedbackVectorSlot slot() const { return slot_; } |
2407 Handle<TypeFeedbackVector> feedback_vector() const { | 2413 Handle<TypeFeedbackVector> feedback_vector() const { |
2408 return feedback_vector_; | 2414 return feedback_vector_; |
2409 } | 2415 } |
2410 bool HasVectorAndSlot() const { return !feedback_vector_.is_null(); } | 2416 bool HasVectorAndSlot() const { return !feedback_vector_.is_null(); } |
2411 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, | 2417 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector, |
2412 FeedbackVectorSlot slot) { | 2418 FeedbackVectorSlot slot) { |
2413 feedback_vector_ = vector; | 2419 feedback_vector_ = vector; |
2414 slot_ = slot; | 2420 slot_ = slot; |
2415 } | 2421 } |
2416 | 2422 |
2417 DECLARE_CONCRETE_INSTRUCTION(CallFunction) | 2423 DECLARE_CONCRETE_INSTRUCTION(CallFunction) |
2418 | 2424 |
2419 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 2425 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
2420 | 2426 |
2421 int argument_delta() const override { return -argument_count(); } | 2427 int argument_delta() const override { return -argument_count(); } |
2422 | 2428 |
2423 private: | 2429 private: |
2424 HCallFunction(HValue* context, HValue* function, int argument_count, | 2430 HCallFunction(HValue* context, HValue* function, int argument_count, |
2425 ConvertReceiverMode convert_mode) | 2431 ConvertReceiverMode convert_mode, TailCallMode tail_call_mode) |
2426 : HBinaryCall(context, function, argument_count), | 2432 : HBinaryCall(context, function, argument_count), |
2427 convert_mode_(convert_mode) {} | 2433 bit_field_(ConvertReceiverModeField::encode(convert_mode) | |
| 2434 TailCallModeField::encode(tail_call_mode)) {} |
2428 Handle<TypeFeedbackVector> feedback_vector_; | 2435 Handle<TypeFeedbackVector> feedback_vector_; |
2429 FeedbackVectorSlot slot_; | 2436 FeedbackVectorSlot slot_; |
2430 ConvertReceiverMode convert_mode_; | 2437 |
| 2438 class ConvertReceiverModeField : public BitField<ConvertReceiverMode, 0, 2> { |
| 2439 }; |
| 2440 class TailCallModeField |
| 2441 : public BitField<TailCallMode, ConvertReceiverModeField::kNext, 1> {}; |
| 2442 |
| 2443 uint32_t bit_field_; |
2431 }; | 2444 }; |
2432 | 2445 |
2433 | 2446 |
2434 class HCallNewArray final : public HBinaryCall { | 2447 class HCallNewArray final : public HBinaryCall { |
2435 public: | 2448 public: |
2436 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HCallNewArray, HValue*, int, | 2449 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HCallNewArray, HValue*, int, |
2437 ElementsKind, | 2450 ElementsKind, |
2438 Handle<AllocationSite>); | 2451 Handle<AllocationSite>); |
2439 | 2452 |
2440 HValue* context() { return first(); } | 2453 HValue* context() { return first(); } |
(...skipping 5368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7809 | 7822 |
7810 | 7823 |
7811 | 7824 |
7812 #undef DECLARE_INSTRUCTION | 7825 #undef DECLARE_INSTRUCTION |
7813 #undef DECLARE_CONCRETE_INSTRUCTION | 7826 #undef DECLARE_CONCRETE_INSTRUCTION |
7814 | 7827 |
7815 } // namespace internal | 7828 } // namespace internal |
7816 } // namespace v8 | 7829 } // namespace v8 |
7817 | 7830 |
7818 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 7831 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |