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/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
(...skipping 2198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2209 | 2209 |
2210 void AstGraphBuilder::VisitThrow(Throw* expr) { | 2210 void AstGraphBuilder::VisitThrow(Throw* expr) { |
2211 VisitForValue(expr->exception()); | 2211 VisitForValue(expr->exception()); |
2212 Node* exception = environment()->Pop(); | 2212 Node* exception = environment()->Pop(); |
2213 Node* value = BuildThrowError(exception, expr->id()); | 2213 Node* value = BuildThrowError(exception, expr->id()); |
2214 ast_context()->ProduceValue(value); | 2214 ast_context()->ProduceValue(value); |
2215 } | 2215 } |
2216 | 2216 |
2217 | 2217 |
2218 void AstGraphBuilder::VisitProperty(Property* expr) { | 2218 void AstGraphBuilder::VisitProperty(Property* expr) { |
2219 Node* value; | 2219 Node* value = nullptr; |
2220 LhsKind property_kind = Property::GetAssignType(expr); | 2220 LhsKind property_kind = Property::GetAssignType(expr); |
2221 VectorSlotPair pair = CreateVectorSlotPair(expr->PropertyFeedbackSlot()); | 2221 VectorSlotPair pair = CreateVectorSlotPair(expr->PropertyFeedbackSlot()); |
2222 switch (property_kind) { | 2222 switch (property_kind) { |
2223 case VARIABLE: | 2223 case VARIABLE: |
2224 UNREACHABLE(); | 2224 UNREACHABLE(); |
2225 value = nullptr; | |
2226 break; | 2225 break; |
2227 case NAMED_PROPERTY: { | 2226 case NAMED_PROPERTY: { |
2228 VisitForValue(expr->obj()); | 2227 VisitForValue(expr->obj()); |
2229 FrameStateBeforeAndAfter states(this, expr->obj()->id()); | 2228 FrameStateBeforeAndAfter states(this, expr->obj()->id()); |
2230 Node* object = environment()->Pop(); | 2229 Node* object = environment()->Pop(); |
2231 Handle<Name> name = expr->key()->AsLiteral()->AsPropertyName(); | 2230 Handle<Name> name = expr->key()->AsLiteral()->AsPropertyName(); |
2232 value = BuildNamedLoad(object, name, pair); | 2231 value = BuildNamedLoad(object, name, pair); |
2233 states.AddToNode(value, expr->id(), ast_context()->GetStateCombine()); | 2232 states.AddToNode(value, expr->id(), ast_context()->GetStateCombine()); |
2234 break; | 2233 break; |
2235 } | 2234 } |
(...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4039 // Phi does not exist yet, introduce one. | 4038 // Phi does not exist yet, introduce one. |
4040 value = NewPhi(inputs, value, control); | 4039 value = NewPhi(inputs, value, control); |
4041 value->ReplaceInput(inputs - 1, other); | 4040 value->ReplaceInput(inputs - 1, other); |
4042 } | 4041 } |
4043 return value; | 4042 return value; |
4044 } | 4043 } |
4045 | 4044 |
4046 } // namespace compiler | 4045 } // namespace compiler |
4047 } // namespace internal | 4046 } // namespace internal |
4048 } // namespace v8 | 4047 } // namespace v8 |
OLD | NEW |