v8/test/cctest/interpreter/bytecode_expectations/GenerateTestUndetectable.golden
mythria 9119d16904 [Interpreter] Optimize equality check with null/undefined with a check on the map.
Equality with null/undefined is equivalent to a check on the undetectable bit
on the map of the object. This would be more efficient than performing the entire
comparison operation.

This cl introduces:
1. A new bytecode called TestUndetectable that checks if the object is null/undefined.
2. Updates peeophole optimizer to emit TestUndetectable when a LdaNull/Undefined
precedes equality check.
4. TestUndetectable is transformed to ObjectIsUndetectable operator when building
turbofan graph.

BUG=v8:4280

Review-Url: https://codereview.chromium.org/2547043002
Cr-Commit-Position: refs/heads/master@{#41514}
2016-12-06 11:32:39 +00:00

124 lines
2.5 KiB
Plaintext

#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
var obj_a = {val:1};
var b = 10;
if (obj_a == null) { b = 20;}
return b;
"
frame size: 3
parameter count: 1
bytecode array length: 24
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(2),
B(Mov), R(2), R(0),
/* 63 S> */ B(LdaSmi), U8(10),
B(Star), R(1),
/* 67 S> */ B(TestUndetectable), R(0),
B(JumpIfFalse), U8(6),
/* 88 S> */ B(LdaSmi), U8(20),
B(Star), R(1),
/* 97 S> */ B(Ldar), R(1),
/* 107 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
]
handlers: [
]
---
snippet: "
var obj_a = {val:1};
var b = 10;
if (obj_a == undefined) { b = 20;}
return b;
"
frame size: 3
parameter count: 1
bytecode array length: 24
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(2),
B(Mov), R(2), R(0),
/* 63 S> */ B(LdaSmi), U8(10),
B(Star), R(1),
/* 67 S> */ B(TestUndetectable), R(0),
B(JumpIfFalse), U8(6),
/* 93 S> */ B(LdaSmi), U8(20),
B(Star), R(1),
/* 102 S> */ B(Ldar), R(1),
/* 112 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
]
handlers: [
]
---
snippet: "
var obj_a = {val:1};
var b = 10;
if (obj_a != null) { b = 20;}
return b;
"
frame size: 3
parameter count: 1
bytecode array length: 24
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(2),
B(Mov), R(2), R(0),
/* 63 S> */ B(LdaSmi), U8(10),
B(Star), R(1),
/* 67 S> */ B(TestUndetectable), R(0),
B(JumpIfTrue), U8(6),
/* 88 S> */ B(LdaSmi), U8(20),
B(Star), R(1),
/* 97 S> */ B(Ldar), R(1),
/* 107 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
]
handlers: [
]
---
snippet: "
var obj_a = {val:1};
var b = 10;
if (obj_a != undefined) { b = 20;}
return b;
"
frame size: 3
parameter count: 1
bytecode array length: 24
bytecodes: [
/* 30 E> */ B(StackCheck),
/* 46 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(2),
B(Mov), R(2), R(0),
/* 63 S> */ B(LdaSmi), U8(10),
B(Star), R(1),
/* 67 S> */ B(TestUndetectable), R(0),
B(JumpIfTrue), U8(6),
/* 93 S> */ B(LdaSmi), U8(20),
B(Star), R(1),
/* 102 S> */ B(Ldar), R(1),
/* 112 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
]
handlers: [
]