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 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1661 case ObjectLiteral::Property::CONSTANT: | 1661 case ObjectLiteral::Property::CONSTANT: |
1662 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 1662 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
1663 case ObjectLiteral::Property::PROTOTYPE: | 1663 case ObjectLiteral::Property::PROTOTYPE: |
1664 UNREACHABLE(); | 1664 UNREACHABLE(); |
1665 case ObjectLiteral::Property::COMPUTED: { | 1665 case ObjectLiteral::Property::COMPUTED: { |
1666 Node* attr = jsgraph()->Constant(DONT_ENUM); | 1666 Node* attr = jsgraph()->Constant(DONT_ENUM); |
1667 Node* set_function_name = | 1667 Node* set_function_name = |
1668 jsgraph()->Constant(property->NeedsSetFunctionName()); | 1668 jsgraph()->Constant(property->NeedsSetFunctionName()); |
1669 const Operator* op = | 1669 const Operator* op = |
1670 javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral); | 1670 javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral); |
1671 NewNode(op, receiver, key, value, attr, set_function_name); | 1671 Node* call = NewNode(op, receiver, key, value, attr, set_function_name); |
| 1672 PrepareFrameState(call, BailoutId::None()); |
1672 break; | 1673 break; |
1673 } | 1674 } |
1674 case ObjectLiteral::Property::GETTER: { | 1675 case ObjectLiteral::Property::GETTER: { |
1675 Node* attr = jsgraph()->Constant(DONT_ENUM); | 1676 Node* attr = jsgraph()->Constant(DONT_ENUM); |
1676 const Operator* op = javascript()->CallRuntime( | 1677 const Operator* op = javascript()->CallRuntime( |
1677 Runtime::kDefineGetterPropertyUnchecked, 4); | 1678 Runtime::kDefineGetterPropertyUnchecked, 4); |
1678 NewNode(op, receiver, key, value, attr); | 1679 NewNode(op, receiver, key, value, attr); |
1679 break; | 1680 break; |
1680 } | 1681 } |
1681 case ObjectLiteral::Property::SETTER: { | 1682 case ObjectLiteral::Property::SETTER: { |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1909 BuildSetHomeObject(value, receiver, property); | 1910 BuildSetHomeObject(value, receiver, property); |
1910 switch (property->kind()) { | 1911 switch (property->kind()) { |
1911 case ObjectLiteral::Property::CONSTANT: | 1912 case ObjectLiteral::Property::CONSTANT: |
1912 case ObjectLiteral::Property::COMPUTED: | 1913 case ObjectLiteral::Property::COMPUTED: |
1913 case ObjectLiteral::Property::MATERIALIZED_LITERAL: { | 1914 case ObjectLiteral::Property::MATERIALIZED_LITERAL: { |
1914 Node* attr = jsgraph()->Constant(NONE); | 1915 Node* attr = jsgraph()->Constant(NONE); |
1915 Node* set_function_name = | 1916 Node* set_function_name = |
1916 jsgraph()->Constant(property->NeedsSetFunctionName()); | 1917 jsgraph()->Constant(property->NeedsSetFunctionName()); |
1917 const Operator* op = | 1918 const Operator* op = |
1918 javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral); | 1919 javascript()->CallRuntime(Runtime::kDefineDataPropertyInLiteral); |
1919 NewNode(op, receiver, key, value, attr, set_function_name); | 1920 Node* call = NewNode(op, receiver, key, value, attr, set_function_name); |
| 1921 PrepareFrameState(call, expr->GetIdForPropertySet(property_index)); |
1920 break; | 1922 break; |
1921 } | 1923 } |
1922 case ObjectLiteral::Property::PROTOTYPE: | 1924 case ObjectLiteral::Property::PROTOTYPE: |
1923 UNREACHABLE(); // Handled specially above. | 1925 UNREACHABLE(); // Handled specially above. |
1924 break; | 1926 break; |
1925 case ObjectLiteral::Property::GETTER: { | 1927 case ObjectLiteral::Property::GETTER: { |
1926 Node* attr = jsgraph()->Constant(NONE); | 1928 Node* attr = jsgraph()->Constant(NONE); |
1927 const Operator* op = javascript()->CallRuntime( | 1929 const Operator* op = javascript()->CallRuntime( |
1928 Runtime::kDefineGetterPropertyUnchecked, 4); | 1930 Runtime::kDefineGetterPropertyUnchecked, 4); |
1929 Node* call = NewNode(op, receiver, key, value, attr); | 1931 Node* call = NewNode(op, receiver, key, value, attr); |
(...skipping 2456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4386 // Phi does not exist yet, introduce one. | 4388 // Phi does not exist yet, introduce one. |
4387 value = NewPhi(inputs, value, control); | 4389 value = NewPhi(inputs, value, control); |
4388 value->ReplaceInput(inputs - 1, other); | 4390 value->ReplaceInput(inputs - 1, other); |
4389 } | 4391 } |
4390 return value; | 4392 return value; |
4391 } | 4393 } |
4392 | 4394 |
4393 } // namespace compiler | 4395 } // namespace compiler |
4394 } // namespace internal | 4396 } // namespace internal |
4395 } // namespace v8 | 4397 } // namespace v8 |
OLD | NEW |