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" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } | 164 } |
165 | 165 |
166 RUNTIME_FUNCTION(Runtime_InterpreterSetPendingMessage) { | 166 RUNTIME_FUNCTION(Runtime_InterpreterSetPendingMessage) { |
167 SealHandleScope shs(isolate); | 167 SealHandleScope shs(isolate); |
168 DCHECK_EQ(1, args.length()); | 168 DCHECK_EQ(1, args.length()); |
169 CONVERT_ARG_HANDLE_CHECKED(Object, message, 0); | 169 CONVERT_ARG_HANDLE_CHECKED(Object, message, 0); |
170 isolate->thread_local_top()->pending_message_obj_ = *message; | 170 isolate->thread_local_top()->pending_message_obj_ = *message; |
171 return isolate->heap()->undefined_value(); | 171 return isolate->heap()->undefined_value(); |
172 } | 172 } |
173 | 173 |
| 174 RUNTIME_FUNCTION(Runtime_InterpreterAdvanceBytecodeOffset) { |
| 175 SealHandleScope shs(isolate); |
| 176 DCHECK_EQ(2, args.length()); |
| 177 CONVERT_ARG_HANDLE_CHECKED(BytecodeArray, bytecode_array, 0); |
| 178 CONVERT_SMI_ARG_CHECKED(bytecode_offset, 1); |
| 179 interpreter::BytecodeArrayIterator it(bytecode_array); |
| 180 int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag; |
| 181 while (it.current_offset() < offset) it.Advance(); |
| 182 DCHECK_EQ(offset, it.current_offset()); |
| 183 it.Advance(); // Advance by one bytecode. |
| 184 offset = it.current_offset() + BytecodeArray::kHeaderSize - kHeapObjectTag; |
| 185 return Smi::FromInt(offset); |
| 186 } |
| 187 |
174 } // namespace internal | 188 } // namespace internal |
175 } // namespace v8 | 189 } // namespace v8 |
OLD | NEW |