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

Unified Diff: test/unittests/interpreter/bytecode-array-builder-unittest.cc

Issue 1555713002: [Interpreter] Bytecodes for exchanging registers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 years, 12 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: 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 144a92d990d0a681c45f0dac76d99f60457e9fe3..be834e419776fd6f067edc396b1b2b0416927032 100644
--- a/test/unittests/interpreter/bytecode-array-builder-unittest.cc
+++ b/test/unittests/interpreter/bytecode-array-builder-unittest.cc
@@ -22,12 +22,12 @@ class BytecodeArrayBuilderTest : public TestWithIsolateAndZone {
TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
BytecodeArrayBuilder builder(isolate(), zone());
- builder.set_locals_count(2);
+ builder.set_locals_count(200);
builder.set_context_count(1);
builder.set_parameter_count(0);
- CHECK_EQ(builder.locals_count(), 2);
+ CHECK_EQ(builder.locals_count(), 200);
CHECK_EQ(builder.context_count(), 1);
- CHECK_EQ(builder.fixed_register_count(), 3);
+ CHECK_EQ(builder.fixed_register_count(), 201);
// Emit constant loads.
builder.LoadLiteral(Smi::FromInt(0))
@@ -50,6 +50,13 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
Register other(1);
builder.MoveRegister(reg, other);
+ // Emit register-register exchanges.
+ Register wide(150);
+ builder.ExchangeRegisters(reg, wide);
+ builder.ExchangeRegisters(wide, reg);
+ Register wider(151);
+ builder.ExchangeRegisters(wide, wider);
+
// Emit global load / store operations.
Factory* factory = isolate()->factory();
Handle<String> name = factory->NewStringFromStaticChars("var_name");
« no previous file with comments | « test/unittests/compiler/interpreter-assembler-unittest.cc ('k') | test/unittests/interpreter/bytecodes-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698