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/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 PrepareFrameState(literal, expr->id(), ast_context()->GetStateCombine()); | 1347 PrepareFrameState(literal, expr->id(), ast_context()->GetStateCombine()); |
1348 ast_context()->ProduceValue(expr, literal); | 1348 ast_context()->ProduceValue(expr, literal); |
1349 } | 1349 } |
1350 | 1350 |
1351 | 1351 |
1352 void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { | 1352 void AstGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { |
1353 Node* closure = GetFunctionClosure(); | 1353 Node* closure = GetFunctionClosure(); |
1354 | 1354 |
1355 // Create node to deep-copy the literal boilerplate. | 1355 // Create node to deep-copy the literal boilerplate. |
1356 const Operator* op = javascript()->CreateLiteralObject( | 1356 const Operator* op = javascript()->CreateLiteralObject( |
1357 expr->constant_properties(), expr->ComputeFlags(true), | 1357 expr->GetOrBuildConstantProperties(isolate()), expr->ComputeFlags(true), |
1358 expr->literal_index(), expr->properties_count()); | 1358 expr->literal_index(), expr->properties_count()); |
1359 Node* literal = NewNode(op, closure); | 1359 Node* literal = NewNode(op, closure); |
1360 PrepareFrameState(literal, expr->CreateLiteralId(), | 1360 PrepareFrameState(literal, expr->CreateLiteralId(), |
1361 OutputFrameStateCombine::Push()); | 1361 OutputFrameStateCombine::Push()); |
1362 | 1362 |
1363 // The object is expected on the operand stack during computation of the | 1363 // The object is expected on the operand stack during computation of the |
1364 // property values and is the value of the entire expression. | 1364 // property values and is the value of the entire expression. |
1365 environment()->Push(literal); | 1365 environment()->Push(literal); |
1366 | 1366 |
1367 // Create nodes to store computed values into the literal. | 1367 // Create nodes to store computed values into the literal. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1476 BuildSetHomeObject(environment()->Top(), home_object, property); | 1476 BuildSetHomeObject(environment()->Top(), home_object, property); |
1477 } | 1477 } |
1478 } | 1478 } |
1479 | 1479 |
1480 | 1480 |
1481 void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { | 1481 void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { |
1482 Node* closure = GetFunctionClosure(); | 1482 Node* closure = GetFunctionClosure(); |
1483 | 1483 |
1484 // Create node to deep-copy the literal boilerplate. | 1484 // Create node to deep-copy the literal boilerplate. |
1485 const Operator* op = javascript()->CreateLiteralArray( | 1485 const Operator* op = javascript()->CreateLiteralArray( |
1486 expr->constant_elements(), expr->ComputeFlags(true), | 1486 expr->GetOrBuildConstantElements(isolate()), expr->ComputeFlags(true), |
1487 expr->literal_index(), expr->values()->length()); | 1487 expr->literal_index(), expr->values()->length()); |
1488 Node* literal = NewNode(op, closure); | 1488 Node* literal = NewNode(op, closure); |
1489 PrepareFrameState(literal, expr->CreateLiteralId(), | 1489 PrepareFrameState(literal, expr->CreateLiteralId(), |
1490 OutputFrameStateCombine::Push()); | 1490 OutputFrameStateCombine::Push()); |
1491 | 1491 |
1492 // The array is expected on the operand stack during computation of the | 1492 // The array is expected on the operand stack during computation of the |
1493 // element values. | 1493 // element values. |
1494 environment()->Push(literal); | 1494 environment()->Push(literal); |
1495 | 1495 |
1496 // Create nodes to evaluate all the non-constant subexpressions and to store | 1496 // Create nodes to evaluate all the non-constant subexpressions and to store |
(...skipping 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3166 float invocation_frequency, LoopAssignmentAnalysis* loop_assignment, | 3166 float invocation_frequency, LoopAssignmentAnalysis* loop_assignment, |
3167 SourcePositionTable* source_positions, int inlining_id) | 3167 SourcePositionTable* source_positions, int inlining_id) |
3168 : AstGraphBuilder(local_zone, info, jsgraph, invocation_frequency, | 3168 : AstGraphBuilder(local_zone, info, jsgraph, invocation_frequency, |
3169 loop_assignment), | 3169 loop_assignment), |
3170 source_positions_(source_positions), | 3170 source_positions_(source_positions), |
3171 start_position_(info->shared_info()->start_position(), inlining_id) {} | 3171 start_position_(info->shared_info()->start_position(), inlining_id) {} |
3172 | 3172 |
3173 } // namespace compiler | 3173 } // namespace compiler |
3174 } // namespace internal | 3174 } // namespace internal |
3175 } // namespace v8 | 3175 } // namespace v8 |
OLD | NEW |