OLD | NEW |
1 // Copyright 2011 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 lists_size_(0), | 1049 lists_size_(0), |
1050 count_(0), | 1050 count_(0), |
1051 present_flags_(0), | 1051 present_flags_(0), |
1052 array_(NULL), | 1052 array_(NULL), |
1053 lists_(NULL), | 1053 lists_(NULL), |
1054 free_list_head_(kNil) { | 1054 free_list_head_(kNil) { |
1055 ResizeLists(kInitialSize); | 1055 ResizeLists(kInitialSize); |
1056 Resize(kInitialSize); | 1056 Resize(kInitialSize); |
1057 } | 1057 } |
1058 | 1058 |
1059 void Kill(int flags); | 1059 void Kill(GVNFlagSet flags); |
1060 | 1060 |
1061 void Add(HValue* value) { | 1061 void Add(HValue* value) { |
1062 present_flags_ |= value->flags(); | 1062 present_flags_.Add(value->gvn_flags()); |
1063 Insert(value); | 1063 Insert(value); |
1064 } | 1064 } |
1065 | 1065 |
1066 HValue* Lookup(HValue* value) const; | 1066 HValue* Lookup(HValue* value) const; |
1067 | 1067 |
1068 HValueMap* Copy(Zone* zone) const { | 1068 HValueMap* Copy(Zone* zone) const { |
1069 return new(zone) HValueMap(zone, this); | 1069 return new(zone) HValueMap(zone, this); |
1070 } | 1070 } |
1071 | 1071 |
1072 bool IsEmpty() const { return count_ == 0; } | 1072 bool IsEmpty() const { return count_ == 0; } |
(...skipping 12 matching lines...) Expand all Loading... |
1085 HValueMap(Zone* zone, const HValueMap* other); | 1085 HValueMap(Zone* zone, const HValueMap* other); |
1086 | 1086 |
1087 void Resize(int new_size); | 1087 void Resize(int new_size); |
1088 void ResizeLists(int new_size); | 1088 void ResizeLists(int new_size); |
1089 void Insert(HValue* value); | 1089 void Insert(HValue* value); |
1090 uint32_t Bound(uint32_t value) const { return value & (array_size_ - 1); } | 1090 uint32_t Bound(uint32_t value) const { return value & (array_size_ - 1); } |
1091 | 1091 |
1092 int array_size_; | 1092 int array_size_; |
1093 int lists_size_; | 1093 int lists_size_; |
1094 int count_; // The number of values stored in the HValueMap. | 1094 int count_; // The number of values stored in the HValueMap. |
1095 int present_flags_; // All flags that are in any value in the HValueMap. | 1095 GVNFlagSet present_flags_; // All flags that are in any value in the |
| 1096 // HValueMap. |
1096 HValueMapListElement* array_; // Primary store - contains the first value | 1097 HValueMapListElement* array_; // Primary store - contains the first value |
1097 // with a given hash. Colliding elements are stored in linked lists. | 1098 // with a given hash. Colliding elements are stored in linked lists. |
1098 HValueMapListElement* lists_; // The linked lists containing hash collisions. | 1099 HValueMapListElement* lists_; // The linked lists containing hash collisions. |
1099 int free_list_head_; // Unused elements in lists_ are on the free list. | 1100 int free_list_head_; // Unused elements in lists_ are on the free list. |
1100 }; | 1101 }; |
1101 | 1102 |
1102 | 1103 |
1103 class HStatistics: public Malloced { | 1104 class HStatistics: public Malloced { |
1104 public: | 1105 public: |
1105 void Initialize(CompilationInfo* info); | 1106 void Initialize(CompilationInfo* info); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 const char* filename_; | 1252 const char* filename_; |
1252 HeapStringAllocator string_allocator_; | 1253 HeapStringAllocator string_allocator_; |
1253 StringStream trace_; | 1254 StringStream trace_; |
1254 int indent_; | 1255 int indent_; |
1255 }; | 1256 }; |
1256 | 1257 |
1257 | 1258 |
1258 } } // namespace v8::internal | 1259 } } // namespace v8::internal |
1259 | 1260 |
1260 #endif // V8_HYDROGEN_H_ | 1261 #endif // V8_HYDROGEN_H_ |
OLD | NEW |