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 #include "src/compiler/js-graph.h" | 5 #include "src/compiler/js-graph.h" |
6 #include "src/compiler/js-typed-lowering.h" | 6 #include "src/compiler/js-typed-lowering.h" |
7 #include "src/compiler/machine-operator.h" | 7 #include "src/compiler/machine-operator.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 #include "src/compiler/opcodes.h" | 9 #include "src/compiler/opcodes.h" |
10 #include "src/compiler/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 Typer typer; | 56 Typer typer; |
57 Node* context_node; | 57 Node* context_node; |
58 | 58 |
59 Node* Parameter(Type* t, int32_t index = 0) { | 59 Node* Parameter(Type* t, int32_t index = 0) { |
60 Node* n = graph.NewNode(common.Parameter(index), graph.start()); | 60 Node* n = graph.NewNode(common.Parameter(index), graph.start()); |
61 NodeProperties::SetBounds(n, Bounds(Type::None(), t)); | 61 NodeProperties::SetBounds(n, Bounds(Type::None(), t)); |
62 return n; | 62 return n; |
63 } | 63 } |
64 | 64 |
65 Node* UndefinedConstant() { | 65 Node* UndefinedConstant() { |
66 Unique<HeapObject> unique = Unique<HeapObject>::CreateImmovable( | 66 Handle<HeapObject> value = isolate->factory()->undefined_value(); |
67 isolate->factory()->undefined_value()); | 67 return graph.NewNode(common.HeapConstant(value)); |
68 return graph.NewNode(common.HeapConstant(unique)); | |
69 } | 68 } |
70 | 69 |
71 Node* HeapConstant(Handle<HeapObject> constant) { | 70 Node* HeapConstant(Handle<HeapObject> constant) { |
72 Unique<HeapObject> unique = | 71 return graph.NewNode(common.HeapConstant(constant)); |
73 Unique<HeapObject>::CreateUninitialized(constant); | |
74 return graph.NewNode(common.HeapConstant(unique)); | |
75 } | 72 } |
76 | 73 |
77 Node* EmptyFrameState(Node* context) { | 74 Node* EmptyFrameState(Node* context) { |
78 Node* parameters = graph.NewNode(common.StateValues(0)); | 75 Node* parameters = graph.NewNode(common.StateValues(0)); |
79 Node* locals = graph.NewNode(common.StateValues(0)); | 76 Node* locals = graph.NewNode(common.StateValues(0)); |
80 Node* stack = graph.NewNode(common.StateValues(0)); | 77 Node* stack = graph.NewNode(common.StateValues(0)); |
81 | 78 |
82 Node* state_node = graph.NewNode( | 79 Node* state_node = graph.NewNode( |
83 common.FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(), | 80 common.FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(), |
84 nullptr), | 81 nullptr), |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 } | 183 } |
187 | 184 |
188 void CheckTrue(Node* result) { | 185 void CheckTrue(Node* result) { |
189 CheckHandle(isolate->factory()->true_value(), result); | 186 CheckHandle(isolate->factory()->true_value(), result); |
190 } | 187 } |
191 | 188 |
192 void CheckFalse(Node* result) { | 189 void CheckFalse(Node* result) { |
193 CheckHandle(isolate->factory()->false_value(), result); | 190 CheckHandle(isolate->factory()->false_value(), result); |
194 } | 191 } |
195 | 192 |
196 void CheckHandle(Handle<Object> expected, Node* result) { | 193 void CheckHandle(Handle<HeapObject> expected, Node* result) { |
197 CHECK_EQ(IrOpcode::kHeapConstant, result->opcode()); | 194 CHECK_EQ(IrOpcode::kHeapConstant, result->opcode()); |
198 Handle<Object> value = OpParameter<Unique<Object> >(result).handle(); | 195 Handle<HeapObject> value = OpParameter<Handle<HeapObject>>(result); |
199 CHECK_EQ(*expected, *value); | 196 CHECK_EQ(*expected, *value); |
200 } | 197 } |
201 }; | 198 }; |
202 | 199 |
203 static Type* kStringTypes[] = {Type::InternalizedString(), Type::OtherString(), | 200 static Type* kStringTypes[] = {Type::InternalizedString(), Type::OtherString(), |
204 Type::String()}; | 201 Type::String()}; |
205 | 202 |
206 | 203 |
207 static Type* kInt32Types[] = {Type::UnsignedSmall(), Type::Negative32(), | 204 static Type* kInt32Types[] = {Type::UnsignedSmall(), Type::Negative32(), |
208 Type::Unsigned31(), Type::SignedSmall(), | 205 Type::Unsigned31(), Type::SignedSmall(), |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 CHECK_EQ(p1, r->InputAt(0)); | 1248 CHECK_EQ(p1, r->InputAt(0)); |
1252 CHECK_EQ(p0, r->InputAt(1)); | 1249 CHECK_EQ(p0, r->InputAt(1)); |
1253 } else { | 1250 } else { |
1254 CHECK_EQ(p0, r->InputAt(0)); | 1251 CHECK_EQ(p0, r->InputAt(0)); |
1255 CHECK_EQ(p1, r->InputAt(1)); | 1252 CHECK_EQ(p1, r->InputAt(1)); |
1256 } | 1253 } |
1257 } | 1254 } |
1258 } | 1255 } |
1259 } | 1256 } |
1260 } | 1257 } |
OLD | NEW |