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 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1789 case ObjectLiteral::Property::SETTER: | 1789 case ObjectLiteral::Property::SETTER: |
1790 if (property->emit_store()) { | 1790 if (property->emit_store()) { |
1791 accessor_table.lookup(key)->second->setter = property; | 1791 accessor_table.lookup(key)->second->setter = property; |
1792 } | 1792 } |
1793 break; | 1793 break; |
1794 } | 1794 } |
1795 } | 1795 } |
1796 | 1796 |
1797 // Create nodes to define accessors, using only a single call to the runtime | 1797 // Create nodes to define accessors, using only a single call to the runtime |
1798 // for each pair of corresponding getters and setters. | 1798 // for each pair of corresponding getters and setters. |
| 1799 literal = environment()->Top(); // Reload from operand stack. |
1799 for (AccessorTable::Iterator it = accessor_table.begin(); | 1800 for (AccessorTable::Iterator it = accessor_table.begin(); |
1800 it != accessor_table.end(); ++it) { | 1801 it != accessor_table.end(); ++it) { |
1801 VisitForValue(it->first); | 1802 VisitForValue(it->first); |
1802 VisitObjectLiteralAccessor(literal, it->second->getter); | 1803 VisitObjectLiteralAccessor(literal, it->second->getter); |
1803 VisitObjectLiteralAccessor(literal, it->second->setter); | 1804 VisitObjectLiteralAccessor(literal, it->second->setter); |
1804 Node* setter = environment()->Pop(); | 1805 Node* setter = environment()->Pop(); |
1805 Node* getter = environment()->Pop(); | 1806 Node* getter = environment()->Pop(); |
1806 Node* name = environment()->Pop(); | 1807 Node* name = environment()->Pop(); |
1807 Node* attr = jsgraph()->Constant(NONE); | 1808 Node* attr = jsgraph()->Constant(NONE); |
1808 const Operator* op = | 1809 const Operator* op = |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1873 const Operator* op = javascript()->CallRuntime( | 1874 const Operator* op = javascript()->CallRuntime( |
1874 Runtime::kDefineSetterPropertyUnchecked, 4); | 1875 Runtime::kDefineSetterPropertyUnchecked, 4); |
1875 Node* call = NewNode(op, receiver, key, value, attr); | 1876 Node* call = NewNode(op, receiver, key, value, attr); |
1876 PrepareFrameState(call, BailoutId::None()); | 1877 PrepareFrameState(call, BailoutId::None()); |
1877 break; | 1878 break; |
1878 } | 1879 } |
1879 } | 1880 } |
1880 } | 1881 } |
1881 | 1882 |
1882 // Transform literals that contain functions to fast properties. | 1883 // Transform literals that contain functions to fast properties. |
| 1884 literal = environment()->Top(); // Reload from operand stack. |
1883 if (expr->has_function()) { | 1885 if (expr->has_function()) { |
1884 const Operator* op = | 1886 const Operator* op = |
1885 javascript()->CallRuntime(Runtime::kToFastProperties, 1); | 1887 javascript()->CallRuntime(Runtime::kToFastProperties, 1); |
1886 NewNode(op, literal); | 1888 NewNode(op, literal); |
1887 } | 1889 } |
1888 | 1890 |
1889 ast_context()->ProduceValue(environment()->Pop()); | 1891 ast_context()->ProduceValue(environment()->Pop()); |
1890 } | 1892 } |
1891 | 1893 |
1892 | 1894 |
(...skipping 2405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4298 // Phi does not exist yet, introduce one. | 4300 // Phi does not exist yet, introduce one. |
4299 value = NewPhi(inputs, value, control); | 4301 value = NewPhi(inputs, value, control); |
4300 value->ReplaceInput(inputs - 1, other); | 4302 value->ReplaceInput(inputs - 1, other); |
4301 } | 4303 } |
4302 return value; | 4304 return value; |
4303 } | 4305 } |
4304 | 4306 |
4305 } // namespace compiler | 4307 } // namespace compiler |
4306 } // namespace internal | 4308 } // namespace internal |
4307 } // namespace v8 | 4309 } // namespace v8 |
OLD | NEW |