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

Unified Diff: src/objects.cc

Issue 1230753004: [Interpreter] Add BytecodeArray class and add to SharedFunctionInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Additional object methods for BytecodeArray. Created 5 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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index d16bd828b43bf310e290840e3a5f9ee1175ef422..6f45f694fe49c28d558cfbe70c3b3ec818e6ff29 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -31,6 +31,7 @@
#include "src/heap/objects-visiting-inl.h"
#include "src/hydrogen.h"
#include "src/ic/ic.h"
+#include "src/interpreter/bytecodes.h"
#include "src/log.h"
#include "src/lookup.h"
#include "src/macro-assembler.h"
@@ -1250,6 +1251,9 @@ void HeapObject::HeapObjectShortPrint(std::ostream& os) { // NOLINT
case BYTE_ARRAY_TYPE:
os << "<ByteArray[" << ByteArray::cast(this)->length() << "]>";
break;
+ case BYTECODE_ARRAY_TYPE:
+ os << "<BytecodeArray[" << BytecodeArray::cast(this)->length() << "]>";
+ break;
case FREE_SPACE_TYPE:
os << "<FreeSpace[" << FreeSpace::cast(this)->Size() << "]>";
break;
@@ -1476,6 +1480,7 @@ void HeapObject::IterateBody(InstanceType type, int object_size,
case FLOAT32X4_TYPE:
case FILLER_TYPE:
case BYTE_ARRAY_TYPE:
+ case BYTECODE_ARRAY_TYPE:
case FREE_SPACE_TYPE:
break;
@@ -11791,6 +11796,15 @@ void Code::Disassemble(const char* name, std::ostream& os) { // NOLINT
#endif // ENABLE_DISASSEMBLER
+void BytecodeArray::Disassemble(std::ostream& os) {
+ for (int i = 0; i < this->length(); i++) {
+ byte bc = this->get(i);
+ os << i << " : " << this->get(i) << " "
+ << static_cast<interpreter::Bytecode>(bc) << "\n";
rmcilroy 2015/07/16 10:29:44 We will need to do something more complex than thi
oth 2015/07/16 13:14:39 Ack. Sync'ed with current Bytecode representation
+ }
+}
+
+
// static
void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) {
DCHECK(capacity >= 0);
« src/interpreter/interpreter.cc ('K') | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698