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

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

Issue 1545003003: [Interpreter] Fixes VisitNewLocalBlockContext to reserve consecutive registers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 12 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 | « no previous file | 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/control-flow-builders.h" 9 #include "src/interpreter/control-flow-builders.h"
10 #include "src/objects.h" 10 #include "src/objects.h"
(...skipping 2056 matching lines...) Expand 10 before | Expand all | Expand 10 after
2067 } 2067 }
2068 } 2068 }
2069 2069
2070 2070
2071 void BytecodeGenerator::VisitNewLocalBlockContext(Scope* scope) { 2071 void BytecodeGenerator::VisitNewLocalBlockContext(Scope* scope) {
2072 AccumulatorResultScope accumulator_execution_result(this); 2072 AccumulatorResultScope accumulator_execution_result(this);
2073 DCHECK(scope->is_block_scope()); 2073 DCHECK(scope->is_block_scope());
2074 2074
2075 // Allocate a new local block context. 2075 // Allocate a new local block context.
2076 TemporaryRegisterScope temporary_register_scope(builder()); 2076 TemporaryRegisterScope temporary_register_scope(builder());
2077 Register scope_info = temporary_register_scope.NewRegister(); 2077 temporary_register_scope.PrepareForConsecutiveAllocations(2);
2078 Register closure = temporary_register_scope.NewRegister(); 2078 Register scope_info = temporary_register_scope.NextConsecutiveRegister();
2079 DCHECK(Register::AreContiguous(scope_info, closure)); 2079 Register closure = temporary_register_scope.NextConsecutiveRegister();
2080
2080 builder() 2081 builder()
2081 ->LoadLiteral(scope->GetScopeInfo(isolate())) 2082 ->LoadLiteral(scope->GetScopeInfo(isolate()))
2082 .StoreAccumulatorInRegister(scope_info); 2083 .StoreAccumulatorInRegister(scope_info);
2083 VisitFunctionClosureForContext(); 2084 VisitFunctionClosureForContext();
2084 builder() 2085 builder()
2085 ->StoreAccumulatorInRegister(closure) 2086 ->StoreAccumulatorInRegister(closure)
2086 .CallRuntime(Runtime::kPushBlockContext, scope_info, 2); 2087 .CallRuntime(Runtime::kPushBlockContext, scope_info, 2);
2087 execution_result()->SetResultInAccumulator(); 2088 execution_result()->SetResultInAccumulator();
2088 } 2089 }
2089 2090
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
2216 } 2217 }
2217 2218
2218 2219
2219 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 2220 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
2220 return info()->feedback_vector()->GetIndex(slot); 2221 return info()->feedback_vector()->GetIndex(slot);
2221 } 2222 }
2222 2223
2223 } // namespace interpreter 2224 } // namespace interpreter
2224 } // namespace internal 2225 } // namespace internal
2225 } // namespace v8 2226 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698