Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Side by Side Diff: src/hydrogen.h

Issue 12221064: Implement many KeyedStoreStubs using Crankshaft (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | src/hydrogen.cc » ('j') | src/hydrogen.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 int next_block_id_; 412 int next_block_id_;
413 HBasicBlock* entry_block_; 413 HBasicBlock* entry_block_;
414 HEnvironment* start_environment_; 414 HEnvironment* start_environment_;
415 ZoneList<HBasicBlock*> blocks_; 415 ZoneList<HBasicBlock*> blocks_;
416 ZoneList<HValue*> values_; 416 ZoneList<HValue*> values_;
417 ZoneList<HPhi*>* phi_list_; 417 ZoneList<HPhi*>* phi_list_;
418 ZoneList<HInstruction*>* uint32_instructions_; 418 ZoneList<HInstruction*>* uint32_instructions_;
419 SetOncePointer<HConstant> undefined_constant_; 419 SetOncePointer<HConstant> undefined_constant_;
420 SetOncePointer<HConstant> constant_0_; 420 SetOncePointer<HConstant> constant_0_;
421 SetOncePointer<HConstant> constant_1_; 421 SetOncePointer<HConstant> constant_1_;
422 SetOncePointer<HConstant> constant_2_;
422 SetOncePointer<HConstant> constant_minus1_; 423 SetOncePointer<HConstant> constant_minus1_;
423 SetOncePointer<HConstant> constant_true_; 424 SetOncePointer<HConstant> constant_true_;
424 SetOncePointer<HConstant> constant_false_; 425 SetOncePointer<HConstant> constant_false_;
425 SetOncePointer<HConstant> constant_hole_; 426 SetOncePointer<HConstant> constant_hole_;
426 SetOncePointer<HArgumentsObject> arguments_object_; 427 SetOncePointer<HArgumentsObject> arguments_object_;
427 428
428 SetOncePointer<HBasicBlock> osr_loop_entry_; 429 SetOncePointer<HBasicBlock> osr_loop_entry_;
429 SetOncePointer<ZoneList<HUnknownOSRValue*> > osr_values_; 430 SetOncePointer<ZoneList<HUnknownOSRValue*> > osr_values_;
430 431
431 CompilationInfo* info_; 432 CompilationInfo* info_;
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 HValue* dependency, 901 HValue* dependency,
901 ElementsKind elements_kind, 902 ElementsKind elements_kind,
902 bool is_store); 903 bool is_store);
903 904
904 HInstruction* BuildFastElementAccess( 905 HInstruction* BuildFastElementAccess(
905 HValue* elements, 906 HValue* elements,
906 HValue* checked_key, 907 HValue* checked_key,
907 HValue* val, 908 HValue* val,
908 HValue* dependency, 909 HValue* dependency,
909 ElementsKind elements_kind, 910 ElementsKind elements_kind,
910 bool is_store); 911 bool is_store,
912 KeyedAccessStoreMode store_mode);
913
914 HValue* BuildCheckForCapacityGrow(HValue* object,
915 HValue* elements,
916 ElementsKind kind,
917 HValue* length,
918 HValue* key,
919 bool is_js_array);
920
921 HValue* BuildCopyElementsOnWrite(HValue* object,
922 HValue* elements,
923 ElementsKind kind,
924 HValue* length);
911 925
912 HInstruction* BuildUncheckedMonomorphicElementAccess( 926 HInstruction* BuildUncheckedMonomorphicElementAccess(
913 HValue* object, 927 HValue* object,
914 HValue* key, 928 HValue* key,
915 HValue* val, 929 HValue* val,
916 HCheckMaps* mapcheck, 930 HCheckMaps* mapcheck,
917 bool is_js_array, 931 bool is_js_array,
918 ElementsKind elements_kind, 932 ElementsKind elements_kind,
919 bool is_store, 933 bool is_store,
934 KeyedAccessStoreMode store_mode,
920 Representation checked_index_representation = Representation::None()); 935 Representation checked_index_representation = Representation::None());
921 936
922 HInstruction* BuildStoreMap(HValue* object, HValue* map, BailoutId id); 937 HInstruction* BuildStoreMap(HValue* object, HValue* map, BailoutId id);
923 HInstruction* BuildStoreMap(HValue* object, Handle<Map> map, BailoutId id); 938 HInstruction* BuildStoreMap(HValue* object, Handle<Map> map, BailoutId id);
924 939
925 class CheckBuilder { 940 class CheckBuilder {
926 public: 941 public:
927 CheckBuilder(HGraphBuilder* builder, BailoutId id); 942 CheckBuilder(HGraphBuilder* builder, BailoutId id);
928 ~CheckBuilder() { 943 ~CheckBuilder() {
929 if (!finished_) End(); 944 if (!finished_) End();
930 } 945 }
931 946
932 void CheckNotUndefined(HValue* value); 947 HValue* CheckNotUndefined(HValue* value);
933 void CheckIntegerEq(HValue* left, HValue* right); 948 HValue* CheckIntegerCompare(HValue* left, HValue* right, Token::Value op);
949 HValue* CheckIntegerEq(HValue* left, HValue* right);
934 void End(); 950 void End();
935 951
936 private: 952 private:
937 Zone* zone() { return builder_->zone(); } 953 Zone* zone() { return builder_->zone(); }
938 954
939 HGraphBuilder* builder_; 955 HGraphBuilder* builder_;
940 bool finished_; 956 bool finished_;
941 HBasicBlock* failure_block_; 957 HBasicBlock* failure_block_;
942 HBasicBlock* merge_block_; 958 HBasicBlock* merge_block_;
943 BailoutId id_; 959 BailoutId id_;
944 }; 960 };
945 961
946 class IfBuilder { 962 class IfBuilder {
947 public: 963 public:
948 IfBuilder(HGraphBuilder* builder, BailoutId id); 964 IfBuilder(HGraphBuilder* builder, BailoutId id);
949 ~IfBuilder() { 965 ~IfBuilder() {
950 if (!finished_) End(); 966 if (!finished_) End();
951 } 967 }
952 968
953 HInstruction* BeginTrue( 969 HInstruction* BeginIf(
954 HValue* left, 970 HValue* left,
955 HValue* right, 971 HValue* right,
956 Token::Value token, 972 Token::Value token,
957 Representation input_representation = Representation::Integer32()); 973 Representation input_representation = Representation::Integer32());
958 void BeginFalse(); 974 HInstruction* BeginIfObjectsEqual(HValue* left, HValue* right);
975 HInstruction* BeginIfMapsEqual(HValue* value, Handle<Map> map);
Jakob Kummerow 2013/03/14 15:00:20 nit: "BeginIfMapEquals" would be a bit more accura
danno 2013/03/20 10:04:34 Done.
976 void BeginElse();
959 void End(); 977 void End();
960 978
961 private: 979 private:
962 Zone* zone() { return builder_->zone(); } 980 Zone* zone() { return builder_->zone(); }
963 981
964 HGraphBuilder* builder_; 982 HGraphBuilder* builder_;
965 bool finished_; 983 bool finished_;
984 bool did_else_;
966 HBasicBlock* first_true_block_; 985 HBasicBlock* first_true_block_;
967 HBasicBlock* last_true_block_; 986 HBasicBlock* last_true_block_;
968 HBasicBlock* first_false_block_; 987 HBasicBlock* first_false_block_;
969 HBasicBlock* merge_block_; 988 HBasicBlock* merge_block_;
970 BailoutId id_; 989 BailoutId id_;
971 }; 990 };
972 991
973 class LoopBuilder { 992 class LoopBuilder {
974 public: 993 public:
975 enum Direction { 994 enum Direction {
(...skipping 26 matching lines...) Expand all
1002 HInstruction* increment_; 1021 HInstruction* increment_;
1003 HPhi* phi_; 1022 HPhi* phi_;
1004 HBasicBlock* header_block_; 1023 HBasicBlock* header_block_;
1005 HBasicBlock* body_block_; 1024 HBasicBlock* body_block_;
1006 HBasicBlock* exit_block_; 1025 HBasicBlock* exit_block_;
1007 Direction direction_; 1026 Direction direction_;
1008 BailoutId id_; 1027 BailoutId id_;
1009 bool finished_; 1028 bool finished_;
1010 }; 1029 };
1011 1030
1012 HValue* BuildAllocateElements(HContext* context, 1031 HValue* BuildNewElementsCapacity(HValue* context,
1032 HValue* old_capacity);
1033
1034 void BuildNewSpaceArrayCheck(HValue* length,
1035 ElementsKind kind);
1036
1037 HValue* BuildAllocateElements(HValue* context,
1013 ElementsKind kind, 1038 ElementsKind kind,
1014 HValue* capacity); 1039 HValue* capacity,
1040 BailoutId ast_id);
1015 1041
1016 void BuildCopyElements(HContext* context, 1042 HValue* BuildGrowElementsCapacity(HValue* object,
1043 HValue* elements,
1044 ElementsKind kind,
1045 HValue* length,
1046 HValue* new_capacity,
1047 BailoutId ast_id);
1048
1049 void BuildFillElementsWithHole(HValue* context,
1050 HValue* elements,
1051 ElementsKind elements_kind,
1052 HValue* from,
1053 HValue* to,
1054 BailoutId ast_id);
1055
1056 void BuildCopyElements(HValue* context,
1017 HValue* from_elements, 1057 HValue* from_elements,
1018 ElementsKind from_elements_kind, 1058 ElementsKind from_elements_kind,
1019 HValue* to_elements, 1059 HValue* to_elements,
1020 ElementsKind to_elements_kind, 1060 ElementsKind to_elements_kind,
1021 HValue* length); 1061 HValue* length,
1062 HValue* capacity,
1063 BailoutId ast_id);
1022 1064
1023 private: 1065 private:
1024 HGraphBuilder(); 1066 HGraphBuilder();
1025 CompilationInfo* info_; 1067 CompilationInfo* info_;
1026 HGraph* graph_; 1068 HGraph* graph_;
1027 HBasicBlock* current_block_; 1069 HBasicBlock* current_block_;
1028 }; 1070 };
1029 1071
1030 1072
1031 class HOptimizedGraphBuilder: public HGraphBuilder, public AstVisitor { 1073 class HOptimizedGraphBuilder: public HGraphBuilder, public AstVisitor {
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 HInstruction* TryBuildConsolidatedElementLoad(HValue* object, 1381 HInstruction* TryBuildConsolidatedElementLoad(HValue* object,
1340 HValue* key, 1382 HValue* key,
1341 HValue* val, 1383 HValue* val,
1342 SmallMapList* maps); 1384 SmallMapList* maps);
1343 1385
1344 HInstruction* BuildMonomorphicElementAccess(HValue* object, 1386 HInstruction* BuildMonomorphicElementAccess(HValue* object,
1345 HValue* key, 1387 HValue* key,
1346 HValue* val, 1388 HValue* val,
1347 HValue* dependency, 1389 HValue* dependency,
1348 Handle<Map> map, 1390 Handle<Map> map,
1349 bool is_store); 1391 bool is_store,
1392 KeyedAccessStoreMode store_mode);
1350 1393
1351 HValue* HandlePolymorphicElementAccess(HValue* object, 1394 HValue* HandlePolymorphicElementAccess(HValue* object,
1352 HValue* key, 1395 HValue* key,
1353 HValue* val, 1396 HValue* val,
1354 Expression* prop, 1397 Expression* prop,
1355 BailoutId ast_id, 1398 BailoutId ast_id,
1356 int position, 1399 int position,
1357 bool is_store, 1400 bool is_store,
1401 KeyedAccessStoreMode store_mode,
1358 bool* has_side_effects); 1402 bool* has_side_effects);
1359 1403
1360 HValue* HandleKeyedElementAccess(HValue* obj, 1404 HValue* HandleKeyedElementAccess(HValue* obj,
1361 HValue* key, 1405 HValue* key,
1362 HValue* val, 1406 HValue* val,
1363 Expression* expr, 1407 Expression* expr,
1364 BailoutId ast_id, 1408 BailoutId ast_id,
1365 int position, 1409 int position,
1366 bool is_store, 1410 bool is_store,
1367 bool* has_side_effects); 1411 bool* has_side_effects);
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 EmbeddedVector<char, 64> filename_; 1721 EmbeddedVector<char, 64> filename_;
1678 HeapStringAllocator string_allocator_; 1722 HeapStringAllocator string_allocator_;
1679 StringStream trace_; 1723 StringStream trace_;
1680 int indent_; 1724 int indent_;
1681 }; 1725 };
1682 1726
1683 1727
1684 } } // namespace v8::internal 1728 } } // namespace v8::internal
1685 1729
1686 #endif // V8_HYDROGEN_H_ 1730 #endif // V8_HYDROGEN_H_
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/hydrogen.cc » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698