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" |
| 13 #include "src/interpreter/bytecode-flags.h" |
| 14 #include "src/interpreter/bytecode-register.h" |
12 #include "src/interpreter/bytecodes.h" | 15 #include "src/interpreter/bytecodes.h" |
13 #include "src/isolate-inl.h" | 16 #include "src/isolate-inl.h" |
14 #include "src/ostreams.h" | 17 #include "src/ostreams.h" |
15 | 18 |
16 namespace v8 { | 19 namespace v8 { |
17 namespace internal { | 20 namespace internal { |
18 | 21 |
19 RUNTIME_FUNCTION(Runtime_InterpreterNewClosure) { | 22 RUNTIME_FUNCTION(Runtime_InterpreterNewClosure) { |
20 HandleScope scope(isolate); | 23 HandleScope scope(isolate); |
21 DCHECK_EQ(2, args.length()); | 24 DCHECK_EQ(2, args.length()); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 113 |
111 int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag; | 114 int offset = bytecode_offset - BytecodeArray::kHeaderSize + kHeapObjectTag; |
112 interpreter::BytecodeArrayIterator bytecode_iterator(bytecode_array); | 115 interpreter::BytecodeArrayIterator bytecode_iterator(bytecode_array); |
113 AdvanceToOffsetForTracing(bytecode_iterator, offset); | 116 AdvanceToOffsetForTracing(bytecode_iterator, offset); |
114 if (offset == bytecode_iterator.current_offset()) { | 117 if (offset == bytecode_iterator.current_offset()) { |
115 // Print bytecode. | 118 // Print bytecode. |
116 const uint8_t* base_address = bytecode_array->GetFirstBytecodeAddress(); | 119 const uint8_t* base_address = bytecode_array->GetFirstBytecodeAddress(); |
117 const uint8_t* bytecode_address = base_address + offset; | 120 const uint8_t* bytecode_address = base_address + offset; |
118 os << " -> " << static_cast<const void*>(bytecode_address) << " @ " | 121 os << " -> " << static_cast<const void*>(bytecode_address) << " @ " |
119 << std::setw(4) << offset << " : "; | 122 << std::setw(4) << offset << " : "; |
120 interpreter::Bytecodes::Decode(os, bytecode_address, | 123 interpreter::BytecodeDecoder::Decode(os, bytecode_address, |
121 bytecode_array->parameter_count()); | 124 bytecode_array->parameter_count()); |
122 os << std::endl; | 125 os << std::endl; |
123 // Print all input registers and accumulator. | 126 // Print all input registers and accumulator. |
124 PrintRegisters(os, true, bytecode_iterator, accumulator); | 127 PrintRegisters(os, true, bytecode_iterator, accumulator); |
125 | 128 |
126 os << std::flush; | 129 os << std::flush; |
127 } | 130 } |
128 return isolate->heap()->undefined_value(); | 131 return isolate->heap()->undefined_value(); |
129 } | 132 } |
130 | 133 |
131 RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeExit) { | 134 RUNTIME_FUNCTION(Runtime_InterpreterTraceBytecodeExit) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 RUNTIME_FUNCTION(Runtime_InterpreterSetPendingMessage) { | 166 RUNTIME_FUNCTION(Runtime_InterpreterSetPendingMessage) { |
164 SealHandleScope shs(isolate); | 167 SealHandleScope shs(isolate); |
165 DCHECK_EQ(1, args.length()); | 168 DCHECK_EQ(1, args.length()); |
166 CONVERT_ARG_HANDLE_CHECKED(Object, message, 0); | 169 CONVERT_ARG_HANDLE_CHECKED(Object, message, 0); |
167 isolate->thread_local_top()->pending_message_obj_ = *message; | 170 isolate->thread_local_top()->pending_message_obj_ = *message; |
168 return isolate->heap()->undefined_value(); | 171 return isolate->heap()->undefined_value(); |
169 } | 172 } |
170 | 173 |
171 } // namespace internal | 174 } // namespace internal |
172 } // namespace v8 | 175 } // namespace v8 |
OLD | NEW |