Bug 171421
| Summary: | [JSC] Add @isUndefinedOrNullIgnoringMasquerade() | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> |
| Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | ashvayka, fpizlo, saam |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Yusuke Suzuki
In builtin JS, we have bunch of
if (object === null || object === @undefined)
thing. Previously, this is written as follows.
if (object == null)
However, the above one recognizes document.all as null/undefined due to its masquerade.
So, they are rewritten.
But the above thing is,
1. From JS developer, it looks very storange because it seems `== null` is better.
2. It bloats bytecodes, effectively prevents us from inlining. Keep builtin JS function small is a bit important in terms of inlining.
So, to make the meaning explicit and tighten bytecode size, we would like to introduce a new bytecode, op_is_undefined_or_null_ignoring_masquerade.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Shvayka
(In reply to Yusuke Suzuki from comment #0)
> So, to make the meaning explicit and tighten bytecode size, we would like to
> introduce a new bytecode, op_is_undefined_or_null_ignoring_masquerade.
OpIsUndefinedOrNull was introduced in r239761.
*** This bug has been marked as a duplicate of bug 193127 ***