| 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 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1599 Node* receiver = environment()->Pop(); | 1599 Node* receiver = environment()->Pop(); |
| 1600 | 1600 |
| 1601 BuildSetHomeObject(value, receiver, property); | 1601 BuildSetHomeObject(value, receiver, property); |
| 1602 | 1602 |
| 1603 switch (property->kind()) { | 1603 switch (property->kind()) { |
| 1604 case ObjectLiteral::Property::CONSTANT: | 1604 case ObjectLiteral::Property::CONSTANT: |
| 1605 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 1605 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
| 1606 case ObjectLiteral::Property::PROTOTYPE: | 1606 case ObjectLiteral::Property::PROTOTYPE: |
| 1607 UNREACHABLE(); | 1607 UNREACHABLE(); |
| 1608 case ObjectLiteral::Property::COMPUTED: { | 1608 case ObjectLiteral::Property::COMPUTED: { |
| 1609 Node* attr = jsgraph()->Constant(DONT_ENUM); |
| 1610 Node* set_function_name = |
| 1611 jsgraph()->Constant(property->NeedsSetFunctionName()); |
| 1609 const Operator* op = | 1612 const Operator* op = |
| 1610 javascript()->CallRuntime(Runtime::kDefineClassMethod); | 1613 javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral); |
| 1611 NewNode(op, receiver, key, value); | 1614 Node* call = NewNode(op, receiver, key, value, attr, set_function_name); |
| 1615 PrepareFrameState(call, BailoutId::None()); |
| 1612 break; | 1616 break; |
| 1613 } | 1617 } |
| 1614 case ObjectLiteral::Property::GETTER: { | 1618 case ObjectLiteral::Property::GETTER: { |
| 1615 Node* attr = jsgraph()->Constant(DONT_ENUM); | 1619 Node* attr = jsgraph()->Constant(DONT_ENUM); |
| 1616 const Operator* op = javascript()->CallRuntime( | 1620 const Operator* op = javascript()->CallRuntime( |
| 1617 Runtime::kDefineGetterPropertyUnchecked, 4); | 1621 Runtime::kDefineGetterPropertyUnchecked, 4); |
| 1618 NewNode(op, receiver, key, value, attr); | 1622 NewNode(op, receiver, key, value, attr); |
| 1619 break; | 1623 break; |
| 1620 } | 1624 } |
| 1621 case ObjectLiteral::Property::SETTER: { | 1625 case ObjectLiteral::Property::SETTER: { |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1848 VisitForValue(property->value()); | 1852 VisitForValue(property->value()); |
| 1849 Node* value = environment()->Pop(); | 1853 Node* value = environment()->Pop(); |
| 1850 Node* key = environment()->Pop(); | 1854 Node* key = environment()->Pop(); |
| 1851 Node* receiver = environment()->Pop(); | 1855 Node* receiver = environment()->Pop(); |
| 1852 BuildSetHomeObject(value, receiver, property); | 1856 BuildSetHomeObject(value, receiver, property); |
| 1853 switch (property->kind()) { | 1857 switch (property->kind()) { |
| 1854 case ObjectLiteral::Property::CONSTANT: | 1858 case ObjectLiteral::Property::CONSTANT: |
| 1855 case ObjectLiteral::Property::COMPUTED: | 1859 case ObjectLiteral::Property::COMPUTED: |
| 1856 case ObjectLiteral::Property::MATERIALIZED_LITERAL: { | 1860 case ObjectLiteral::Property::MATERIALIZED_LITERAL: { |
| 1857 Node* attr = jsgraph()->Constant(NONE); | 1861 Node* attr = jsgraph()->Constant(NONE); |
| 1862 Node* set_function_name = |
| 1863 jsgraph()->Constant(property->NeedsSetFunctionName()); |
| 1858 const Operator* op = | 1864 const Operator* op = |
| 1859 javascript()->CallRuntime(Runtime::kDefineDataPropertyUnchecked); | 1865 javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral); |
| 1860 Node* call = NewNode(op, receiver, key, value, attr); | 1866 Node* call = NewNode(op, receiver, key, value, attr, set_function_name); |
| 1861 PrepareFrameState(call, BailoutId::None()); | 1867 PrepareFrameState(call, BailoutId::None()); |
| 1862 break; | 1868 break; |
| 1863 } | 1869 } |
| 1864 case ObjectLiteral::Property::PROTOTYPE: | 1870 case ObjectLiteral::Property::PROTOTYPE: |
| 1865 UNREACHABLE(); // Handled specially above. | 1871 UNREACHABLE(); // Handled specially above. |
| 1866 break; | 1872 break; |
| 1867 case ObjectLiteral::Property::GETTER: { | 1873 case ObjectLiteral::Property::GETTER: { |
| 1868 Node* attr = jsgraph()->Constant(NONE); | 1874 Node* attr = jsgraph()->Constant(NONE); |
| 1869 const Operator* op = javascript()->CallRuntime( | 1875 const Operator* op = javascript()->CallRuntime( |
| 1870 Runtime::kDefineGetterPropertyUnchecked, 4); | 1876 Runtime::kDefineGetterPropertyUnchecked, 4); |
| (...skipping 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4337 // Phi does not exist yet, introduce one. | 4343 // Phi does not exist yet, introduce one. |
| 4338 value = NewPhi(inputs, value, control); | 4344 value = NewPhi(inputs, value, control); |
| 4339 value->ReplaceInput(inputs - 1, other); | 4345 value->ReplaceInput(inputs - 1, other); |
| 4340 } | 4346 } |
| 4341 return value; | 4347 return value; |
| 4342 } | 4348 } |
| 4343 | 4349 |
| 4344 } // namespace compiler | 4350 } // namespace compiler |
| 4345 } // namespace internal | 4351 } // namespace internal |
| 4346 } // namespace v8 | 4352 } // namespace v8 |
| OLD | NEW |