[Interpreter] Adds an optimization to remove redundant Ldar/Star.

Adds an optimization to omit generating Ldar/Star if the same register
is loaded or stored from the accumulator in the earlier instruction.

BUG=v8:4280
LOG=N

Review URL: https://codereview.chromium.org/1435283002

Cr-Commit-Position: refs/heads/master@{#31984}
This commit is contained in:
mythria 2015-11-13 06:14:57 -08:00 committed by Commit bot
parent 24e058d0ed
commit f665c823dd
5 changed files with 163 additions and 127 deletions

View File

@ -271,18 +271,18 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::LoadFalse() {
BytecodeArrayBuilder& BytecodeArrayBuilder::LoadAccumulatorWithRegister(
Register reg) {
// TODO(oth): Avoid loading the accumulator with the register if the
// previous bytecode stored the accumulator with the same register.
Output(Bytecode::kLdar, reg.ToOperand());
if (!IsRegisterInAccumulator(reg)) {
Output(Bytecode::kLdar, reg.ToOperand());
}
return *this;
}
BytecodeArrayBuilder& BytecodeArrayBuilder::StoreAccumulatorInRegister(
Register reg) {
// TODO(oth): Avoid storing the accumulator in the register if the
// previous bytecode loaded the accumulator with the same register.
Output(Bytecode::kStar, reg.ToOperand());
if (!IsRegisterInAccumulator(reg)) {
Output(Bytecode::kStar, reg.ToOperand());
}
return *this;
}
@ -952,12 +952,29 @@ bool BytecodeArrayBuilder::OperandIsValid(Bytecode bytecode, int operand_index,
return false;
}
bool BytecodeArrayBuilder::LastBytecodeInSameBlock() const {
return last_bytecode_start_ < bytecodes()->size() &&
last_bytecode_start_ >= last_block_end_;
}
bool BytecodeArrayBuilder::IsRegisterInAccumulator(Register reg) {
if (!LastBytecodeInSameBlock()) return false;
Bytecode previous_bytecode =
Bytecodes::FromByte(bytecodes()->at(last_bytecode_start_));
if (previous_bytecode == Bytecode::kLdar ||
previous_bytecode == Bytecode::kStar) {
size_t operand_offset = last_bytecode_start_ +
Bytecodes::GetOperandOffset(previous_bytecode, 0);
if (reg == Register::FromOperand(bytecodes()->at(operand_offset))) {
return true;
}
}
return false;
}
// static
Bytecode BytecodeArrayBuilder::BytecodeForBinaryOperation(Token::Value op) {
switch (op) {

View File

@ -251,6 +251,7 @@ class BytecodeArrayBuilder {
bool LastBytecodeInSameBlock() const;
bool NeedToBooleanCast();
bool IsRegisterInAccumulator(Register reg);
int BorrowTemporaryRegister();
void ReturnTemporaryRegister(int reg_index);

View File

@ -658,7 +658,7 @@ void BytecodeGenerator::VisitWhileStatement(WhileStatement* stmt) {
BytecodeLabel body_label, condition_label, done_label;
if (stmt->cond()->ToBooleanIsFalse()) {
// If the condition is false there is no need to generating the loop.
// If the condition is false there is no need to generate the loop.
return;
}

View File

@ -264,10 +264,9 @@ TEST(PrimitiveExpressions) {
{"var x = 0; return x;",
kPointerSize,
1,
6,
4,
{B(LdaZero), //
B(Star), R(0), //
B(Ldar), R(0), //
B(Return)},
0},
{"var x = 0; return x + 3;",
@ -407,10 +406,9 @@ TEST(LogicalExpressions) {
{"var x = 0; return x || 3;",
1 * kPointerSize,
1,
10,
8,
{B(LdaZero), //
B(Star), R(0), //
B(Ldar), R(0), //
B(JumpIfToBooleanTrue), U8(4), //
B(LdaSmi8), U8(3), //
B(Return)},
@ -430,10 +428,9 @@ TEST(LogicalExpressions) {
{"var x = 0; return x && 3;",
1 * kPointerSize,
1,
10,
8,
{B(LdaZero), //
B(Star), R(0), //
B(Ldar), R(0), //
B(JumpIfToBooleanFalse), U8(4), //
B(LdaSmi8), U8(3), //
B(Return)},
@ -453,10 +450,9 @@ TEST(LogicalExpressions) {
{"var x = 0; return x || (1, 2, 3);",
1 * kPointerSize,
1,
10,
8,
{B(LdaZero), //
B(Star), R(0), //
B(Ldar), R(0), //
B(JumpIfToBooleanTrue), U8(4), //
B(LdaSmi8), U8(3), //
B(Return)},
@ -589,10 +585,9 @@ TEST(LogicalExpressions) {
{"var x = 1; return x && 3 || 0, 1;",
1 * kPointerSize,
1,
16,
14,
{B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Ldar), R(0), //
B(JumpIfToBooleanFalse), U8(4), //
B(LdaSmi8), U8(3), //
B(JumpIfToBooleanTrue), U8(3), //
@ -1663,11 +1658,10 @@ TEST(IfConditions) {
{"function f() { var a = 1; if (a) { a += 1; } else { return 2; } } f();",
1 * kPointerSize,
1,
21,
19,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Ldar), R(0), //
B(JumpIfToBooleanFalse), U8(10), //
B(LdaSmi8), U8(1), //
B(Add), R(0), //
@ -1718,11 +1712,11 @@ TEST(IfConditions) {
{helper.factory()->NewNumberFromInt(200), unused, unused, unused, unused,
unused}},
{"function f(z) { var a = 0; var b = 0; if (a === 0.01) { "
REPEAT_32(SPACE, "b = a; a = b; ")
REPEAT_64(SPACE, "b = a; a = b; ")
" return 200; } else { return -200; } } f(0.001)",
2 * kPointerSize,
2,
276,
278,
{
B(LdaZero), //
B(Star), R(0), //
@ -1731,10 +1725,9 @@ TEST(IfConditions) {
B(LdaConstant), U8(0), //
B(TestEqualStrict), R(0), //
B(JumpIfFalseConstant), U8(2), //
REPEAT_32(COMMA, //
B(Ldar), R(0), //
B(Ldar), R(0), //
REPEAT_64(COMMA, //
B(Star), R(1), //
B(Ldar), R(1), //
B(Star), R(0)), //
B(LdaConstant), U8(1), //
B(Return), //
@ -1745,14 +1738,14 @@ TEST(IfConditions) {
4,
{helper.factory()->NewHeapNumber(0.01),
helper.factory()->NewNumberFromInt(200),
helper.factory()->NewNumberFromInt(261),
helper.factory()->NewNumberFromInt(263),
helper.factory()->NewNumberFromInt(-200), unused, unused}},
{"function f() { var a = 0; var b = 0; if (a) { "
REPEAT_32(SPACE, "b = a; a = b; ")
REPEAT_64(SPACE, "b = a; a = b; ")
" return 200; } else { return -200; } } f()",
2 * kPointerSize,
1,
274,
276,
{
B(LdaZero), //
B(Star), R(0), //
@ -1760,10 +1753,9 @@ TEST(IfConditions) {
B(Star), R(1), //
B(Ldar), R(0), //
B(JumpIfToBooleanFalseConstant), U8(1), //
REPEAT_32(COMMA, //
B(Ldar), R(0), //
B(Ldar), R(0), //
REPEAT_64(COMMA, //
B(Star), R(1), //
B(Ldar), R(1), //
B(Star), R(0)), //
B(LdaConstant), U8(0), //
B(Return), //
@ -1773,7 +1765,7 @@ TEST(IfConditions) {
B(Return)}, //
3,
{helper.factory()->NewNumberFromInt(200),
helper.factory()->NewNumberFromInt(261),
helper.factory()->NewNumberFromInt(263),
helper.factory()->NewNumberFromInt(-200), unused, unused, unused}},
{"function f(a, b) {\n"
@ -1820,11 +1812,10 @@ TEST(IfConditions) {
"f();",
1 * kPointerSize,
1,
15,
13,
{
B(LdaZero), //
B(Star), R(0), //
B(Ldar), R(0), //
B(JumpIfToBooleanFalse), U8(5), //
B(LdaSmi8), U8(20), //
B(Return), //
@ -1834,8 +1825,7 @@ TEST(IfConditions) {
B(Return)
},
0,
{unused, unused, unused, unused, unused, unused}}
};
{unused, unused, unused, unused, unused, unused}}};
for (size_t i = 0; i < arraysize(snippets); i++) {
Handle<BytecodeArray> bytecode_array =
@ -1907,7 +1897,7 @@ TEST(DeclareGlobals) {
{"var a = 1;\na=2;",
4 * kPointerSize,
1,
38,
36,
{
B(LdaConstant), U8(0), //
B(Star), R(1), //
@ -1925,7 +1915,6 @@ TEST(DeclareGlobals) {
B(StaGlobalSloppy), U8(1), //
U8(store_vector->GetIndex(store_slot_2)), //
B(Star), R(0), //
B(Ldar), R(0), //
B(Return) //
},
2,
@ -1934,7 +1923,7 @@ TEST(DeclareGlobals) {
{"function f() {}\nf();",
3 * kPointerSize,
1,
29,
27,
{
B(LdaConstant), U8(0), //
B(Star), R(1), //
@ -1948,7 +1937,6 @@ TEST(DeclareGlobals) {
B(Star), R(1), //
B(Call), R(1), R(2), U8(0), //
B(Star), R(0), //
B(Ldar), R(0), //
B(Return) //
},
2,
@ -2195,16 +2183,16 @@ TEST(BasicLoops) {
},
0},
{"var x = 10;"
"var y = 1;"
"do {"
" y = y * 12;"
" x = x - 1;"
"} while(x);"
"return y;",
2 * kPointerSize,
1,
27,
{
"var y = 1;"
"do {"
" y = y * 12;"
" x = x - 1;"
"} while(x);"
"return y;",
2 * kPointerSize,
1,
27,
{
B(LdaSmi8), U8(10), //
B(Star), R(0), //
B(LdaSmi8), U8(1), //
@ -2219,7 +2207,7 @@ TEST(BasicLoops) {
B(JumpIfToBooleanTrue), U8(-14), //
B(Ldar), R(1), //
B(Return), //
},
},
0},
{"var y = 1;"
"for (var x = 10; x; --x) {"
@ -2324,11 +2312,10 @@ TEST(BasicLoops) {
"return x;",
1 * kPointerSize,
1,
6,
4,
{
B(LdaZero), //
B(Star), R(0), //
B(Ldar), R(0), //
B(Return), //
},
0},
@ -2457,18 +2444,16 @@ TEST(UnaryOperators) {
"return y;",
3 * kPointerSize,
1,
20,
16,
{
B(LdaConstant), U8(0), //
B(Star), R(0), //
B(Ldar), R(0), //
B(Mul), R(0), //
B(Star), R(2), //
B(LdaSmi8), U8(1), //
B(Sub), R(2), //
B(LdaUndefined), //
B(Star), R(1), //
B(Ldar), R(1), //
B(Return), //
},
1,
@ -2539,11 +2524,10 @@ TEST(Typeof) {
"}; f();",
kPointerSize,
1,
8,
6,
{
B(LdaSmi8), U8(13), //
B(Star), R(0), // TODO(oth): Ldar R(X) following Star R(X)
B(Ldar), R(0), // could be culled in bytecode array builder.
B(Star), R(0), //
B(TypeOf), //
B(Return), //
}},
@ -3532,11 +3516,10 @@ TEST(Throw) {
{"var a = 1; if (a) { throw 'Error'; };",
1 * kPointerSize,
1,
13,
11,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Ldar), R(0), //
B(JumpIfToBooleanFalse), U8(5), //
B(LdaConstant), U8(0), //
B(Throw), //
@ -3924,11 +3907,10 @@ TEST(CountOperators) {
{"var a = 1; return ++a;",
1 * kPointerSize,
1,
11,
9,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Ldar), R(0), //
B(ToNumber), //
B(Inc), //
B(Star), R(0), //
@ -3937,11 +3919,10 @@ TEST(CountOperators) {
{"var a = 1; return a++;",
2 * kPointerSize,
1,
15,
13,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Ldar), R(0), //
B(ToNumber), //
B(Star), R(1), //
B(Inc), //
@ -3952,11 +3933,10 @@ TEST(CountOperators) {
{"var a = 1; return --a;",
1 * kPointerSize,
1,
11,
9,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Ldar), R(0), //
B(ToNumber), //
B(Dec), //
B(Star), R(0), //
@ -3965,11 +3945,10 @@ TEST(CountOperators) {
{"var a = 1; return a--;",
2 * kPointerSize,
1,
15,
13,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Ldar), R(0), //
B(ToNumber), //
B(Star), R(1), //
B(Dec), //
@ -4397,11 +4376,10 @@ TEST(CreateArguments) {
{"function f() { return arguments; }",
1 * kPointerSize,
1,
6,
4,
{
B(CreateMappedArguments), //
B(Star), R(0), //
B(Ldar), R(0), //
B(Return), //
}},
{"function f() { return arguments[0]; }",
@ -4418,11 +4396,10 @@ TEST(CreateArguments) {
{"function f() { 'use strict'; return arguments; }",
1 * kPointerSize,
1,
6,
4,
{
B(CreateUnmappedArguments), //
B(Star), R(0), //
B(Ldar), R(0), //
B(Return), //
}},
{"function f(a) { return arguments[0]; }",
@ -4444,7 +4421,7 @@ TEST(CreateArguments) {
{"function f(a, b, c) { return arguments; }",
2 * kPointerSize,
4,
28,
26,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), //
U8(1), //
@ -4457,17 +4434,15 @@ TEST(CreateArguments) {
B(StaContextSlot), R(1), U8(first_context_slot), //
B(CreateMappedArguments), //
B(Star), R(0), //
B(Ldar), R(0), //
B(Return), //
}},
{"function f(a, b, c) { 'use strict'; return arguments; }",
1 * kPointerSize,
4,
6,
4,
{
B(CreateUnmappedArguments), //
B(Star), R(0), //
B(Ldar), R(0), //
B(Return), //
}},
};
@ -4544,33 +4519,30 @@ TEST(ForIn) {
"for (var p in x) { return p; }",
5 * kPointerSize,
1,
52,
46,
{
B(LdaConstant), U8(0), //
B(Star), R(1), //
B(Ldar), R(1), //
B(JumpIfUndefined), U8(44), //
B(JumpIfNull), U8(42), //
B(JumpIfUndefined), U8(40), //
B(JumpIfNull), U8(38), //
B(ToObject), //
B(Star), R(3), //
B(CallRuntime), U16(Runtime::kGetPropertyNamesFast), R(3), U8(1), //
B(ForInPrepare), R(3), //
B(JumpIfUndefined), U8(30), //
B(JumpIfUndefined), U8(26), //
B(Star), R(4), //
B(LdaZero), //
B(Star), R(3), //
B(ForInDone), R(4), //
B(JumpIfTrue), U8(21), //
B(JumpIfTrue), U8(17), //
B(ForInNext), R(4), R(3), //
B(JumpIfUndefined), U8(11), //
B(JumpIfUndefined), U8(7), //
B(Star), R(0), //
B(Ldar), R(0), //
B(Star), R(2), //
B(Ldar), R(2), //
B(Return), //
B(Ldar), R(3), //
B(Inc), //
B(Jump), U8(-23), //
B(Jump), U8(-19), //
B(LdaUndefined), //
B(Return), //
},
@ -4580,35 +4552,33 @@ TEST(ForIn) {
"for (var p in [1,2,3]) { x += p; }",
5 * kPointerSize,
1,
57,
53,
{
B(LdaZero), //
B(Star), R(1), //
B(LdaConstant), U8(0), //
B(CreateArrayLiteral), U8(0), U8(simple_flags), //
B(JumpIfUndefined), U8(47), //
B(JumpIfNull), U8(45), //
B(JumpIfUndefined), U8(43), //
B(JumpIfNull), U8(41), //
B(ToObject), //
B(Star), R(3), //
B(CallRuntime), U16(Runtime::kGetPropertyNamesFast), R(3), U8(1), //
B(ForInPrepare), R(3), //
B(JumpIfUndefined), U8(33), //
B(JumpIfUndefined), U8(29), //
B(Star), R(4), //
B(LdaZero), //
B(Star), R(3), //
B(ForInDone), R(4), //
B(JumpIfTrue), U8(24), //
B(JumpIfTrue), U8(20), //
B(ForInNext), R(4), R(3), //
B(JumpIfUndefined), U8(14), //
B(JumpIfUndefined), U8(10), //
B(Star), R(0), //
B(Ldar), R(0), //
B(Star), R(2), //
B(Ldar), R(2), //
B(Add), R(1), //
B(Star), R(1), //
B(Ldar), R(3), //
B(Inc), //
B(Jump), U8(-26), //
B(Jump), U8(-22), //
B(LdaUndefined), //
B(Return), //
},
@ -4771,13 +4741,12 @@ TEST(Switch) {
"}\n",
2 * kPointerSize,
1,
30,
28,
{
B(LdaSmi8), U8(1), //
B(Star), R(1), // The tag variable is allocated as a
B(Ldar), R(1), // local by the parser, hence this
B(Star), R(0), // strange shuffling.
B(LdaSmi8), U8(1), //
B(Star), R(0), // local by the parser, hence the store
B(LdaSmi8), U8(1), // to another local register.
B(TestEqualStrict), R(0), //
B(JumpIfTrue), U8(10), //
B(LdaSmi8), U8(2), //
@ -4798,11 +4767,10 @@ TEST(Switch) {
"}\n",
2 * kPointerSize,
1,
36,
34,
{
B(LdaSmi8), U8(1), //
B(Star), R(1), //
B(Ldar), R(1), //
B(Star), R(0), //
B(LdaSmi8), U8(1), //
B(TestEqualStrict), R(0), //
@ -4827,11 +4795,10 @@ TEST(Switch) {
"}\n",
2 * kPointerSize,
1,
34,
32,
{
B(LdaSmi8), U8(1), //
B(Star), R(1), //
B(Ldar), R(1), //
B(Star), R(0), //
B(LdaSmi8), U8(1), //
B(TestEqualStrict), R(0), //
@ -4856,11 +4823,10 @@ TEST(Switch) {
"}\n",
2 * kPointerSize,
1,
34,
32,
{
B(LdaSmi8), U8(1), //
B(Star), R(1), //
B(Ldar), R(1), //
B(Star), R(0), //
B(LdaSmi8), U8(2), //
B(TestEqualStrict), R(0), //
@ -4885,11 +4851,10 @@ TEST(Switch) {
"}\n",
2 * kPointerSize,
1,
43,
41,
{
B(LdaSmi8), U8(1), //
B(Star), R(1), //
B(Ldar), R(1), //
B(TypeOf), //
B(Star), R(0), //
B(LdaSmi8), U8(2), //
@ -4918,11 +4883,10 @@ TEST(Switch) {
"}\n",
2 * kPointerSize,
1,
31,
29,
{
B(LdaSmi8), U8(1), //
B(Star), R(1), //
B(Ldar), R(1), //
B(Star), R(0), //
B(Ldar), R(1), //
B(TypeOf), //
@ -4946,11 +4910,10 @@ TEST(Switch) {
"}\n",
2 * kPointerSize,
1,
288,
286,
{
B(LdaSmi8), U8(1), //
B(Star), R(1), //
B(Ldar), R(1), //
B(Star), R(0), //
B(LdaSmi8), U8(1), //
B(TestEqualStrict), R(0), //
@ -4982,11 +4945,10 @@ TEST(Switch) {
"}\n",
3 * kPointerSize,
1,
54,
52,
{
B(LdaSmi8), U8(1), //
B(Star), R(2), //
B(Ldar), R(2), //
B(Star), R(0), //
B(LdaSmi8), U8(1), //
B(TestEqualStrict), R(0), //
@ -5033,11 +4995,10 @@ TEST(BasicBlockToBoolean) {
{"var a = 1; if (a || a < 0) { return 1; }",
1 * kPointerSize,
1,
18,
16,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Ldar), R(0), //
B(JumpIfToBooleanTrue), U8(5), //
B(LdaZero), //
B(TestLessThan), R(0), //
@ -5050,11 +5011,10 @@ TEST(BasicBlockToBoolean) {
{"var a = 1; if (a && a < 0) { return 1; }",
1 * kPointerSize,
1,
18,
16,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Ldar), R(0), //
B(JumpIfToBooleanFalse), U8(5), //
B(LdaZero), //
B(TestLessThan), R(0), //
@ -5067,11 +5027,10 @@ TEST(BasicBlockToBoolean) {
{"var a = 1; a = (a || a < 0) ? 2 : 3;",
1 * kPointerSize,
1,
23,
21,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Ldar), R(0), //
B(JumpIfToBooleanTrue), U8(5), //
B(LdaZero), //
B(TestLessThan), R(0), //
@ -5127,11 +5086,10 @@ TEST(DeadCodeRemoval) {
{"var a = 1; if (a) { return 1; }; return 2;",
1 * kPointerSize,
1,
14,
12,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Ldar), R(0), //
B(JumpIfToBooleanFalse), U8(5), //
B(LdaSmi8), U8(1), //
B(Return), //
@ -5170,13 +5128,12 @@ TEST(ThisFunction) {
{"var f;\n f = function f() { return f; }",
1 * kPointerSize,
1,
10,
8,
{
B(LdaTheHole), //
B(Star), R(0), //
B(Ldar), R(closure), //
B(Star), R(0), //
B(Ldar), R(0), //
B(Return), //
}},
};
@ -5197,12 +5154,70 @@ TEST(NewTarget) {
{"return new.target;",
1 * kPointerSize,
1,
10,
8,
{
B(CallRuntime), U16(Runtime::kGetNewTarget), R(0), U8(0), //
B(Star), R(0), //
B(Ldar), R(0), //
B(Return), //
}}
};
for (size_t i = 0; i < arraysize(snippets); i++) {
Handle<BytecodeArray> bytecode_array =
helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet);
CheckBytecodeArrayEqual(snippets[i], bytecode_array);
}
}
TEST(RemoveRedundantLdar) {
InitializedHandleScope handle_scope;
BytecodeGeneratorHelper helper;
ExpectedSnippet<int> snippets[] = {
{"var ld_a = 1;\n" // This test is to check Ldar does not
"while(true) {\n" // get removed if the preceding Star is
" ld_a = ld_a + ld_a;\n" // in a different basicblock.
" if (ld_a > 10) break;\n"
"}\n"
"return ld_a;",
1 * kPointerSize,
1,
23,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Ldar), R(0), // This load should not be removed as it
B(Add), R(0), // is the target of the branch.
B(Star), R(0), //
B(LdaSmi8), U8(10), //
B(TestGreaterThan), R(0), //
B(JumpIfFalse), U8(4), //
B(Jump), U8(4), //
B(Jump), U8(-14), //
B(Ldar), R(0), //
B(Return)
}},
{"var ld_a = 1;\n"
"do {\n"
" ld_a = ld_a + ld_a;\n"
" if (ld_a > 10) continue;\n"
"} while(false);\n"
"return ld_a;",
1 * kPointerSize,
1,
19,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Add), R(0), //
B(Star), R(0), //
B(LdaSmi8), U8(10), //
B(TestGreaterThan), R(0), //
B(JumpIfFalse), U8(4), //
B(Jump), U8(2), //
B(Ldar), R(0), //
B(Return)
}},
};

View File

@ -39,9 +39,12 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
.LoadTrue()
.LoadFalse();
// Emit accumulator transfers.
// Emit accumulator transfers. Stores followed by loads to the same register
// are not generated. Hence, a dummy instruction in between.
Register reg(0);
builder.LoadAccumulatorWithRegister(reg).StoreAccumulatorInRegister(reg);
builder.LoadAccumulatorWithRegister(reg)
.LoadNull()
.StoreAccumulatorInRegister(reg);
// Emit global load / store operations.
builder.LoadGlobal(0, 1, LanguageMode::SLOPPY, TypeofMode::NOT_INSIDE_TYPEOF)