ededfcd212
This patch expands scope analysis to skip hole initialization when it can be determined statically that no hole checks will be generated at runtime. Two conditions must be met to safely eliminate hole initialization: - There must not exist a VariableProxy referencing this Variable whose HoleCheckMode is kRequired - The Variable must be stack allocated; any other allocation implies that it may be accessed from not-yet-analyzed scopes (other modules, inner functions, or eval code) and that code may require hole checks. The new logic required removing debug code in full-codegen which is now incorrect in some cases. Also fixed Variable's bitfield helpers to take no more space than needed. Bug: chromium:651637 Change-Id: Ie5ac326af4e05b7a5c3c37cd4d0afba6a51a504d Reviewed-on: https://chromium-review.googlesource.com/494006 Commit-Queue: Adam Klein <adamk@chromium.org> Reviewed-by: Georg Neis <neis@chromium.org> Reviewed-by: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#45170}
95 lines
1.7 KiB
Plaintext
95 lines
1.7 KiB
Plaintext
#
|
|
# Autogenerated by generate-bytecode-expectations.
|
|
#
|
|
|
|
---
|
|
wrap: yes
|
|
|
|
---
|
|
snippet: "
|
|
let x = 10;
|
|
"
|
|
frame size: 1
|
|
parameter count: 1
|
|
bytecode array length: 7
|
|
bytecodes: [
|
|
/* 30 E> */ B(StackCheck),
|
|
/* 42 S> */ B(LdaSmi), I8(10),
|
|
B(Star), R(0),
|
|
B(LdaUndefined),
|
|
/* 46 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
]
|
|
handlers: [
|
|
]
|
|
|
|
---
|
|
snippet: "
|
|
let x = 10; return x;
|
|
"
|
|
frame size: 1
|
|
parameter count: 1
|
|
bytecode array length: 7
|
|
bytecodes: [
|
|
/* 30 E> */ B(StackCheck),
|
|
/* 42 S> */ B(LdaSmi), I8(10),
|
|
B(Star), R(0),
|
|
/* 46 S> */ B(Nop),
|
|
/* 56 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
]
|
|
handlers: [
|
|
]
|
|
|
|
---
|
|
snippet: "
|
|
let x = (x = 20);
|
|
"
|
|
frame size: 3
|
|
parameter count: 1
|
|
bytecode array length: 26
|
|
bytecodes: [
|
|
B(LdaTheHole),
|
|
B(Star), R(0),
|
|
/* 30 E> */ B(StackCheck),
|
|
/* 45 S> */ B(LdaSmi), I8(20),
|
|
B(Star), R(1),
|
|
B(Ldar), R(0),
|
|
B(JumpIfNotHole), U8(11),
|
|
B(LdaConstant), U8(0),
|
|
B(Star), R(2),
|
|
/* 45 E> */ B(CallRuntime), U16(Runtime::kThrowReferenceError), R(2), U8(1),
|
|
B(Mov), R(1), R(0),
|
|
B(LdaUndefined),
|
|
/* 52 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
ONE_BYTE_INTERNALIZED_STRING_TYPE ["x"],
|
|
]
|
|
handlers: [
|
|
]
|
|
|
|
---
|
|
snippet: "
|
|
let x = 10; x = 20;
|
|
"
|
|
frame size: 1
|
|
parameter count: 1
|
|
bytecode array length: 11
|
|
bytecodes: [
|
|
/* 30 E> */ B(StackCheck),
|
|
/* 42 S> */ B(LdaSmi), I8(10),
|
|
B(Star), R(0),
|
|
/* 46 S> */ B(LdaSmi), I8(20),
|
|
B(Star), R(0),
|
|
B(LdaUndefined),
|
|
/* 54 S> */ B(Return),
|
|
]
|
|
constant pool: [
|
|
]
|
|
handlers: [
|
|
]
|
|
|