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

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

Issue 2674593003: [TypeFeedbackVector] Root feedback vectors at function literal site. (Closed)
Patch Set: REBASE+liveedit fix. 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/profiler/heap-snapshot-generator.cc ('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"
11 #include "src/interpreter/bytecode-array-iterator.h" 11 #include "src/interpreter/bytecode-array-iterator.h"
12 #include "src/interpreter/bytecode-decoder.h" 12 #include "src/interpreter/bytecode-decoder.h"
13 #include "src/interpreter/bytecode-flags.h" 13 #include "src/interpreter/bytecode-flags.h"
14 #include "src/interpreter/bytecode-register.h" 14 #include "src/interpreter/bytecode-register.h"
15 #include "src/interpreter/bytecodes.h" 15 #include "src/interpreter/bytecodes.h"
16 #include "src/isolate-inl.h" 16 #include "src/isolate-inl.h"
17 #include "src/ostreams.h" 17 #include "src/ostreams.h"
18 18
19 namespace v8 { 19 namespace v8 {
20 namespace internal { 20 namespace internal {
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(TypeFeedbackVector, vector, 1);
27 CONVERT_SMI_ARG_CHECKED(index, 2);
26 CONVERT_SMI_ARG_CHECKED(pretenured_flag, 3); 28 CONVERT_SMI_ARG_CHECKED(pretenured_flag, 3);
27 Handle<Context> context(isolate->context(), isolate); 29 Handle<Context> context(isolate->context(), isolate);
30 FeedbackVectorSlot slot = TypeFeedbackVector::ToSlot(index);
31 Handle<Cell> literals(Cell::cast(vector->Get(slot)), isolate);
28 return *isolate->factory()->NewFunctionFromSharedFunctionInfo( 32 return *isolate->factory()->NewFunctionFromSharedFunctionInfo(
29 shared, context, static_cast<PretenureFlag>(pretenured_flag)); 33 shared, context, literals, static_cast<PretenureFlag>(pretenured_flag));
30 } 34 }
31 35
32 namespace { 36 namespace {
33 37
34 void AdvanceToOffsetForTracing( 38 void AdvanceToOffsetForTracing(
35 interpreter::BytecodeArrayIterator& bytecode_iterator, int offset) { 39 interpreter::BytecodeArrayIterator& bytecode_iterator, int offset) {
36 while (bytecode_iterator.current_offset() + 40 while (bytecode_iterator.current_offset() +
37 bytecode_iterator.current_bytecode_size() <= 41 bytecode_iterator.current_bytecode_size() <=
38 offset) { 42 offset) {
39 bytecode_iterator.Advance(); 43 bytecode_iterator.Advance();
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag; 168 int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag;
165 while (it.current_offset() < offset) it.Advance(); 169 while (it.current_offset() < offset) it.Advance();
166 DCHECK_EQ(offset, it.current_offset()); 170 DCHECK_EQ(offset, it.current_offset());
167 it.Advance(); // Advance by one bytecode. 171 it.Advance(); // Advance by one bytecode.
168 offset = it.current_offset() + BytecodeArray::kHeaderSize - kHeapObjectTag; 172 offset = it.current_offset() + BytecodeArray::kHeaderSize - kHeapObjectTag;
169 return Smi::FromInt(offset); 173 return Smi::FromInt(offset);
170 } 174 }
171 175
172 } // namespace internal 176 } // namespace internal
173 } // namespace v8 177 } // namespace v8
OLDNEW
« no previous file with comments | « src/profiler/heap-snapshot-generator.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698