Index: test/unittests/interpreter/bytecode-array-builder-unittest.cc |
diff --git a/test/unittests/interpreter/bytecode-array-builder-unittest.cc b/test/unittests/interpreter/bytecode-array-builder-unittest.cc |
index cd6270ec6fdae24fd2120fb3c64251ae1fa6508c..20c4e38a788d00c923428f406e7f68c711d686cf 100644 |
--- a/test/unittests/interpreter/bytecode-array-builder-unittest.cc |
+++ b/test/unittests/interpreter/bytecode-array-builder-unittest.cc |
@@ -49,6 +49,12 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) { |
.StoreGlobal(0, 1, LanguageMode::SLOPPY) |
.StoreGlobal(0, 1, LanguageMode::STRICT); |
+ // Emit wide global load / store operations. |
+ builder.LoadGlobal(0, 1024, LanguageMode::SLOPPY) |
+ .LoadGlobal(1024, 1, LanguageMode::STRICT) |
+ .StoreGlobal(0, 1024, LanguageMode::SLOPPY) |
+ .StoreGlobal(1024, 1, LanguageMode::STRICT); |
+ |
// Emit context operations. |
builder.PushContext(reg); |
builder.PopContext(reg); |
@@ -65,6 +71,16 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) { |
.StoreNamedProperty(reg, 0, 0, LanguageMode::STRICT) |
.StoreKeyedProperty(reg, reg, 0, LanguageMode::STRICT); |
+ // Emit wide load / store property operations. |
+ builder.LoadNamedProperty(reg, 2056, 0, LanguageMode::SLOPPY) |
+ .LoadKeyedProperty(reg, 2056, LanguageMode::SLOPPY) |
+ .StoreNamedProperty(reg, 0, 2056, LanguageMode::SLOPPY) |
+ .StoreKeyedProperty(reg, reg, 2056, LanguageMode::SLOPPY) |
+ .LoadNamedProperty(reg, 2056, 0, LanguageMode::STRICT) |
+ .LoadKeyedProperty(reg, 2056, LanguageMode::STRICT) |
+ .StoreNamedProperty(reg, 0, 2056, LanguageMode::STRICT) |
+ .StoreKeyedProperty(reg, reg, 2056, LanguageMode::STRICT); |
+ |
// Emit closure operations. |
builder.CreateClosure(NOT_TENURED); |
@@ -160,6 +176,13 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) { |
builder.ForInPrepare(reg).ForInDone(reg).ForInNext(reg, reg); |
+ // Wide constant pool loads |
+ for (int i = 0; i < 256; i++) { |
+ // Emit junk in constant pool to force wide constant pool index. |
+ builder.GetConstantPoolEntry(handle(Smi::FromInt(i), isolate())); |
+ } |
+ builder.LoadLiteral(Smi::FromInt(20000000)); |
+ |
builder.Return(); |
// Generate BytecodeArray. |