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

Side by Side Diff: src/runtime/runtime-interpreter.cc

Issue 2681773004: [FeedbackVector] Clarify the way the feedback vector is installed. (Closed)
Patch Set: Code comments+REBASE. Created 3 years, 10 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/objects-inl.h ('k') | src/runtime/runtime-scopes.cc » ('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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 8
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/frames-inl.h" 10 #include "src/frames-inl.h"
(...skipping 10 matching lines...) Expand all
21 21
22 RUNTIME_FUNCTION(Runtime_InterpreterNewClosure) { 22 RUNTIME_FUNCTION(Runtime_InterpreterNewClosure) {
23 HandleScope scope(isolate); 23 HandleScope scope(isolate);
24 DCHECK_EQ(4, args.length()); 24 DCHECK_EQ(4, args.length());
25 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 0); 25 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 0);
26 CONVERT_ARG_HANDLE_CHECKED(FeedbackVector, vector, 1); 26 CONVERT_ARG_HANDLE_CHECKED(FeedbackVector, vector, 1);
27 CONVERT_SMI_ARG_CHECKED(index, 2); 27 CONVERT_SMI_ARG_CHECKED(index, 2);
28 CONVERT_SMI_ARG_CHECKED(pretenured_flag, 3); 28 CONVERT_SMI_ARG_CHECKED(pretenured_flag, 3);
29 Handle<Context> context(isolate->context(), isolate); 29 Handle<Context> context(isolate->context(), isolate);
30 FeedbackSlot slot = FeedbackVector::ToSlot(index); 30 FeedbackSlot slot = FeedbackVector::ToSlot(index);
31 Handle<Cell> literals(Cell::cast(vector->Get(slot)), isolate); 31 Handle<Cell> vector_cell(Cell::cast(vector->Get(slot)), isolate);
32 return *isolate->factory()->NewFunctionFromSharedFunctionInfo( 32 return *isolate->factory()->NewFunctionFromSharedFunctionInfo(
33 shared, context, literals, static_cast<PretenureFlag>(pretenured_flag)); 33 shared, context, vector_cell,
34 static_cast<PretenureFlag>(pretenured_flag));
34 } 35 }
35 36
36 namespace { 37 namespace {
37 38
38 void AdvanceToOffsetForTracing( 39 void AdvanceToOffsetForTracing(
39 interpreter::BytecodeArrayIterator& bytecode_iterator, int offset) { 40 interpreter::BytecodeArrayIterator& bytecode_iterator, int offset) {
40 while (bytecode_iterator.current_offset() + 41 while (bytecode_iterator.current_offset() +
41 bytecode_iterator.current_bytecode_size() <= 42 bytecode_iterator.current_bytecode_size() <=
42 offset) { 43 offset) {
43 bytecode_iterator.Advance(); 44 bytecode_iterator.Advance();
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag; 169 int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag;
169 while (it.current_offset() < offset) it.Advance(); 170 while (it.current_offset() < offset) it.Advance();
170 DCHECK_EQ(offset, it.current_offset()); 171 DCHECK_EQ(offset, it.current_offset());
171 it.Advance(); // Advance by one bytecode. 172 it.Advance(); // Advance by one bytecode.
172 offset = it.current_offset() + BytecodeArray::kHeaderSize - kHeapObjectTag; 173 offset = it.current_offset() + BytecodeArray::kHeaderSize - kHeapObjectTag;
173 return Smi::FromInt(offset); 174 return Smi::FromInt(offset);
174 } 175 }
175 176
176 } // namespace internal 177 } // namespace internal
177 } // namespace v8 178 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698