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

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

Issue 1503963002: [Interpreter] Adds wide variant of CreateLiterals. Adds CreateLiterals to BytecodeGraphBuilder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 594d8faa25e02dec182eae96e94f802eaa01dd58..1d97f0743e70c0a9e38c2102f233bccd638fdc44 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -529,11 +529,12 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArguments(
BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRegExpLiteral(
- int literal_index, int flags) {
+ Handle<String> pattern, int literal_index, int flags) {
DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bits.
- if (FitsInIdx8Operand(literal_index)) {
- Output(Bytecode::kCreateRegExpLiteral, static_cast<uint8_t>(literal_index),
- static_cast<uint8_t>(flags));
+ size_t pattern_entry = GetConstantPoolEntry(pattern);
+ if (FitsInIdx8Operand(literal_index) && FitsInIdx8Operand(pattern_entry)) {
+ Output(Bytecode::kCreateRegExpLiteral, static_cast<uint8_t>(pattern_entry),
+ static_cast<uint8_t>(literal_index), static_cast<uint8_t>(flags));
} else {
rmcilroy 2015/12/07 14:33:22 Are you adding wide variants in this CL or a subse
mythria 2015/12/07 15:11:18 Added wide variants with patchset2.
UNIMPLEMENTED();
}
@@ -542,11 +543,14 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRegExpLiteral(
BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral(
- int literal_index, int flags) {
+ Handle<FixedArray> constant_elements, int literal_index, int flags) {
DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bits.
- if (FitsInIdx8Operand(literal_index)) {
- Output(Bytecode::kCreateArrayLiteral, static_cast<uint8_t>(literal_index),
- static_cast<uint8_t>(flags));
+ size_t cons_element_entry = GetConstantPoolEntry(constant_elements);
rmcilroy 2015/12/07 14:33:22 don't abbreviate (cons_element_entry -> constant_e
mythria 2015/12/07 15:11:18 Done.
+ if (FitsInIdx8Operand(literal_index) &&
+ FitsInIdx8Operand(cons_element_entry)) {
+ Output(Bytecode::kCreateArrayLiteral,
+ static_cast<uint8_t>(cons_element_entry),
+ static_cast<uint8_t>(literal_index), static_cast<uint8_t>(flags));
} else {
UNIMPLEMENTED();
}
@@ -555,11 +559,14 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral(
BytecodeArrayBuilder& BytecodeArrayBuilder::CreateObjectLiteral(
- int literal_index, int flags) {
+ Handle<FixedArray> constant_properties, int literal_index, int flags) {
DCHECK(FitsInImm8Operand(flags)); // Flags should fit in 8 bits.
- if (FitsInIdx8Operand(literal_index)) {
- Output(Bytecode::kCreateObjectLiteral, static_cast<uint8_t>(literal_index),
- static_cast<uint8_t>(flags));
+ size_t cons_property_entry = GetConstantPoolEntry(constant_properties);
rmcilroy 2015/12/07 14:33:22 ditto
mythria 2015/12/07 15:11:18 Done.
+ if (FitsInIdx8Operand(literal_index) &&
+ FitsInIdx8Operand(cons_property_entry)) {
+ Output(Bytecode::kCreateObjectLiteral,
+ static_cast<uint8_t>(cons_property_entry),
+ static_cast<uint8_t>(literal_index), static_cast<uint8_t>(flags));
} else {
UNIMPLEMENTED();
}

Powered by Google App Engine
This is Rietveld 408576698