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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 interpreter::OperandScale::kSingle || | 148 interpreter::OperandScale::kSingle || |
149 offset > bytecode_iterator.current_offset()) { | 149 offset > bytecode_iterator.current_offset()) { |
150 OFStream os(stdout); | 150 OFStream os(stdout); |
151 // Print all output registers and accumulator. | 151 // Print all output registers and accumulator. |
152 PrintRegisters(os, false, bytecode_iterator, accumulator); | 152 PrintRegisters(os, false, bytecode_iterator, accumulator); |
153 os << std::flush; | 153 os << std::flush; |
154 } | 154 } |
155 return isolate->heap()->undefined_value(); | 155 return isolate->heap()->undefined_value(); |
156 } | 156 } |
157 | 157 |
158 RUNTIME_FUNCTION(Runtime_InterpreterClearPendingMessage) { | |
159 SealHandleScope shs(isolate); | |
160 DCHECK_EQ(0, args.length()); | |
161 Object* message = isolate->thread_local_top()->pending_message_obj_; | |
162 isolate->clear_pending_message(); | |
163 return message; | |
164 } | |
165 | |
166 RUNTIME_FUNCTION(Runtime_InterpreterSetPendingMessage) { | |
167 SealHandleScope shs(isolate); | |
168 DCHECK_EQ(1, args.length()); | |
169 CONVERT_ARG_HANDLE_CHECKED(Object, message, 0); | |
170 isolate->thread_local_top()->pending_message_obj_ = *message; | |
171 return isolate->heap()->undefined_value(); | |
172 } | |
173 | |
174 RUNTIME_FUNCTION(Runtime_InterpreterAdvanceBytecodeOffset) { | 158 RUNTIME_FUNCTION(Runtime_InterpreterAdvanceBytecodeOffset) { |
175 SealHandleScope shs(isolate); | 159 SealHandleScope shs(isolate); |
176 DCHECK_EQ(2, args.length()); | 160 DCHECK_EQ(2, args.length()); |
177 CONVERT_ARG_HANDLE_CHECKED(BytecodeArray, bytecode_array, 0); | 161 CONVERT_ARG_HANDLE_CHECKED(BytecodeArray, bytecode_array, 0); |
178 CONVERT_SMI_ARG_CHECKED(bytecode_offset, 1); | 162 CONVERT_SMI_ARG_CHECKED(bytecode_offset, 1); |
179 interpreter::BytecodeArrayIterator it(bytecode_array); | 163 interpreter::BytecodeArrayIterator it(bytecode_array); |
180 int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag; | 164 int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag; |
181 while (it.current_offset() < offset) it.Advance(); | 165 while (it.current_offset() < offset) it.Advance(); |
182 DCHECK_EQ(offset, it.current_offset()); | 166 DCHECK_EQ(offset, it.current_offset()); |
183 it.Advance(); // Advance by one bytecode. | 167 it.Advance(); // Advance by one bytecode. |
184 offset = it.current_offset() + BytecodeArray::kHeaderSize - kHeapObjectTag; | 168 offset = it.current_offset() + BytecodeArray::kHeaderSize - kHeapObjectTag; |
185 return Smi::FromInt(offset); | 169 return Smi::FromInt(offset); |
186 } | 170 } |
187 | 171 |
188 } // namespace internal | 172 } // namespace internal |
189 } // namespace v8 | 173 } // namespace v8 |
OLD | NEW |