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

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

Issue 2184553003: Revert of [interpreter] Add explicit OSR polling bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_interpreter-osr-1
Patch Set: Created 4 years, 4 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') | src/interpreter/bytecodes.h » ('j') | 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/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/interpreter/bytecode-flags.h" 10 #include "src/interpreter/bytecode-flags.h"
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 size_t first_yield = stmt->first_yield_id(); 707 size_t first_yield = stmt->first_yield_id();
708 DCHECK_LE(first_yield + stmt->yield_count(), generator_resume_points_.size()); 708 DCHECK_LE(first_yield + stmt->yield_count(), generator_resume_points_.size());
709 for (size_t id = first_yield; id < first_yield + stmt->yield_count(); id++) { 709 for (size_t id = first_yield; id < first_yield + stmt->yield_count(); id++) {
710 auto& label = generator_resume_points_[id]; 710 auto& label = generator_resume_points_[id];
711 resume_points_in_loop.push_back(label); 711 resume_points_in_loop.push_back(label);
712 generator_resume_points_[id] = BytecodeLabel(); 712 generator_resume_points_[id] = BytecodeLabel();
713 } 713 }
714 714
715 loop_builder->LoopHeader(&resume_points_in_loop); 715 loop_builder->LoopHeader(&resume_points_in_loop);
716 716
717 // Insert an explicit {OsrPoll} right after the loop header, to trigger
718 // on-stack replacement when armed for the given loop nesting depth.
719 if (FLAG_ignition_osr) {
720 // TODO(4764): Merge this with another bytecode (e.g. {Jump} back edge).
721 // TODO(4764): Investigate interaction with generators.
722 // TODO(4764): Track and pass correct loop depth.
723 DCHECK_EQ(0, stmt->yield_count());
724 builder()->OsrPoll(0);
725 }
726
727 if (stmt->yield_count() > 0) { 717 if (stmt->yield_count() > 0) {
728 // If we are not resuming, fall through to loop body. 718 // If we are not resuming, fall through to loop body.
729 // If we are resuming, perform state dispatch. 719 // If we are resuming, perform state dispatch.
730 BytecodeLabel not_resuming; 720 BytecodeLabel not_resuming;
731 builder() 721 builder()
732 ->LoadLiteral(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)) 722 ->LoadLiteral(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))
733 .CompareOperation(Token::Value::EQ, generator_state_) 723 .CompareOperation(Token::Value::EQ, generator_state_)
734 .JumpIfTrue(&not_resuming); 724 .JumpIfTrue(&not_resuming);
735 BuildIndexedJump(generator_state_, first_yield, 725 BuildIndexedJump(generator_state_, first_yield,
736 stmt->yield_count(), generator_resume_points_); 726 stmt->yield_count(), generator_resume_points_);
(...skipping 2500 matching lines...) Expand 10 before | Expand all | Expand 10 after
3237 return execution_context()->scope()->language_mode(); 3227 return execution_context()->scope()->language_mode();
3238 } 3228 }
3239 3229
3240 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 3230 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
3241 return TypeFeedbackVector::GetIndex(slot); 3231 return TypeFeedbackVector::GetIndex(slot);
3242 } 3232 }
3243 3233
3244 } // namespace interpreter 3234 } // namespace interpreter
3245 } // namespace internal 3235 } // namespace internal
3246 } // namespace v8 3236 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698