OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/log.h" | 5 #include "src/log.h" |
6 | 6 |
7 #include <cstdarg> | 7 #include <cstdarg> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1600 DisallowHeapAllocation no_gc; | 1600 DisallowHeapAllocation no_gc; |
1601 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { | 1601 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { |
1602 if (obj->IsCode()) LogCodeObject(obj); | 1602 if (obj->IsCode()) LogCodeObject(obj); |
1603 if (obj->IsBytecodeArray()) LogCodeObject(obj); | 1603 if (obj->IsBytecodeArray()) LogCodeObject(obj); |
1604 } | 1604 } |
1605 } | 1605 } |
1606 | 1606 |
1607 void Logger::LogBytecodeHandlers() { | 1607 void Logger::LogBytecodeHandlers() { |
1608 if (!FLAG_ignition) return; | 1608 if (!FLAG_ignition) return; |
1609 | 1609 |
| 1610 interpreter::Interpreter* interpreter = isolate_->interpreter(); |
1610 const int last_index = static_cast<int>(interpreter::Bytecode::kLast); | 1611 const int last_index = static_cast<int>(interpreter::Bytecode::kLast); |
1611 for (int index = 0; index <= last_index; ++index) { | 1612 for (auto operand_scale = interpreter::OperandScale::k1X; |
1612 interpreter::Bytecode bytecode = interpreter::Bytecodes::FromByte(index); | 1613 operand_scale <= interpreter::OperandScale::kMaxValid; |
1613 Code* code = isolate_->interpreter()->GetBytecodeHandler(bytecode); | 1614 operand_scale = |
1614 CodeCreateEvent(Logger::BYTECODE_HANDLER_TAG, AbstractCode::cast(code), | 1615 interpreter::Bytecodes::NextOperandScale(operand_scale)) { |
1615 interpreter::Bytecodes::ToString(bytecode)); | 1616 for (int index = 0; index <= last_index; ++index) { |
| 1617 interpreter::Bytecode bytecode = interpreter::Bytecodes::FromByte(index); |
| 1618 if (interpreter::Interpreter::BytecodeHasHandler(bytecode, |
| 1619 operand_scale)) { |
| 1620 Code* code = interpreter->GetBytecodeHandler(bytecode, operand_scale); |
| 1621 std::string bytecode_name = |
| 1622 interpreter::Bytecodes::ToString(bytecode, operand_scale); |
| 1623 CodeCreateEvent(Logger::BYTECODE_HANDLER_TAG, AbstractCode::cast(code), |
| 1624 bytecode_name.c_str()); |
| 1625 } |
| 1626 } |
1616 } | 1627 } |
1617 } | 1628 } |
1618 | 1629 |
1619 void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared, | 1630 void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared, |
1620 Handle<AbstractCode> code) { | 1631 Handle<AbstractCode> code) { |
1621 Handle<String> func_name(shared->DebugName()); | 1632 Handle<String> func_name(shared->DebugName()); |
1622 if (shared->script()->IsScript()) { | 1633 if (shared->script()->IsScript()) { |
1623 Handle<Script> script(Script::cast(shared->script())); | 1634 Handle<Script> script(Script::cast(shared->script())); |
1624 int line_num = Script::GetLineNumber(script, shared->start_position()) + 1; | 1635 int line_num = Script::GetLineNumber(script, shared->start_position()) + 1; |
1625 int column_num = | 1636 int column_num = |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1864 removeCodeEventListener(jit_logger_); | 1875 removeCodeEventListener(jit_logger_); |
1865 delete jit_logger_; | 1876 delete jit_logger_; |
1866 jit_logger_ = NULL; | 1877 jit_logger_ = NULL; |
1867 } | 1878 } |
1868 | 1879 |
1869 return log_->Close(); | 1880 return log_->Close(); |
1870 } | 1881 } |
1871 | 1882 |
1872 } // namespace internal | 1883 } // namespace internal |
1873 } // namespace v8 | 1884 } // namespace v8 |
OLD | NEW |