Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/bytecode-generator.h" | 5 #include "src/interpreter/bytecode-generator.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/interpreter/control-flow-builders.h" | 9 #include "src/interpreter/control-flow-builders.h" |
| 10 #include "src/objects.h" | 10 #include "src/objects.h" |
| (...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1532 execution_result()->SetResultInAccumulator(); | 1532 execution_result()->SetResultInAccumulator(); |
| 1533 } | 1533 } |
| 1534 | 1534 |
| 1535 | 1535 |
| 1536 void BytecodeGenerator::VisitYield(Yield* expr) { UNIMPLEMENTED(); } | 1536 void BytecodeGenerator::VisitYield(Yield* expr) { UNIMPLEMENTED(); } |
| 1537 | 1537 |
| 1538 | 1538 |
| 1539 void BytecodeGenerator::VisitThrow(Throw* expr) { | 1539 void BytecodeGenerator::VisitThrow(Throw* expr) { |
| 1540 VisitForAccumulatorValue(expr->exception()); | 1540 VisitForAccumulatorValue(expr->exception()); |
| 1541 builder()->Throw(); | 1541 builder()->Throw(); |
| 1542 // For script and eval scopes expression statements are converted to | |
| 1543 // assignment statements in Rewriter::ReWrite pass. An assignment statement | |
| 1544 // expects a value in the accumulator. This is a hack to avoid DCHECK fails | |
| 1545 // assert accumulator has been set. | |
| 1546 if (info()->literal()->scope()->is_script_scope() || | |
|
Michael Starzinger
2016/01/18 21:23:03
I wouldn't even narrow this to script or eval scop
mythria
2016/01/19 10:48:04
Done.
| |
| 1547 info()->literal()->scope()->is_eval_scope()) { | |
| 1548 execution_result()->SetResultInAccumulator(); | |
| 1549 } | |
| 1542 } | 1550 } |
| 1543 | 1551 |
| 1544 | 1552 |
| 1545 void BytecodeGenerator::VisitPropertyLoad(Register obj, Property* expr) { | 1553 void BytecodeGenerator::VisitPropertyLoad(Register obj, Property* expr) { |
| 1546 LhsKind property_kind = Property::GetAssignType(expr); | 1554 LhsKind property_kind = Property::GetAssignType(expr); |
| 1547 FeedbackVectorSlot slot = expr->PropertyFeedbackSlot(); | 1555 FeedbackVectorSlot slot = expr->PropertyFeedbackSlot(); |
| 1548 switch (property_kind) { | 1556 switch (property_kind) { |
| 1549 case VARIABLE: | 1557 case VARIABLE: |
| 1550 UNREACHABLE(); | 1558 UNREACHABLE(); |
| 1551 case NAMED_PROPERTY: { | 1559 case NAMED_PROPERTY: { |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2237 } | 2245 } |
| 2238 | 2246 |
| 2239 | 2247 |
| 2240 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 2248 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
| 2241 return info()->feedback_vector()->GetIndex(slot); | 2249 return info()->feedback_vector()->GetIndex(slot); |
| 2242 } | 2250 } |
| 2243 | 2251 |
| 2244 } // namespace interpreter | 2252 } // namespace interpreter |
| 2245 } // namespace internal | 2253 } // namespace internal |
| 2246 } // namespace v8 | 2254 } // namespace v8 |
| OLD | NEW |