Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: src/disassembler.cc

Issue 407383004: Do not reverse lookup code stubs dictionary. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/disassembler.cc
diff --git a/src/disassembler.cc b/src/disassembler.cc
index f1c28e8199f52d835cb619092f9214c6417096f3..d58e1b073f0f2a0a43eafafe2e65573904296ba0 100644
--- a/src/disassembler.cc
+++ b/src/disassembler.cc
@@ -95,7 +95,6 @@ static int DecodeIt(Isolate* isolate,
SealHandleScope shs(isolate);
DisallowHeapAllocation no_alloc;
ExternalReferenceEncoder ref_encoder(isolate);
- Heap* heap = isolate->heap();
v8::internal::EmbeddedVector<char, 128> decode_buffer;
v8::internal::EmbeddedVector<char, kOutBufferSize> out_buffer;
@@ -226,29 +225,21 @@ static int DecodeIt(Isolate* isolate,
out.AddFormatted(", %s", Code::StubType2String(type));
}
} else if (kind == Code::STUB || kind == Code::HANDLER) {
- // Reverse lookup required as the minor key cannot be retrieved
- // from the code object.
- Object* obj = heap->code_stubs()->SlowReverseLookup(code);
- if (obj != heap->undefined_value()) {
- ASSERT(obj->IsSmi());
- // Get the STUB key and extract major and minor key.
- uint32_t key = Smi::cast(obj)->value();
- uint32_t minor_key = CodeStub::MinorKeyFromKey(key);
- CodeStub::Major major_key = CodeStub::GetMajorKey(code);
- ASSERT(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);
+ // Get the STUB key and extract major and minor key.
+ uint32_t key = code->stub_key();
+ uint32_t minor_key = CodeStub::MinorKeyFromKey(key);
+ CodeStub::Major major_key = CodeStub::GetMajorKey(code);
+ ASSERT(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);
}
} else {
out.AddFormatted(" %s", Code::Kind2String(kind));
« no previous file with comments | « src/debug.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698