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