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" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 kCheckForMinusZero, | 135 kCheckForMinusZero, |
136 kDontCheckForMinusZero, | 136 kDontCheckForMinusZero, |
137 }; | 137 }; |
138 | 138 |
139 size_t hash_value(CheckForMinusZeroMode); | 139 size_t hash_value(CheckForMinusZeroMode); |
140 | 140 |
141 std::ostream& operator<<(std::ostream&, CheckForMinusZeroMode); | 141 std::ostream& operator<<(std::ostream&, CheckForMinusZeroMode); |
142 | 142 |
143 CheckForMinusZeroMode CheckMinusZeroModeOf(const Operator*) WARN_UNUSED_RESULT; | 143 CheckForMinusZeroMode CheckMinusZeroModeOf(const Operator*) WARN_UNUSED_RESULT; |
144 | 144 |
| 145 // A descriptor for growing elements backing stores. |
| 146 enum class GrowFastElementsFlag : uint8_t { |
| 147 kNone = 0u, |
| 148 kArrayObject = 1u << 0, // Update JSArray::length field. |
| 149 kHoleyElements = 1u << 1, // Backing store is holey. |
| 150 kDoubleElements = 1u << 2, // Backing store contains doubles. |
| 151 }; |
| 152 typedef base::Flags<GrowFastElementsFlag> GrowFastElementsFlags; |
| 153 |
| 154 DEFINE_OPERATORS_FOR_FLAGS(GrowFastElementsFlags) |
| 155 |
| 156 std::ostream& operator<<(std::ostream&, GrowFastElementsFlags); |
| 157 |
| 158 GrowFastElementsFlags GrowFastElementsFlagsOf(const Operator*) |
| 159 WARN_UNUSED_RESULT; |
| 160 |
145 // A descriptor for elements kind transitions. | 161 // A descriptor for elements kind transitions. |
146 enum class ElementsTransition : uint8_t { | 162 enum class ElementsTransition : uint8_t { |
147 kFastTransition, // simple transition, just updating the map. | 163 kFastTransition, // simple transition, just updating the map. |
148 kSlowTransition // full transition, round-trip to the runtime. | 164 kSlowTransition // full transition, round-trip to the runtime. |
149 }; | 165 }; |
150 | 166 |
151 size_t hash_value(ElementsTransition); | 167 size_t hash_value(ElementsTransition); |
152 | 168 |
153 std::ostream& operator<<(std::ostream&, ElementsTransition); | 169 std::ostream& operator<<(std::ostream&, ElementsTransition); |
154 | 170 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 const Operator* ObjectIsCallable(); | 325 const Operator* ObjectIsCallable(); |
310 const Operator* ObjectIsNumber(); | 326 const Operator* ObjectIsNumber(); |
311 const Operator* ObjectIsReceiver(); | 327 const Operator* ObjectIsReceiver(); |
312 const Operator* ObjectIsSmi(); | 328 const Operator* ObjectIsSmi(); |
313 const Operator* ObjectIsString(); | 329 const Operator* ObjectIsString(); |
314 const Operator* ObjectIsUndetectable(); | 330 const Operator* ObjectIsUndetectable(); |
315 | 331 |
316 // ensure-writable-fast-elements object, elements | 332 // ensure-writable-fast-elements object, elements |
317 const Operator* EnsureWritableFastElements(); | 333 const Operator* EnsureWritableFastElements(); |
318 | 334 |
| 335 // maybe-grow-fast-elements object, elements, index, length |
| 336 const Operator* MaybeGrowFastElements(GrowFastElementsFlags flags); |
| 337 |
319 // transition-elements-kind object, from-map, to-map | 338 // transition-elements-kind object, from-map, to-map |
320 const Operator* TransitionElementsKind(ElementsTransition transition); | 339 const Operator* TransitionElementsKind(ElementsTransition transition); |
321 | 340 |
322 const Operator* Allocate(PretenureFlag pretenure = NOT_TENURED); | 341 const Operator* Allocate(PretenureFlag pretenure = NOT_TENURED); |
323 | 342 |
324 const Operator* LoadField(FieldAccess const&); | 343 const Operator* LoadField(FieldAccess const&); |
325 const Operator* StoreField(FieldAccess const&); | 344 const Operator* StoreField(FieldAccess const&); |
326 | 345 |
327 // load-buffer buffer, offset, length | 346 // load-buffer buffer, offset, length |
328 const Operator* LoadBuffer(BufferAccess); | 347 const Operator* LoadBuffer(BufferAccess); |
(...skipping 20 matching lines...) Expand all Loading... |
349 Zone* const zone_; | 368 Zone* const zone_; |
350 | 369 |
351 DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorBuilder); | 370 DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorBuilder); |
352 }; | 371 }; |
353 | 372 |
354 } // namespace compiler | 373 } // namespace compiler |
355 } // namespace internal | 374 } // namespace internal |
356 } // namespace v8 | 375 } // namespace v8 |
357 | 376 |
358 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ | 377 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ |
OLD | NEW |