diff options
author | Michaël Zasso <targos@protonmail.com> | 2016-09-06 22:49:51 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2016-09-22 09:51:19 +0200 |
commit | ec02b811a8a5c999bab4de312be2d732b7d9d50b (patch) | |
tree | ca3068017254f238cf413a451c57a803572983a4 /deps/v8/src/disassembler.cc | |
parent | d2eb7ce0105369a9cad82787cb33a665e9bd00ad (diff) | |
download | android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.tar.gz android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.tar.bz2 android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.zip |
deps: update V8 to 5.4.500.27
Pick up latest commit from the 5.4-lkgr branch.
deps: edit V8 gitignore to allow trace event copy
deps: update V8 trace event to 315bf1e2d45be7d53346c31cfcc37424a32c30c8
deps: edit V8 gitignore to allow gtest_prod.h copy
deps: update V8 gtest to 6f8a66431cb592dad629028a50b3dd418a408c87
PR-URL: https://github.com/nodejs/node/pull/8317
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'deps/v8/src/disassembler.cc')
-rw-r--r-- | deps/v8/src/disassembler.cc | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/deps/v8/src/disassembler.cc b/deps/v8/src/disassembler.cc index ed9ca9ac66..1da917167f 100644 --- a/deps/v8/src/disassembler.cc +++ b/deps/v8/src/disassembler.cc @@ -4,11 +4,14 @@ #include "src/disassembler.h" +#include <memory> + #include "src/code-stubs.h" #include "src/codegen.h" #include "src/debug/debug.h" #include "src/deoptimizer.h" #include "src/disasm.h" +#include "src/ic/ic.h" #include "src/macro-assembler.h" #include "src/snapshot/serializer-common.h" #include "src/string-stream.h" @@ -36,7 +39,7 @@ const char* V8NameConverter::NameOfAddress(byte* pc) const { code_ == NULL ? NULL : code_->GetIsolate()->builtins()->Lookup(pc); if (name != NULL) { - SNPrintF(v8_buffer_, "%s (%p)", name, pc); + SNPrintF(v8_buffer_, "%s (%p)", name, static_cast<void*>(pc)); return v8_buffer_.start(); } @@ -44,7 +47,7 @@ const char* V8NameConverter::NameOfAddress(byte* pc) const { int offs = static_cast<int>(pc - code_->instruction_start()); // print as code offset, if it seems reasonable if (0 <= offs && offs < code_->instruction_size()) { - SNPrintF(v8_buffer_, "%d (%p)", offs, pc); + SNPrintF(v8_buffer_, "%d (%p)", offs, static_cast<void*>(pc)); return v8_buffer_.start(); } } @@ -109,10 +112,9 @@ static int DecodeIt(Isolate* isolate, std::ostream* os, it->rinfo()->rmode() == RelocInfo::INTERNAL_REFERENCE) { // raw pointer embedded in code stream, e.g., jump table byte* ptr = *reinterpret_cast<byte**>(pc); - SNPrintF(decode_buffer, - "%08" V8PRIxPTR " jump table entry %4" V8PRIdPTR, - reinterpret_cast<intptr_t>(ptr), - ptr - begin); + SNPrintF( + decode_buffer, "%08" V8PRIxPTR " jump table entry %4" PRIuS, + reinterpret_cast<intptr_t>(ptr), static_cast<size_t>(ptr - begin)); pc += sizeof(ptr); } else { decode_buffer[0] = '\0'; @@ -147,7 +149,8 @@ static int DecodeIt(Isolate* isolate, std::ostream* os, } // Instruction address and instruction offset. - out.AddFormatted("%p %4d ", prev_pc, prev_pc - begin); + out.AddFormatted("%p %4" V8PRIdPTRDIFF " ", static_cast<void*>(prev_pc), + prev_pc - begin); // Instruction. out.AddFormatted("%s", decode_buffer.start()); @@ -169,22 +172,22 @@ static int DecodeIt(Isolate* isolate, std::ostream* os, } RelocInfo::Mode rmode = relocinfo.rmode(); - if (RelocInfo::IsPosition(rmode)) { - if (RelocInfo::IsStatementPosition(rmode)) { - out.AddFormatted(" ;; debug: statement %d", relocinfo.data()); - } else { - out.AddFormatted(" ;; debug: position %d", relocinfo.data()); - } + if (rmode == RelocInfo::DEOPT_POSITION) { + out.AddFormatted(" ;; debug: deopt position '%d'", + static_cast<int>(relocinfo.data())); } else if (rmode == RelocInfo::DEOPT_REASON) { - Deoptimizer::DeoptReason reason = - static_cast<Deoptimizer::DeoptReason>(relocinfo.data()); + DeoptimizeReason reason = + static_cast<DeoptimizeReason>(relocinfo.data()); out.AddFormatted(" ;; debug: deopt reason '%s'", - Deoptimizer::GetDeoptReason(reason)); + DeoptimizeReasonToString(reason)); + } else if (rmode == RelocInfo::DEOPT_ID) { + out.AddFormatted(" ;; debug: deopt index %d", + static_cast<int>(relocinfo.data())); } else if (rmode == RelocInfo::EMBEDDED_OBJECT) { HeapStringAllocator allocator; StringStream accumulator(&allocator); relocinfo.target_object()->ShortPrint(&accumulator); - base::SmartArrayPointer<const char> obj_name = accumulator.ToCString(); + std::unique_ptr<char[]> obj_name = accumulator.ToCString(); out.AddFormatted(" ;; object: %s", obj_name.get()); } else if (rmode == RelocInfo::EXTERNAL_REFERENCE) { const char* reference_name = ref_encoder.NameOfAddress( @@ -195,17 +198,15 @@ static int DecodeIt(Isolate* isolate, std::ostream* os, Code* code = Code::GetCodeFromTargetAddress(relocinfo.target_address()); Code::Kind kind = code->kind(); if (code->is_inline_cache_stub()) { - if (kind == Code::LOAD_IC && - LoadICState::GetTypeofMode(code->extra_ic_state()) == - NOT_INSIDE_TYPEOF) { - out.AddFormatted(" contextual,"); + if (kind == Code::LOAD_GLOBAL_IC && + LoadGlobalICState::GetTypeofMode(code->extra_ic_state()) == + INSIDE_TYPEOF) { + out.AddFormatted(" inside typeof,"); } - InlineCacheState ic_state = code->ic_state(); - out.AddFormatted(" %s, %s", Code::Kind2String(kind), - Code::ICState2String(ic_state)); - if (ic_state == MONOMORPHIC) { - Code::StubType type = code->type(); - out.AddFormatted(", %s", Code::StubType2String(type)); + out.AddFormatted(" %s", Code::Kind2String(kind)); + if (!IC::ICUseVector(kind)) { + InlineCacheState ic_state = IC::StateFromCode(code); + out.AddFormatted(" %s", Code::ICState2String(ic_state)); } } else if (kind == Code::STUB || kind == Code::HANDLER) { // Get the STUB key and extract major and minor key. |