| 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/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/compiler/ast-loop-assignment-analyzer.h" | 9 #include "src/compiler/ast-loop-assignment-analyzer.h" |
| 10 #include "src/compiler/control-builders.h" | 10 #include "src/compiler/control-builders.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 } | 274 } |
| 275 | 275 |
| 276 protected: | 276 protected: |
| 277 Node* NewPathToken(int token_id) { | 277 Node* NewPathToken(int token_id) { |
| 278 return owner_->jsgraph()->Constant(token_id); | 278 return owner_->jsgraph()->Constant(token_id); |
| 279 } | 279 } |
| 280 Node* NewPathTokenForImplicitFallThrough() { | 280 Node* NewPathTokenForImplicitFallThrough() { |
| 281 return NewPathToken(TokenDispenserForFinally::kFallThroughToken); | 281 return NewPathToken(TokenDispenserForFinally::kFallThroughToken); |
| 282 } | 282 } |
| 283 Node* NewPathDispatchCondition(Node* t1, Node* t2) { | 283 Node* NewPathDispatchCondition(Node* t1, Node* t2) { |
| 284 // TODO(mstarzinger): This should be machine()->WordEqual(), but our Phi | |
| 285 // nodes all have kRepTagged|kTypeAny, which causes representation mismatch. | |
| 286 return owner_->NewNode(owner_->javascript()->StrictEqual(), t1, t2); | 284 return owner_->NewNode(owner_->javascript()->StrictEqual(), t1, t2); |
| 287 } | 285 } |
| 288 | 286 |
| 289 private: | 287 private: |
| 290 TokenDispenserForFinally dispenser_; | 288 TokenDispenserForFinally dispenser_; |
| 291 AstGraphBuilder* owner_; | 289 AstGraphBuilder* owner_; |
| 292 ZoneVector<Entry> deferred_; | 290 ZoneVector<Entry> deferred_; |
| 293 Node* return_token_; | 291 Node* return_token_; |
| 294 Node* throw_token_; | 292 Node* throw_token_; |
| 295 }; | 293 }; |
| (...skipping 4002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4298 | 4296 |
| 4299 Node* AstGraphBuilder::NewPhi(int count, Node* input, Node* control) { | 4297 Node* AstGraphBuilder::NewPhi(int count, Node* input, Node* control) { |
| 4300 const Operator* phi_op = common()->Phi(MachineRepresentation::kTagged, count); | 4298 const Operator* phi_op = common()->Phi(MachineRepresentation::kTagged, count); |
| 4301 Node** buffer = EnsureInputBufferSize(count + 1); | 4299 Node** buffer = EnsureInputBufferSize(count + 1); |
| 4302 MemsetPointer(buffer, input, count); | 4300 MemsetPointer(buffer, input, count); |
| 4303 buffer[count] = control; | 4301 buffer[count] = control; |
| 4304 return graph()->NewNode(phi_op, count + 1, buffer, true); | 4302 return graph()->NewNode(phi_op, count + 1, buffer, true); |
| 4305 } | 4303 } |
| 4306 | 4304 |
| 4307 | 4305 |
| 4308 // TODO(mstarzinger): Revisit this once we have proper effect states. | |
| 4309 Node* AstGraphBuilder::NewEffectPhi(int count, Node* input, Node* control) { | 4306 Node* AstGraphBuilder::NewEffectPhi(int count, Node* input, Node* control) { |
| 4310 const Operator* phi_op = common()->EffectPhi(count); | 4307 const Operator* phi_op = common()->EffectPhi(count); |
| 4311 Node** buffer = EnsureInputBufferSize(count + 1); | 4308 Node** buffer = EnsureInputBufferSize(count + 1); |
| 4312 MemsetPointer(buffer, input, count); | 4309 MemsetPointer(buffer, input, count); |
| 4313 buffer[count] = control; | 4310 buffer[count] = control; |
| 4314 return graph()->NewNode(phi_op, count + 1, buffer, true); | 4311 return graph()->NewNode(phi_op, count + 1, buffer, true); |
| 4315 } | 4312 } |
| 4316 | 4313 |
| 4317 | 4314 |
| 4318 Node* AstGraphBuilder::MergeControl(Node* control, Node* other) { | 4315 Node* AstGraphBuilder::MergeControl(Node* control, Node* other) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4365 // Phi does not exist yet, introduce one. | 4362 // Phi does not exist yet, introduce one. |
| 4366 value = NewPhi(inputs, value, control); | 4363 value = NewPhi(inputs, value, control); |
| 4367 value->ReplaceInput(inputs - 1, other); | 4364 value->ReplaceInput(inputs - 1, other); |
| 4368 } | 4365 } |
| 4369 return value; | 4366 return value; |
| 4370 } | 4367 } |
| 4371 | 4368 |
| 4372 } // namespace compiler | 4369 } // namespace compiler |
| 4373 } // namespace internal | 4370 } // namespace internal |
| 4374 } // namespace v8 | 4371 } // namespace v8 |
| OLD | NEW |