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 1826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1837 environment()->Push(value); | 1837 environment()->Push(value); |
1838 } else { | 1838 } else { |
1839 VisitForValue(expr->value()); | 1839 VisitForValue(expr->value()); |
1840 } | 1840 } |
1841 | 1841 |
1842 // Store the value. | 1842 // Store the value. |
1843 Node* value = environment()->Pop(); | 1843 Node* value = environment()->Pop(); |
1844 switch (assign_type) { | 1844 switch (assign_type) { |
1845 case VARIABLE: { | 1845 case VARIABLE: { |
1846 Variable* variable = expr->target()->AsVariableProxy()->var(); | 1846 Variable* variable = expr->target()->AsVariableProxy()->var(); |
1847 BuildVariableAssignment(variable, value, expr->op(), expr->AssignmentId(), | 1847 BuildVariableAssignment(variable, value, expr->op(), expr->id(), |
1848 ast_context()->GetStateCombine()); | 1848 ast_context()->GetStateCombine()); |
1849 break; | 1849 break; |
1850 } | 1850 } |
1851 case NAMED_PROPERTY: { | 1851 case NAMED_PROPERTY: { |
1852 Node* object = environment()->Pop(); | 1852 Node* object = environment()->Pop(); |
1853 Unique<Name> name = | 1853 Unique<Name> name = |
1854 MakeUnique(property->key()->AsLiteral()->AsPropertyName()); | 1854 MakeUnique(property->key()->AsLiteral()->AsPropertyName()); |
1855 Node* store = NewNode(javascript()->StoreNamed(language_mode(), name), | 1855 Node* store = NewNode(javascript()->StoreNamed(language_mode(), name), |
1856 object, value); | 1856 object, value); |
1857 PrepareFrameState(store, expr->AssignmentId(), | 1857 PrepareFrameState(store, expr->id(), ast_context()->GetStateCombine()); |
1858 ast_context()->GetStateCombine()); | |
1859 break; | 1858 break; |
1860 } | 1859 } |
1861 case KEYED_PROPERTY: { | 1860 case KEYED_PROPERTY: { |
1862 Node* key = environment()->Pop(); | 1861 Node* key = environment()->Pop(); |
1863 Node* object = environment()->Pop(); | 1862 Node* object = environment()->Pop(); |
1864 Node* store = NewNode(javascript()->StoreProperty(language_mode()), | 1863 Node* store = NewNode(javascript()->StoreProperty(language_mode()), |
1865 object, key, value); | 1864 object, key, value); |
1866 PrepareFrameState(store, expr->AssignmentId(), | 1865 PrepareFrameState(store, expr->id(), ast_context()->GetStateCombine()); |
1867 ast_context()->GetStateCombine()); | |
1868 break; | 1866 break; |
1869 } | 1867 } |
1870 } | 1868 } |
1871 | 1869 |
1872 ast_context()->ProduceValue(value); | 1870 ast_context()->ProduceValue(value); |
1873 } | 1871 } |
1874 | 1872 |
1875 | 1873 |
1876 void AstGraphBuilder::VisitYield(Yield* expr) { | 1874 void AstGraphBuilder::VisitYield(Yield* expr) { |
1877 // TODO(turbofan): Implement yield here. | 1875 // TODO(turbofan): Implement yield here. |
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3284 // Phi does not exist yet, introduce one. | 3282 // Phi does not exist yet, introduce one. |
3285 value = NewPhi(inputs, value, control); | 3283 value = NewPhi(inputs, value, control); |
3286 value->ReplaceInput(inputs - 1, other); | 3284 value->ReplaceInput(inputs - 1, other); |
3287 } | 3285 } |
3288 return value; | 3286 return value; |
3289 } | 3287 } |
3290 | 3288 |
3291 } // namespace compiler | 3289 } // namespace compiler |
3292 } // namespace internal | 3290 } // namespace internal |
3293 } // namespace v8 | 3291 } // namespace v8 |
OLD | NEW |