| 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 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 HValue* dependency, | 902 HValue* dependency, |
| 903 ElementsKind elements_kind, | 903 ElementsKind elements_kind, |
| 904 bool is_store); | 904 bool is_store); |
| 905 | 905 |
| 906 HInstruction* BuildFastElementAccess( | 906 HInstruction* BuildFastElementAccess( |
| 907 HValue* elements, | 907 HValue* elements, |
| 908 HValue* checked_key, | 908 HValue* checked_key, |
| 909 HValue* val, | 909 HValue* val, |
| 910 HValue* dependency, | 910 HValue* dependency, |
| 911 ElementsKind elements_kind, | 911 ElementsKind elements_kind, |
| 912 bool is_store); | 912 bool is_store, |
| 913 KeyedAccessStoreMode store_mode); |
| 914 |
| 915 HValue* BuildCheckForCapacityGrow(HValue* object, |
| 916 HValue* elements, |
| 917 ElementsKind kind, |
| 918 HValue* length, |
| 919 HValue* key, |
| 920 bool is_js_array); |
| 921 |
| 922 HValue* BuildCopyElementsOnWrite(HValue* object, |
| 923 HValue* elements, |
| 924 ElementsKind kind, |
| 925 HValue* length); |
| 913 | 926 |
| 914 HInstruction* BuildUncheckedMonomorphicElementAccess( | 927 HInstruction* BuildUncheckedMonomorphicElementAccess( |
| 915 HValue* object, | 928 HValue* object, |
| 916 HValue* key, | 929 HValue* key, |
| 917 HValue* val, | 930 HValue* val, |
| 918 HCheckMaps* mapcheck, | 931 HCheckMaps* mapcheck, |
| 919 bool is_js_array, | 932 bool is_js_array, |
| 920 ElementsKind elements_kind, | 933 ElementsKind elements_kind, |
| 921 bool is_store, | 934 bool is_store, |
| 935 KeyedAccessStoreMode store_mode, |
| 922 Representation checked_index_representation = Representation::None()); | 936 Representation checked_index_representation = Representation::None()); |
| 923 | 937 |
| 924 HInstruction* BuildStoreMap(HValue* object, HValue* map, BailoutId id); | 938 HInstruction* BuildStoreMap(HValue* object, HValue* map, BailoutId id); |
| 925 HInstruction* BuildStoreMap(HValue* object, Handle<Map> map, BailoutId id); | 939 HInstruction* BuildStoreMap(HValue* object, Handle<Map> map, BailoutId id); |
| 926 | 940 |
| 927 class CheckBuilder { | 941 class CheckBuilder { |
| 928 public: | 942 public: |
| 929 CheckBuilder(HGraphBuilder* builder, BailoutId id); | 943 CheckBuilder(HGraphBuilder* builder, BailoutId id); |
| 930 ~CheckBuilder() { | 944 ~CheckBuilder() { |
| 931 if (!finished_) End(); | 945 if (!finished_) End(); |
| 932 } | 946 } |
| 933 | 947 |
| 934 void CheckNotUndefined(HValue* value); | 948 HValue* CheckNotUndefined(HValue* value); |
| 935 void CheckIntegerEq(HValue* left, HValue* right); | 949 HValue* CheckIntegerCompare(HValue* left, HValue* right, Token::Value op); |
| 950 HValue* CheckIntegerEq(HValue* left, HValue* right); |
| 936 void End(); | 951 void End(); |
| 937 | 952 |
| 938 private: | 953 private: |
| 939 Zone* zone() { return builder_->zone(); } | 954 Zone* zone() { return builder_->zone(); } |
| 940 | 955 |
| 941 HGraphBuilder* builder_; | 956 HGraphBuilder* builder_; |
| 942 bool finished_; | 957 bool finished_; |
| 943 HBasicBlock* failure_block_; | 958 HBasicBlock* failure_block_; |
| 944 HBasicBlock* merge_block_; | 959 HBasicBlock* merge_block_; |
| 945 BailoutId id_; | 960 BailoutId id_; |
| 946 }; | 961 }; |
| 947 | 962 |
| 948 class IfBuilder { | 963 class IfBuilder { |
| 949 public: | 964 public: |
| 950 IfBuilder(HGraphBuilder* builder, BailoutId id); | 965 IfBuilder(HGraphBuilder* builder, BailoutId id); |
| 951 ~IfBuilder() { | 966 ~IfBuilder() { |
| 952 if (!finished_) End(); | 967 if (!finished_) End(); |
| 953 } | 968 } |
| 954 | 969 |
| 955 HInstruction* BeginTrue( | 970 HInstruction* BeginIf( |
| 956 HValue* left, | 971 HValue* left, |
| 957 HValue* right, | 972 HValue* right, |
| 958 Token::Value token, | 973 Token::Value token, |
| 959 Representation input_representation = Representation::Integer32()); | 974 Representation input_representation = Representation::Integer32()); |
| 960 void BeginFalse(); | 975 HInstruction* BeginIfObjectsEqual(HValue* left, HValue* right); |
| 976 HInstruction* BeginIfMapEquals(HValue* value, Handle<Map> map); |
| 977 void BeginElse(); |
| 961 void End(); | 978 void End(); |
| 962 | 979 |
| 963 private: | 980 private: |
| 964 Zone* zone() { return builder_->zone(); } | 981 Zone* zone() { return builder_->zone(); } |
| 965 | 982 |
| 966 HGraphBuilder* builder_; | 983 HGraphBuilder* builder_; |
| 967 bool finished_; | 984 bool finished_; |
| 985 bool did_else_; |
| 968 HBasicBlock* first_true_block_; | 986 HBasicBlock* first_true_block_; |
| 969 HBasicBlock* last_true_block_; | 987 HBasicBlock* last_true_block_; |
| 970 HBasicBlock* first_false_block_; | 988 HBasicBlock* first_false_block_; |
| 971 HBasicBlock* merge_block_; | 989 HBasicBlock* merge_block_; |
| 972 BailoutId id_; | 990 BailoutId id_; |
| 973 }; | 991 }; |
| 974 | 992 |
| 975 class LoopBuilder { | 993 class LoopBuilder { |
| 976 public: | 994 public: |
| 977 enum Direction { | 995 enum Direction { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1004 HInstruction* increment_; | 1022 HInstruction* increment_; |
| 1005 HPhi* phi_; | 1023 HPhi* phi_; |
| 1006 HBasicBlock* header_block_; | 1024 HBasicBlock* header_block_; |
| 1007 HBasicBlock* body_block_; | 1025 HBasicBlock* body_block_; |
| 1008 HBasicBlock* exit_block_; | 1026 HBasicBlock* exit_block_; |
| 1009 Direction direction_; | 1027 Direction direction_; |
| 1010 BailoutId id_; | 1028 BailoutId id_; |
| 1011 bool finished_; | 1029 bool finished_; |
| 1012 }; | 1030 }; |
| 1013 | 1031 |
| 1014 HValue* BuildAllocateElements(HContext* context, | 1032 HValue* BuildNewElementsCapacity(HValue* context, |
| 1033 HValue* old_capacity); |
| 1034 |
| 1035 void BuildNewSpaceArrayCheck(HValue* length, |
| 1036 ElementsKind kind); |
| 1037 |
| 1038 HValue* BuildAllocateElements(HValue* context, |
| 1015 ElementsKind kind, | 1039 ElementsKind kind, |
| 1016 HValue* capacity); | 1040 HValue* capacity, |
| 1041 BailoutId ast_id); |
| 1017 | 1042 |
| 1018 void BuildCopyElements(HContext* context, | 1043 HValue* BuildGrowElementsCapacity(HValue* object, |
| 1044 HValue* elements, |
| 1045 ElementsKind kind, |
| 1046 HValue* length, |
| 1047 HValue* new_capacity, |
| 1048 BailoutId ast_id); |
| 1049 |
| 1050 void BuildFillElementsWithHole(HValue* context, |
| 1051 HValue* elements, |
| 1052 ElementsKind elements_kind, |
| 1053 HValue* from, |
| 1054 HValue* to, |
| 1055 BailoutId ast_id); |
| 1056 |
| 1057 void BuildCopyElements(HValue* context, |
| 1019 HValue* from_elements, | 1058 HValue* from_elements, |
| 1020 ElementsKind from_elements_kind, | 1059 ElementsKind from_elements_kind, |
| 1021 HValue* to_elements, | 1060 HValue* to_elements, |
| 1022 ElementsKind to_elements_kind, | 1061 ElementsKind to_elements_kind, |
| 1023 HValue* length); | 1062 HValue* length, |
| 1063 HValue* capacity, |
| 1064 BailoutId ast_id); |
| 1024 | 1065 |
| 1025 private: | 1066 private: |
| 1026 HGraphBuilder(); | 1067 HGraphBuilder(); |
| 1027 CompilationInfo* info_; | 1068 CompilationInfo* info_; |
| 1028 HGraph* graph_; | 1069 HGraph* graph_; |
| 1029 HBasicBlock* current_block_; | 1070 HBasicBlock* current_block_; |
| 1030 }; | 1071 }; |
| 1031 | 1072 |
| 1032 | 1073 |
| 1033 class HOptimizedGraphBuilder: public HGraphBuilder, public AstVisitor { | 1074 class HOptimizedGraphBuilder: public HGraphBuilder, public AstVisitor { |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1341 HInstruction* TryBuildConsolidatedElementLoad(HValue* object, | 1382 HInstruction* TryBuildConsolidatedElementLoad(HValue* object, |
| 1342 HValue* key, | 1383 HValue* key, |
| 1343 HValue* val, | 1384 HValue* val, |
| 1344 SmallMapList* maps); | 1385 SmallMapList* maps); |
| 1345 | 1386 |
| 1346 HInstruction* BuildMonomorphicElementAccess(HValue* object, | 1387 HInstruction* BuildMonomorphicElementAccess(HValue* object, |
| 1347 HValue* key, | 1388 HValue* key, |
| 1348 HValue* val, | 1389 HValue* val, |
| 1349 HValue* dependency, | 1390 HValue* dependency, |
| 1350 Handle<Map> map, | 1391 Handle<Map> map, |
| 1351 bool is_store); | 1392 bool is_store, |
| 1393 KeyedAccessStoreMode store_mode); |
| 1352 | 1394 |
| 1353 HValue* HandlePolymorphicElementAccess(HValue* object, | 1395 HValue* HandlePolymorphicElementAccess(HValue* object, |
| 1354 HValue* key, | 1396 HValue* key, |
| 1355 HValue* val, | 1397 HValue* val, |
| 1356 Expression* prop, | 1398 Expression* prop, |
| 1357 BailoutId ast_id, | 1399 BailoutId ast_id, |
| 1358 int position, | 1400 int position, |
| 1359 bool is_store, | 1401 bool is_store, |
| 1402 KeyedAccessStoreMode store_mode, |
| 1360 bool* has_side_effects); | 1403 bool* has_side_effects); |
| 1361 | 1404 |
| 1362 HValue* HandleKeyedElementAccess(HValue* obj, | 1405 HValue* HandleKeyedElementAccess(HValue* obj, |
| 1363 HValue* key, | 1406 HValue* key, |
| 1364 HValue* val, | 1407 HValue* val, |
| 1365 Expression* expr, | 1408 Expression* expr, |
| 1366 BailoutId ast_id, | 1409 BailoutId ast_id, |
| 1367 int position, | 1410 int position, |
| 1368 bool is_store, | 1411 bool is_store, |
| 1369 bool* has_side_effects); | 1412 bool* has_side_effects); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1679 EmbeddedVector<char, 64> filename_; | 1722 EmbeddedVector<char, 64> filename_; |
| 1680 HeapStringAllocator string_allocator_; | 1723 HeapStringAllocator string_allocator_; |
| 1681 StringStream trace_; | 1724 StringStream trace_; |
| 1682 int indent_; | 1725 int indent_; |
| 1683 }; | 1726 }; |
| 1684 | 1727 |
| 1685 | 1728 |
| 1686 } } // namespace v8::internal | 1729 } } // namespace v8::internal |
| 1687 | 1730 |
| 1688 #endif // V8_HYDROGEN_H_ | 1731 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |