OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 }; | 453 }; |
454 | 454 |
455 | 455 |
456 class HEnvironment: public ZoneObject { | 456 class HEnvironment: public ZoneObject { |
457 public: | 457 public: |
458 HEnvironment(HEnvironment* outer, | 458 HEnvironment(HEnvironment* outer, |
459 Scope* scope, | 459 Scope* scope, |
460 Handle<JSFunction> closure, | 460 Handle<JSFunction> closure, |
461 Zone* zone); | 461 Zone* zone); |
462 | 462 |
463 explicit HEnvironment(Zone* zone); | 463 HEnvironment(Zone* zone, int parameter_count); |
464 | 464 |
465 HEnvironment* arguments_environment() { | 465 HEnvironment* arguments_environment() { |
466 return outer()->frame_type() == ARGUMENTS_ADAPTOR ? outer() : this; | 466 return outer()->frame_type() == ARGUMENTS_ADAPTOR ? outer() : this; |
467 } | 467 } |
468 | 468 |
469 // Simple accessors. | 469 // Simple accessors. |
470 Handle<JSFunction> closure() const { return closure_; } | 470 Handle<JSFunction> closure() const { return closure_; } |
471 const ZoneList<HValue*>* values() const { return &values_; } | 471 const ZoneList<HValue*>* values() const { return &values_; } |
472 const GrowableBitVector* assigned_variables() const { | 472 const GrowableBitVector* assigned_variables() const { |
473 return &assigned_variables_; | 473 return &assigned_variables_; |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 HInstruction* BuildStoreMap(HValue* object, Handle<Map> map, BailoutId id); | 921 HInstruction* BuildStoreMap(HValue* object, Handle<Map> map, BailoutId id); |
922 | 922 |
923 class IfBuilder { | 923 class IfBuilder { |
924 public: | 924 public: |
925 IfBuilder(HGraphBuilder* builder, | 925 IfBuilder(HGraphBuilder* builder, |
926 BailoutId id = BailoutId::StubEntry()); | 926 BailoutId id = BailoutId::StubEntry()); |
927 ~IfBuilder() { | 927 ~IfBuilder() { |
928 if (!finished_) End(); | 928 if (!finished_) End(); |
929 } | 929 } |
930 | 930 |
931 void BeginTrue(HValue* left, HValue* right, Token::Value token); | 931 HInstruction* BeginTrue( |
| 932 HValue* left, |
| 933 HValue* right, |
| 934 Token::Value token, |
| 935 Representation input_representation = Representation::Integer32()); |
932 void BeginFalse(); | 936 void BeginFalse(); |
933 void End(); | 937 void End(); |
934 | 938 |
935 private: | 939 private: |
936 HGraphBuilder* builder_; | 940 HGraphBuilder* builder_; |
937 bool finished_; | 941 bool finished_; |
938 HBasicBlock* true_block_; | 942 HBasicBlock* first_true_block_; |
939 HBasicBlock* false_block_; | 943 HBasicBlock* last_true_block_; |
| 944 HBasicBlock* first_false_block_; |
940 HBasicBlock* merge_block_; | 945 HBasicBlock* merge_block_; |
941 BailoutId id_; | 946 BailoutId id_; |
942 | 947 |
943 Zone* zone() { return builder_->zone(); } | 948 Zone* zone() { return builder_->zone(); } |
944 }; | 949 }; |
945 | 950 |
946 class LoopBuilder { | 951 class LoopBuilder { |
947 public: | 952 public: |
948 enum Direction { | 953 enum Direction { |
949 kPreIncrement, | 954 kPreIncrement, |
950 kPostIncrement, | 955 kPostIncrement, |
951 kPreDecrement, | 956 kPreDecrement, |
952 kPostDecrement | 957 kPostDecrement |
953 }; | 958 }; |
954 | 959 |
955 LoopBuilder(HGraphBuilder* builder, | 960 LoopBuilder(HGraphBuilder* builder, |
956 HValue* context, | 961 HValue* context, |
957 Direction direction, | 962 Direction direction, |
958 BailoutId id = BailoutId::StubEntry()); | 963 BailoutId id = BailoutId::StubEntry()); |
959 ~LoopBuilder() { | 964 ~LoopBuilder() { |
960 ASSERT(finished_); | 965 ASSERT(finished_); |
961 } | 966 } |
962 | 967 |
963 HValue* BeginBody(HValue* initial, HValue* terminating, Token::Value token); | 968 HValue* BeginBody( |
| 969 HValue* initial, |
| 970 HValue* terminating, |
| 971 Token::Value token, |
| 972 Representation input_representation = Representation::Integer32()); |
964 void EndBody(); | 973 void EndBody(); |
965 | 974 |
966 private: | 975 private: |
967 HGraphBuilder* builder_; | 976 HGraphBuilder* builder_; |
968 HValue* context_; | 977 HValue* context_; |
969 HInstruction* increment_; | 978 HInstruction* increment_; |
970 HPhi* phi_; | 979 HPhi* phi_; |
971 HBasicBlock* header_block_; | 980 HBasicBlock* header_block_; |
972 HBasicBlock* body_block_; | 981 HBasicBlock* body_block_; |
973 HBasicBlock* exit_block_; | 982 HBasicBlock* exit_block_; |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1665 const char* filename_; | 1674 const char* filename_; |
1666 HeapStringAllocator string_allocator_; | 1675 HeapStringAllocator string_allocator_; |
1667 StringStream trace_; | 1676 StringStream trace_; |
1668 int indent_; | 1677 int indent_; |
1669 }; | 1678 }; |
1670 | 1679 |
1671 | 1680 |
1672 } } // namespace v8::internal | 1681 } } // namespace v8::internal |
1673 | 1682 |
1674 #endif // V8_HYDROGEN_H_ | 1683 #endif // V8_HYDROGEN_H_ |
OLD | NEW |