diff options
Diffstat (limited to 'deps/v8/src/log.cc')
-rw-r--r-- | deps/v8/src/log.cc | 64 |
1 files changed, 9 insertions, 55 deletions
diff --git a/deps/v8/src/log.cc b/deps/v8/src/log.cc index a3f484fd59..d78625a46a 100644 --- a/deps/v8/src/log.cc +++ b/deps/v8/src/log.cc @@ -349,7 +349,6 @@ void ExternalCodeEventListener::LogExistingCode() { HandleScope scope(isolate_); ExistingCodeLogger logger(isolate_, this); logger.LogCodeObjects(); - logger.LogBytecodeHandlers(); logger.LogCompiledFunctions(); } @@ -655,7 +654,7 @@ void JitLogger::LogRecordedBuffer(AbstractCode* code, SharedFunctionInfo* shared, const char* name, int length) { JitCodeEvent event; - memset(&event, 0, sizeof(event)); + memset(static_cast<void*>(&event), 0, sizeof(event)); event.type = JitCodeEvent::CODE_ADDED; event.code_start = reinterpret_cast<void*>(code->InstructionStart()); event.code_type = @@ -676,7 +675,7 @@ void JitLogger::LogRecordedBuffer(AbstractCode* code, void JitLogger::LogRecordedBuffer(const wasm::WasmCode* code, const char* name, int length) { JitCodeEvent event; - memset(&event, 0, sizeof(event)); + memset(static_cast<void*>(&event), 0, sizeof(event)); event.type = JitCodeEvent::CODE_ADDED; event.code_type = JitCodeEvent::JIT_CODE; event.code_start = code->instructions().start(); @@ -708,7 +707,7 @@ void JitLogger::AddCodeLinePosInfoEvent( int position, JitCodeEvent::PositionType position_type) { JitCodeEvent event; - memset(&event, 0, sizeof(event)); + memset(static_cast<void*>(&event), 0, sizeof(event)); event.type = JitCodeEvent::CODE_ADD_LINE_POS_INFO; event.user_data = jit_handler_data; event.line_info.offset = pc_offset; @@ -722,7 +721,7 @@ void JitLogger::AddCodeLinePosInfoEvent( void* JitLogger::StartCodePosInfoEvent() { JitCodeEvent event; - memset(&event, 0, sizeof(event)); + memset(static_cast<void*>(&event), 0, sizeof(event)); event.type = JitCodeEvent::CODE_START_LINE_INFO_RECORDING; event.isolate = reinterpret_cast<v8::Isolate*>(isolate_); @@ -733,7 +732,7 @@ void* JitLogger::StartCodePosInfoEvent() { void JitLogger::EndCodePosInfoEvent(Address start_address, void* jit_handler_data) { JitCodeEvent event; - memset(&event, 0, sizeof(event)); + memset(static_cast<void*>(&event), 0, sizeof(event)); event.type = JitCodeEvent::CODE_END_LINE_INFO_RECORDING; event.code_start = reinterpret_cast<void*>(start_address); event.user_data = jit_handler_data; @@ -794,7 +793,7 @@ class Profiler: public base::Thread { } } - virtual void Run(); + void Run() override; // Pause and Resume TickSample data collection. void Pause() { paused_ = true; } @@ -848,7 +847,7 @@ class Ticker: public sampler::Sampler { profiler_(nullptr), sampling_thread_(new SamplingThread(this, interval_microseconds)) {} - ~Ticker() { + ~Ticker() override { if (IsActive()) Stop(); delete sampling_thread_; } @@ -1323,7 +1322,7 @@ void Logger::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag, // <script-offset> is the position within the script // <inlining-id> is the offset in the <inlining> table // <inlining> table is a sequence of strings of the form - // F<function-id>O<script-offset>[I<inlining-id> + // F<function-id>O<script-offset>[I<inlining-id>] // where // <function-id> is an index into the <fns> function table // <fns> is the function table encoded as a sequence of strings @@ -1335,12 +1334,8 @@ void Logger::CodeCreateEvent(CodeEventListener::LogEventsAndTags tag, << shared->EndPosition() << kNext; SourcePositionTableIterator iterator(code->source_position_table()); - bool is_first = true; bool hasInlined = false; for (; !iterator.done(); iterator.Advance()) { - if (is_first) { - is_first = false; - } SourcePosition pos = iterator.source_position(); msg << "C" << iterator.code_offset() << "O" << pos.ScriptOffset(); if (pos.isInlined()) { @@ -1604,7 +1599,7 @@ bool Logger::EnsureLogScriptSource(Script* script) { // Make sure the script is written to the log file. int script_id = script->id(); if (logged_source_code_.find(script_id) != logged_source_code_.end()) { - return false; + return true; } // This script has not been logged yet. logged_source_code_.insert(script_id); @@ -1838,16 +1833,6 @@ void Logger::LogCodeObject(Object* object) { void Logger::LogCodeObjects() { existing_code_logger_.LogCodeObjects(); } -void Logger::LogBytecodeHandler(interpreter::Bytecode bytecode, - interpreter::OperandScale operand_scale, - Code* code) { - existing_code_logger_.LogBytecodeHandler(bytecode, operand_scale, code); -} - -void Logger::LogBytecodeHandlers() { - existing_code_logger_.LogBytecodeHandlers(); -} - void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared, Handle<AbstractCode> code) { existing_code_logger_.LogExistingFunction(shared, code); @@ -2162,37 +2147,6 @@ void ExistingCodeLogger::LogCompiledFunctions() { } } -void ExistingCodeLogger::LogBytecodeHandler( - interpreter::Bytecode bytecode, interpreter::OperandScale operand_scale, - Code* code) { - std::string bytecode_name = - interpreter::Bytecodes::ToString(bytecode, operand_scale); - CALL_CODE_EVENT_HANDLER( - CodeCreateEvent(CodeEventListener::BYTECODE_HANDLER_TAG, - AbstractCode::cast(code), bytecode_name.c_str())) -} - -void ExistingCodeLogger::LogBytecodeHandlers() { - const interpreter::OperandScale kOperandScales[] = { -#define VALUE(Name, _) interpreter::OperandScale::k##Name, - OPERAND_SCALE_LIST(VALUE) -#undef VALUE - }; - - const int last_index = static_cast<int>(interpreter::Bytecode::kLast); - interpreter::Interpreter* interpreter = isolate_->interpreter(); - for (auto operand_scale : kOperandScales) { - for (int index = 0; index <= last_index; ++index) { - interpreter::Bytecode bytecode = interpreter::Bytecodes::FromByte(index); - if (interpreter::Bytecodes::BytecodeHasHandler(bytecode, operand_scale)) { - Code* code = interpreter->GetBytecodeHandler(bytecode, operand_scale); - if (isolate_->heap()->IsDeserializeLazyHandler(code)) continue; - LogBytecodeHandler(bytecode, operand_scale, code); - } - } - } -} - void ExistingCodeLogger::LogExistingFunction( Handle<SharedFunctionInfo> shared, Handle<AbstractCode> code, CodeEventListener::LogEventsAndTags tag) { |