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/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 } | 941 } |
942 } | 942 } |
943 | 943 |
944 // Transform both the class literal and the prototype to fast properties. | 944 // Transform both the class literal and the prototype to fast properties. |
945 const Operator* op = javascript()->CallRuntime(Runtime::kToFastProperties, 1); | 945 const Operator* op = javascript()->CallRuntime(Runtime::kToFastProperties, 1); |
946 NewNode(op, environment()->Pop()); // prototype | 946 NewNode(op, environment()->Pop()); // prototype |
947 NewNode(op, environment()->Pop()); // literal | 947 NewNode(op, environment()->Pop()); // literal |
948 | 948 |
949 // Assign to class variable. | 949 // Assign to class variable. |
950 if (expr->scope() != NULL) { | 950 if (expr->scope() != NULL) { |
951 DCHECK_NOT_NULL(expr->class_variable_proxy()); | 951 DCHECK(expr->class_variable_proxy()); |
952 Variable* var = expr->class_variable_proxy()->var(); | 952 Variable* var = expr->class_variable_proxy()->var(); |
953 BuildVariableAssignment(var, literal, Token::INIT_CONST, BailoutId::None()); | 953 BuildVariableAssignment(var, literal, Token::INIT_CONST, BailoutId::None()); |
954 } | 954 } |
955 | 955 |
956 PrepareFrameState(literal, expr->id(), ast_context()->GetStateCombine()); | 956 PrepareFrameState(literal, expr->id(), ast_context()->GetStateCombine()); |
957 ast_context()->ProduceValue(literal); | 957 ast_context()->ProduceValue(literal); |
958 } | 958 } |
959 | 959 |
960 | 960 |
961 void AstGraphBuilder::VisitNativeFunctionLiteral(NativeFunctionLiteral* expr) { | 961 void AstGraphBuilder::VisitNativeFunctionLiteral(NativeFunctionLiteral* expr) { |
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2436 | 2436 |
2437 BitVector* AstGraphBuilder::GetVariablesAssignedInLoop( | 2437 BitVector* AstGraphBuilder::GetVariablesAssignedInLoop( |
2438 IterationStatement* stmt) { | 2438 IterationStatement* stmt) { |
2439 if (loop_assignment_analysis_ == NULL) return NULL; | 2439 if (loop_assignment_analysis_ == NULL) return NULL; |
2440 return loop_assignment_analysis_->GetVariablesAssignedInLoop(stmt); | 2440 return loop_assignment_analysis_->GetVariablesAssignedInLoop(stmt); |
2441 } | 2441 } |
2442 | 2442 |
2443 } // namespace compiler | 2443 } // namespace compiler |
2444 } // namespace internal | 2444 } // namespace internal |
2445 } // namespace v8 | 2445 } // namespace v8 |
OLD | NEW |