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_CHANGE_LOWERING_H_ | 5 #ifndef V8_COMPILER_CHANGE_LOWERING_H_ |
6 #define V8_COMPILER_CHANGE_LOWERING_H_ | 6 #define V8_COMPILER_CHANGE_LOWERING_H_ |
7 | 7 |
8 #include "src/compiler/graph-reducer.h" | 8 #include "src/compiler/graph-reducer.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 namespace compiler { | 12 namespace compiler { |
13 | 13 |
14 // Forward declarations. | 14 // Forward declarations. |
15 class CommonOperatorBuilder; | 15 class CommonOperatorBuilder; |
16 struct ElementAccess; | 16 struct ElementAccess; |
17 class JSGraph; | 17 class JSGraph; |
18 class Linkage; | 18 class Linkage; |
19 class MachineOperatorBuilder; | 19 class MachineOperatorBuilder; |
20 class Operator; | 20 class Operator; |
21 | 21 |
22 class ChangeLowering final : public Reducer { | 22 class ChangeLowering final : public Reducer { |
23 public: | 23 public: |
24 explicit ChangeLowering(JSGraph* jsgraph) : jsgraph_(jsgraph) {} | 24 explicit ChangeLowering(JSGraph* jsgraph) : jsgraph_(jsgraph) {} |
25 ~ChangeLowering() final; | 25 ~ChangeLowering() final; |
26 | 26 |
27 Reduction Reduce(Node* node) final; | 27 Reduction Reduce(Node* node) final; |
28 | 28 |
29 private: | 29 private: |
| 30 Node* HeapNumberValueIndexConstant(); |
30 Node* SmiShiftBitsConstant(); | 31 Node* SmiShiftBitsConstant(); |
31 | 32 |
| 33 Node* ChangeInt32ToFloat64(Node* value); |
32 Node* ChangeInt32ToSmi(Node* value); | 34 Node* ChangeInt32ToSmi(Node* value); |
| 35 Node* ChangeSmiToFloat64(Node* value); |
33 Node* ChangeSmiToWord32(Node* value); | 36 Node* ChangeSmiToWord32(Node* value); |
34 Node* ChangeUint32ToFloat64(Node* value); | 37 Node* ChangeUint32ToFloat64(Node* value); |
| 38 Node* ChangeUint32ToSmi(Node* value); |
| 39 Node* LoadHeapNumberValue(Node* value, Node* control); |
| 40 Node* TestNotSmi(Node* value); |
35 | 41 |
36 Reduction ReduceChangeBitToBool(Node* value, Node* control); | 42 Reduction ChangeBitToBool(Node* value, Node* control); |
37 Reduction ReduceChangeBoolToBit(Node* value); | 43 Reduction ChangeBoolToBit(Node* value); |
38 Reduction ReduceChangeInt31ToTagged(Node* value, Node* control); | 44 Reduction ChangeFloat64ToTagged(Node* value, Node* control); |
39 Reduction ReduceChangeTaggedSignedToInt32(Node* value); | 45 Reduction ChangeInt31ToTagged(Node* value, Node* control); |
| 46 Reduction ChangeInt32ToTagged(Node* value, Node* control); |
| 47 Reduction ChangeTaggedSignedToInt32(Node* value); |
| 48 Reduction ChangeUint32ToTagged(Node* value, Node* control); |
40 | 49 |
41 Reduction ReduceLoadField(Node* node); | 50 Reduction LoadField(Node* node); |
42 Reduction ReduceStoreField(Node* node); | 51 Reduction StoreField(Node* node); |
43 Reduction ReduceLoadElement(Node* node); | 52 Reduction LoadElement(Node* node); |
44 Reduction ReduceStoreElement(Node* node); | 53 Reduction StoreElement(Node* node); |
45 Reduction ReduceAllocate(Node* node); | 54 Reduction Allocate(Node* node); |
46 | 55 |
47 Reduction ReduceObjectIsSmi(Node* node); | 56 Node* IsSmi(Node* value); |
| 57 Node* LoadHeapObjectMap(Node* object, Node* control); |
| 58 Node* LoadMapBitField(Node* map); |
| 59 Node* LoadMapInstanceType(Node* map); |
| 60 |
| 61 Reduction ObjectIsSmi(Node* node); |
48 | 62 |
49 Node* ComputeIndex(const ElementAccess& access, Node* const key); | 63 Node* ComputeIndex(const ElementAccess& access, Node* const key); |
50 Graph* graph() const; | 64 Graph* graph() const; |
51 Isolate* isolate() const; | 65 Isolate* isolate() const; |
52 JSGraph* jsgraph() const { return jsgraph_; } | 66 JSGraph* jsgraph() const { return jsgraph_; } |
53 CommonOperatorBuilder* common() const; | 67 CommonOperatorBuilder* common() const; |
54 MachineOperatorBuilder* machine() const; | 68 MachineOperatorBuilder* machine() const; |
55 | 69 |
56 JSGraph* const jsgraph_; | 70 JSGraph* const jsgraph_; |
57 SetOncePointer<const Operator> allocate_heap_number_operator_; | 71 SetOncePointer<const Operator> allocate_heap_number_operator_; |
58 }; | 72 }; |
59 | 73 |
60 } // namespace compiler | 74 } // namespace compiler |
61 } // namespace internal | 75 } // namespace internal |
62 } // namespace v8 | 76 } // namespace v8 |
63 | 77 |
64 #endif // V8_COMPILER_CHANGE_LOWERING_H_ | 78 #endif // V8_COMPILER_CHANGE_LOWERING_H_ |
OLD | NEW |