OLD | NEW |
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(2, 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_SMI_ARG_CHECKED(pretenured_flag, 1); | 26 CONVERT_SMI_ARG_CHECKED(pretenured_flag, 3); |
27 Handle<Context> context(isolate->context(), isolate); | 27 Handle<Context> context(isolate->context(), isolate); |
28 return *isolate->factory()->NewFunctionFromSharedFunctionInfo( | 28 return *isolate->factory()->NewFunctionFromSharedFunctionInfo( |
29 shared, context, static_cast<PretenureFlag>(pretenured_flag)); | 29 shared, context, static_cast<PretenureFlag>(pretenured_flag)); |
30 } | 30 } |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
34 void AdvanceToOffsetForTracing( | 34 void AdvanceToOffsetForTracing( |
35 interpreter::BytecodeArrayIterator& bytecode_iterator, int offset) { | 35 interpreter::BytecodeArrayIterator& bytecode_iterator, int offset) { |
36 while (bytecode_iterator.current_offset() + | 36 while (bytecode_iterator.current_offset() + |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag; | 164 int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag; |
165 while (it.current_offset() < offset) it.Advance(); | 165 while (it.current_offset() < offset) it.Advance(); |
166 DCHECK_EQ(offset, it.current_offset()); | 166 DCHECK_EQ(offset, it.current_offset()); |
167 it.Advance(); // Advance by one bytecode. | 167 it.Advance(); // Advance by one bytecode. |
168 offset = it.current_offset() + BytecodeArray::kHeaderSize - kHeapObjectTag; | 168 offset = it.current_offset() + BytecodeArray::kHeaderSize - kHeapObjectTag; |
169 return Smi::FromInt(offset); | 169 return Smi::FromInt(offset); |
170 } | 170 } |
171 | 171 |
172 } // namespace internal | 172 } // namespace internal |
173 } // namespace v8 | 173 } // namespace v8 |
OLD | NEW |