Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: src/interpreter/bytecode-generator.cc

Issue 1924093005: [ignition] Reactivate check for jumps to unbound targets. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/bytecode-register-allocator.h" 9 #include "src/interpreter/bytecode-register-allocator.h"
10 #include "src/interpreter/control-flow-builders.h" 10 #include "src/interpreter/control-flow-builders.h"
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 if (scope()->NeedsContext()) { 594 if (scope()->NeedsContext()) {
595 // Push a new inner context scope for the function. 595 // Push a new inner context scope for the function.
596 VisitNewLocalFunctionContext(); 596 VisitNewLocalFunctionContext();
597 ContextScope local_function_context(this, scope(), false); 597 ContextScope local_function_context(this, scope(), false);
598 VisitBuildLocalActivationContext(); 598 VisitBuildLocalActivationContext();
599 MakeBytecodeBody(); 599 MakeBytecodeBody();
600 } else { 600 } else {
601 MakeBytecodeBody(); 601 MakeBytecodeBody();
602 } 602 }
603 603
604 // In generator functions, we may not have visited every yield in the AST
605 // since we skip some obviously dead code. Hence the generated bytecode may
606 // contain jumps to unbound labels (resume points that will never be used).
607 // We bind these now.
608 for (auto& label : generator_resume_points_) {
609 if (!label.is_bound()) builder()->Bind(&label);
610 }
611
604 builder()->EnsureReturn(); 612 builder()->EnsureReturn();
605 return builder()->ToBytecodeArray(); 613 return builder()->ToBytecodeArray();
606 } 614 }
607 615
608 616
609 void BytecodeGenerator::MakeBytecodeBody() { 617 void BytecodeGenerator::MakeBytecodeBody() {
610 // Build the arguments object if it is used. 618 // Build the arguments object if it is used.
611 VisitArgumentsObject(scope()->arguments()); 619 VisitArgumentsObject(scope()->arguments());
612 620
613 // Build rest arguments array if it is used. 621 // Build rest arguments array if it is used.
(...skipping 2649 matching lines...) Expand 10 before | Expand all | Expand 10 after
3263 } 3271 }
3264 3272
3265 3273
3266 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 3274 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
3267 return info()->shared_info()->feedback_vector()->GetIndex(slot); 3275 return info()->shared_info()->feedback_vector()->GetIndex(slot);
3268 } 3276 }
3269 3277
3270 } // namespace interpreter 3278 } // namespace interpreter
3271 } // namespace internal 3279 } // namespace internal
3272 } // namespace v8 3280 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698