Upgrade V8 to version 4.9.385.28
https://chromium.googlesource.com/v8/v8/+/4.9.385.28
FPIIM-449
Change-Id: I4b2e74289d4bf3667f2f3dc8aa2e541f63e26eb4
diff --git a/src/disassembler.cc b/src/disassembler.cc
index bedff45..59a57e5 100644
--- a/src/disassembler.cc
+++ b/src/disassembler.cc
@@ -2,16 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "src/v8.h"
+#include "src/disassembler.h"
#include "src/code-stubs.h"
#include "src/codegen.h"
-#include "src/debug.h"
+#include "src/debug/debug.h"
#include "src/deoptimizer.h"
#include "src/disasm.h"
-#include "src/disassembler.h"
#include "src/macro-assembler.h"
-#include "src/serialize.h"
+#include "src/snapshot/serialize.h"
#include "src/string-stream.h"
namespace v8 {
@@ -33,7 +32,9 @@
const char* V8NameConverter::NameOfAddress(byte* pc) const {
- const char* name = code_->GetIsolate()->builtins()->Lookup(pc);
+ const char* name =
+ code_ == NULL ? NULL : code_->GetIsolate()->builtins()->Lookup(pc);
+
if (name != NULL) {
SNPrintF(v8_buffer_, "%s (%p)", name, pc);
return v8_buffer_.start();
@@ -100,8 +101,8 @@
int num_const = d.ConstantPoolSizeAt(pc);
if (num_const >= 0) {
SNPrintF(decode_buffer,
- "%08x constant pool begin",
- *reinterpret_cast<int32_t*>(pc));
+ "%08x constant pool begin (num_const = %d)",
+ *reinterpret_cast<int32_t*>(pc), num_const);
constants = num_const;
pc += 4;
} else if (it != NULL && !it->done() && it->rinfo()->pc() == pc &&
@@ -112,7 +113,7 @@
"%08" V8PRIxPTR " jump table entry %4" V8PRIdPTR,
reinterpret_cast<intptr_t>(ptr),
ptr - begin);
- pc += 4;
+ pc += sizeof(ptr);
} else {
decode_buffer[0] = '\0';
pc += d.InstructionDecode(decode_buffer, pc);
@@ -154,7 +155,8 @@
// Print all the reloc info for this instruction which are not comments.
for (int i = 0; i < pcs.length(); i++) {
// Put together the reloc info
- RelocInfo relocinfo(pcs[i], rmodes[i], datas[i], converter.code());
+ RelocInfo relocinfo(isolate, pcs[i], rmodes[i], datas[i],
+ converter.code());
// Indent the printing of the reloc info.
if (i == 0) {
@@ -173,27 +175,29 @@
} else {
out.AddFormatted(" ;; debug: position %d", relocinfo.data());
}
+ } else if (rmode == RelocInfo::DEOPT_REASON) {
+ Deoptimizer::DeoptReason reason =
+ static_cast<Deoptimizer::DeoptReason>(relocinfo.data());
+ out.AddFormatted(" ;; debug: deopt reason '%s'",
+ Deoptimizer::GetDeoptReason(reason));
} else if (rmode == RelocInfo::EMBEDDED_OBJECT) {
HeapStringAllocator allocator;
StringStream accumulator(&allocator);
relocinfo.target_object()->ShortPrint(&accumulator);
- SmartArrayPointer<const char> obj_name = accumulator.ToCString();
+ base::SmartArrayPointer<const 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(relocinfo.target_reference());
+ const char* reference_name = ref_encoder.NameOfAddress(
+ isolate, relocinfo.target_external_reference());
out.AddFormatted(" ;; external reference (%s)", reference_name);
} else if (RelocInfo::IsCodeTarget(rmode)) {
out.AddFormatted(" ;; code:");
- if (rmode == RelocInfo::CONSTRUCT_CALL) {
- out.AddFormatted(" constructor,");
- }
Code* code = Code::GetCodeFromTargetAddress(relocinfo.target_address());
Code::Kind kind = code->kind();
if (code->is_inline_cache_stub()) {
if (kind == Code::LOAD_IC &&
- LoadICState::GetContextualMode(code->extra_ic_state()) ==
- CONTEXTUAL) {
+ LoadICState::GetTypeofMode(code->extra_ic_state()) ==
+ NOT_INSIDE_TYPEOF) {
out.AddFormatted(" contextual,");
}
InlineCacheState ic_state = code->ic_state();
@@ -210,16 +214,8 @@
CodeStub::Major major_key = CodeStub::GetMajorKey(code);
DCHECK(major_key == CodeStub::MajorKeyFromKey(key));
out.AddFormatted(" %s, %s, ", Code::Kind2String(kind),
- CodeStub::MajorName(major_key, false));
- switch (major_key) {
- case CodeStub::CallFunction: {
- int argc = CallFunctionStub::ExtractArgcFromMinorKey(minor_key);
- out.AddFormatted("argc = %d", argc);
- break;
- }
- default:
- out.AddFormatted("minor: %d", minor_key);
- }
+ CodeStub::MajorName(major_key));
+ out.AddFormatted("minor: %d", minor_key);
} else {
out.AddFormatted(" %s", Code::Kind2String(kind));
}
@@ -290,4 +286,5 @@
#endif // ENABLE_DISASSEMBLER
-} } // namespace v8::internal
+} // namespace internal
+} // namespace v8