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

Unified Diff: src/objects.cc

Issue 1373903005: [Interpreter] Add for/while/do support to the bytecode generator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate feedback from mstarzinger which revealed use after destruction bug. Created 5 years, 3 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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 4f9773cf7ce427947af6c23877ba4d72078dde6d..51b8283fd9329e8e8a8f2c0cd3bd23c686c5db3c 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -12506,6 +12506,20 @@ void BytecodeArray::Disassemble(std::ostream& os) {
SNPrintF(buf, "%p", bytecode_start);
os << buf.start() << " : ";
interpreter::Bytecodes::Decode(os, bytecode_start, parameter_count());
+ if (bytecode == interpreter::Bytecode::kJump ||
+ bytecode == interpreter::Bytecode::kJumpIfTrue ||
+ bytecode == interpreter::Bytecode::kJumpIfFalse) {
rmcilroy 2015/10/01 09:18:56 nit - could we make a helper for IsJump, IsJumpCon
oth 2015/10/01 11:43:02 Done.
+ int offset = static_cast<int8_t>(bytecode_start[1]);
+ SNPrintF(buf, " (%p)", bytecode_start + offset);
+ os << buf.start();
+ } else if (bytecode == interpreter::Bytecode::kJumpConstant ||
+ bytecode == interpreter::Bytecode::kJumpIfTrueConstant ||
+ bytecode == interpreter::Bytecode::kJumpIfFalseConstant) {
+ int index = static_cast<int>(bytecode_start[1]);
+ int offset = Smi::cast(constant_pool()->get(index))->value();
+ SNPrintF(buf, " (%p)", bytecode_start + offset);
+ os << buf.start();
+ }
os << "\n";
}

Powered by Google App Engine
This is Rietveld 408576698