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/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/compiler/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 2207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2218 VisitForValue(expr->left()); | 2218 VisitForValue(expr->left()); |
2219 VisitForValue(expr->right()); | 2219 VisitForValue(expr->right()); |
2220 Node* right = environment()->Pop(); | 2220 Node* right = environment()->Pop(); |
2221 Node* left = environment()->Pop(); | 2221 Node* left = environment()->Pop(); |
2222 Node* value = NewNode(op, left, right); | 2222 Node* value = NewNode(op, left, right); |
2223 PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine()); | 2223 PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine()); |
2224 ast_context()->ProduceValue(value); | 2224 ast_context()->ProduceValue(value); |
2225 } | 2225 } |
2226 | 2226 |
2227 | 2227 |
2228 void AstGraphBuilder::VisitSpreadOperation(SpreadOperation* expr) { | |
2229 LoopBuilder for_loop(this); | |
2230 VisitForEffect(expr->assign_iterator()); | |
2231 for_loop.BeginLoop(NULL, false); | |
2232 VisitForEffect(expr->next_result()); | |
2233 VisitForTest(expr->result_done()); | |
2234 Node* condition = environment()->Pop(); | |
2235 for_loop.BreakWhen(condition); | |
2236 VisitForValue(expr->result_value()); | |
Michael Starzinger
2015/02/16 19:58:58
I am not sure how this is supposed to work in the
caitp (gmail)
2015/02/16 21:41:51
I don't think I ever finished the AstGraphBuilder
| |
2237 for_loop.EndBody(); | |
2238 for_loop.EndLoop(); | |
2239 } | |
2240 | |
2241 | |
2228 void AstGraphBuilder::VisitThisFunction(ThisFunction* expr) { | 2242 void AstGraphBuilder::VisitThisFunction(ThisFunction* expr) { |
2229 Node* value = GetFunctionClosure(); | 2243 Node* value = GetFunctionClosure(); |
2230 ast_context()->ProduceValue(value); | 2244 ast_context()->ProduceValue(value); |
2231 } | 2245 } |
2232 | 2246 |
2233 | 2247 |
2234 void AstGraphBuilder::VisitSuperReference(SuperReference* expr) { | 2248 void AstGraphBuilder::VisitSuperReference(SuperReference* expr) { |
2235 // TODO(turbofan): Implement super here. | 2249 // TODO(turbofan): Implement super here. |
2236 SetStackOverflow(); | 2250 SetStackOverflow(); |
2237 ast_context()->ProduceValue(jsgraph()->UndefinedConstant()); | 2251 ast_context()->ProduceValue(jsgraph()->UndefinedConstant()); |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3131 Node* dead_node = graph()->NewNode(common()->Dead()); | 3145 Node* dead_node = graph()->NewNode(common()->Dead()); |
3132 dead_control_.set(dead_node); | 3146 dead_control_.set(dead_node); |
3133 return dead_node; | 3147 return dead_node; |
3134 } | 3148 } |
3135 return dead_control_.get(); | 3149 return dead_control_.get(); |
3136 } | 3150 } |
3137 | 3151 |
3138 } // namespace compiler | 3152 } // namespace compiler |
3139 } // namespace internal | 3153 } // namespace internal |
3140 } // namespace v8 | 3154 } // namespace v8 |
OLD | NEW |