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 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 expr->GetIdForPropertyName(property_index)); | 1502 expr->GetIdForPropertyName(property_index)); |
1503 environment()->Push(name); | 1503 environment()->Push(name); |
1504 VisitForValue(property->value()); | 1504 VisitForValue(property->value()); |
1505 Node* value = environment()->Pop(); | 1505 Node* value = environment()->Pop(); |
1506 Node* key = environment()->Pop(); | 1506 Node* key = environment()->Pop(); |
1507 Node* receiver = environment()->Pop(); | 1507 Node* receiver = environment()->Pop(); |
1508 BuildSetHomeObject(value, receiver, property); | 1508 BuildSetHomeObject(value, receiver, property); |
1509 switch (property->kind()) { | 1509 switch (property->kind()) { |
1510 case ObjectLiteral::Property::CONSTANT: | 1510 case ObjectLiteral::Property::CONSTANT: |
1511 case ObjectLiteral::Property::COMPUTED: | 1511 case ObjectLiteral::Property::COMPUTED: |
1512 case ObjectLiteral::Property::MATERIALIZED_LITERAL: { | 1512 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
1513 if (!property->emit_store()) continue; | |
1514 Node* attr = jsgraph()->Constant(NONE); | |
1515 Node* set_function_name = | |
1516 jsgraph()->Constant(property->NeedsSetFunctionName()); | |
1517 const Operator* op = | |
1518 javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral); | |
1519 Node* call = NewNode(op, receiver, key, value, attr, set_function_name); | |
1520 PrepareFrameState(call, expr->GetIdForPropertySet(property_index)); | |
1521 break; | |
1522 } | |
1523 case ObjectLiteral::Property::PROTOTYPE: | 1513 case ObjectLiteral::Property::PROTOTYPE: |
1524 UNREACHABLE(); // Handled specially above. | 1514 UNREACHABLE(); // Handled specially above. |
1525 break; | 1515 break; |
1526 case ObjectLiteral::Property::GETTER: { | 1516 case ObjectLiteral::Property::GETTER: { |
1527 Node* attr = jsgraph()->Constant(NONE); | 1517 Node* attr = jsgraph()->Constant(NONE); |
1528 const Operator* op = javascript()->CallRuntime( | 1518 const Operator* op = javascript()->CallRuntime( |
1529 Runtime::kDefineGetterPropertyUnchecked, 4); | 1519 Runtime::kDefineGetterPropertyUnchecked, 4); |
1530 Node* call = NewNode(op, receiver, key, value, attr); | 1520 Node* call = NewNode(op, receiver, key, value, attr); |
1531 PrepareFrameState(call, BailoutId::None()); | 1521 PrepareFrameState(call, BailoutId::None()); |
1532 break; | 1522 break; |
(...skipping 2088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3621 float invocation_frequency, LoopAssignmentAnalysis* loop_assignment, | 3611 float invocation_frequency, LoopAssignmentAnalysis* loop_assignment, |
3622 SourcePositionTable* source_positions, int inlining_id) | 3612 SourcePositionTable* source_positions, int inlining_id) |
3623 : AstGraphBuilder(local_zone, info, jsgraph, invocation_frequency, | 3613 : AstGraphBuilder(local_zone, info, jsgraph, invocation_frequency, |
3624 loop_assignment), | 3614 loop_assignment), |
3625 source_positions_(source_positions), | 3615 source_positions_(source_positions), |
3626 start_position_(info->shared_info()->start_position(), inlining_id) {} | 3616 start_position_(info->shared_info()->start_position(), inlining_id) {} |
3627 | 3617 |
3628 } // namespace compiler | 3618 } // namespace compiler |
3629 } // namespace internal | 3619 } // namespace internal |
3630 } // namespace v8 | 3620 } // namespace v8 |
OLD | NEW |