OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_COMPILER_SIMPLIFIED_OPERATOR_H_ | 5 #ifndef V8_COMPILER_SIMPLIFIED_OPERATOR_H_ |
6 #define V8_COMPILER_SIMPLIFIED_OPERATOR_H_ | 6 #define V8_COMPILER_SIMPLIFIED_OPERATOR_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/compiler/operator.h" | 10 #include "src/compiler/operator.h" |
11 #include "src/compiler/types.h" | 11 #include "src/compiler/types.h" |
12 #include "src/handles.h" | 12 #include "src/handles.h" |
13 #include "src/machine-type.h" | 13 #include "src/machine-type.h" |
14 #include "src/objects.h" | 14 #include "src/objects.h" |
| 15 #include "src/zone/zone-handle-set.h" |
15 | 16 |
16 namespace v8 { | 17 namespace v8 { |
17 namespace internal { | 18 namespace internal { |
18 | 19 |
19 // Forward declarations. | 20 // Forward declarations. |
20 class Zone; | 21 class Zone; |
21 | 22 |
22 namespace compiler { | 23 namespace compiler { |
23 | 24 |
24 // Forward declarations. | 25 // Forward declarations. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 kCheckForMinusZero, | 134 kCheckForMinusZero, |
134 kDontCheckForMinusZero, | 135 kDontCheckForMinusZero, |
135 }; | 136 }; |
136 | 137 |
137 size_t hash_value(CheckForMinusZeroMode); | 138 size_t hash_value(CheckForMinusZeroMode); |
138 | 139 |
139 std::ostream& operator<<(std::ostream&, CheckForMinusZeroMode); | 140 std::ostream& operator<<(std::ostream&, CheckForMinusZeroMode); |
140 | 141 |
141 CheckForMinusZeroMode CheckMinusZeroModeOf(const Operator*) WARN_UNUSED_RESULT; | 142 CheckForMinusZeroMode CheckMinusZeroModeOf(const Operator*) WARN_UNUSED_RESULT; |
142 | 143 |
| 144 // A descriptor for map checks. |
| 145 class CheckMapsParameters final { |
| 146 public: |
| 147 explicit CheckMapsParameters(ZoneHandleSet<Map> const& maps) : maps_(maps) {} |
| 148 |
| 149 ZoneHandleSet<Map> const& maps() const { return maps_; } |
| 150 |
| 151 private: |
| 152 ZoneHandleSet<Map> const maps_; |
| 153 }; |
| 154 |
| 155 bool operator==(CheckMapsParameters const&, CheckMapsParameters const&); |
| 156 bool operator!=(CheckMapsParameters const&, CheckMapsParameters const&); |
| 157 |
| 158 size_t hash_value(CheckMapsParameters const&); |
| 159 |
| 160 std::ostream& operator<<(std::ostream&, CheckMapsParameters const&); |
| 161 |
| 162 CheckMapsParameters const& CheckMapsParametersOf(Operator const*) |
| 163 WARN_UNUSED_RESULT; |
| 164 |
143 // A descriptor for growing elements backing stores. | 165 // A descriptor for growing elements backing stores. |
144 enum class GrowFastElementsFlag : uint8_t { | 166 enum class GrowFastElementsFlag : uint8_t { |
145 kNone = 0u, | 167 kNone = 0u, |
146 kArrayObject = 1u << 0, // Update JSArray::length field. | 168 kArrayObject = 1u << 0, // Update JSArray::length field. |
147 kHoleyElements = 1u << 1, // Backing store is holey. | 169 kHoleyElements = 1u << 1, // Backing store is holey. |
148 kDoubleElements = 1u << 2, // Backing store contains doubles. | 170 kDoubleElements = 1u << 2, // Backing store contains doubles. |
149 }; | 171 }; |
150 typedef base::Flags<GrowFastElementsFlag> GrowFastElementsFlags; | 172 typedef base::Flags<GrowFastElementsFlag> GrowFastElementsFlags; |
151 | 173 |
152 DEFINE_OPERATORS_FOR_FLAGS(GrowFastElementsFlags) | 174 DEFINE_OPERATORS_FOR_FLAGS(GrowFastElementsFlags) |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 const Operator* ChangeUint32ToTagged(); | 325 const Operator* ChangeUint32ToTagged(); |
304 const Operator* ChangeFloat64ToTagged(); | 326 const Operator* ChangeFloat64ToTagged(); |
305 const Operator* ChangeTaggedToBit(); | 327 const Operator* ChangeTaggedToBit(); |
306 const Operator* ChangeBitToTagged(); | 328 const Operator* ChangeBitToTagged(); |
307 const Operator* TruncateTaggedToWord32(); | 329 const Operator* TruncateTaggedToWord32(); |
308 const Operator* TruncateTaggedToFloat64(); | 330 const Operator* TruncateTaggedToFloat64(); |
309 const Operator* TruncateTaggedToBit(); | 331 const Operator* TruncateTaggedToBit(); |
310 | 332 |
311 const Operator* CheckIf(); | 333 const Operator* CheckIf(); |
312 const Operator* CheckBounds(); | 334 const Operator* CheckBounds(); |
313 const Operator* CheckMaps(int map_input_count); | 335 const Operator* CheckMaps(ZoneHandleSet<Map>); |
314 | 336 |
315 const Operator* CheckHeapObject(); | 337 const Operator* CheckHeapObject(); |
316 const Operator* CheckNumber(); | 338 const Operator* CheckNumber(); |
317 const Operator* CheckSmi(); | 339 const Operator* CheckSmi(); |
318 const Operator* CheckString(); | 340 const Operator* CheckString(); |
319 | 341 |
320 const Operator* CheckedInt32Add(); | 342 const Operator* CheckedInt32Add(); |
321 const Operator* CheckedInt32Sub(); | 343 const Operator* CheckedInt32Sub(); |
322 const Operator* CheckedInt32Div(); | 344 const Operator* CheckedInt32Div(); |
323 const Operator* CheckedInt32Mod(); | 345 const Operator* CheckedInt32Mod(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 Zone* const zone_; | 409 Zone* const zone_; |
388 | 410 |
389 DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorBuilder); | 411 DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorBuilder); |
390 }; | 412 }; |
391 | 413 |
392 } // namespace compiler | 414 } // namespace compiler |
393 } // namespace internal | 415 } // namespace internal |
394 } // namespace v8 | 416 } // namespace v8 |
395 | 417 |
396 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ | 418 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ |
OLD | NEW |