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

Unified Diff: src/interpreter/bytecode-array-builder.cc

Issue 1386313005: [Interpreter] Adds Object literal support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_literal_2
Patch Set: Created 5 years, 2 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/interpreter/bytecode-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index 1429ebad7c854c0dab0fa38b6450fd20f2ca88d6..5c7c9b37284858da19e60cc4c3b8857f04f7e528 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -374,6 +374,19 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral(
}
+BytecodeArrayBuilder& BytecodeArrayBuilder::CreateObjectLiteral(
+ int literal_index, int flags) {
+ DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bytes.
+ if (FitsInIdx8Operand(literal_index)) {
+ Output(Bytecode::kCreateObjectLiteral, static_cast<uint8_t>(literal_index),
+ static_cast<uint8_t>(flags));
+ } else {
+ UNIMPLEMENTED();
+ }
+ return *this;
+}
+
+
BytecodeArrayBuilder& BytecodeArrayBuilder::CreateClosure(
PretenureFlag tenured) {
DCHECK(FitsInImm8Operand(tenured));
@@ -413,6 +426,12 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CastAccumulatorToBoolean() {
}
+BytecodeArrayBuilder& BytecodeArrayBuilder::CastAccumulatorToName() {
+ Output(Bytecode::kToName);
+ return *this;
+}
+
+
BytecodeArrayBuilder& BytecodeArrayBuilder::Bind(BytecodeLabel* label) {
if (label->is_forward_target()) {
// An earlier jump instruction refers to this label. Update it's location.

Powered by Google App Engine
This is Rietveld 408576698