Closed Bug 1360369 Opened 8 years ago Closed 4 years ago

Unify implementation of JSOP_CHECKOBJCOERCIBLE and the self-hosted RequireObjectCoercible function

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: shu, Assigned: evilpie)

References

(Blocks 2 open bugs)

Details

(Keywords: triage-deferred)

Attachments

(2 files)

We have both a specialized JSOP and a self-hosted function for checking if an object is coercible. anba over in bug 1360220 removed uses of calling out to the self-hosted function in generated bytecode. I'd like to only have one implementation. We should remove the self-hosted function and special case calls to |RequireObjectCoercible| (renamed to something else, most likely) when emitting bytecode for self-hosted functions, like |allowContentIter|, to emit JSOP_CHECKOBJCOERCIBLE instead.
Keywords: triage-deferred
Priority: -- → P3

We should do this. We have a call to RequireObjectCoercible in all string methods. With this fixed we should be able to be in a place where for many string methods we aren't calling another functions from Baseline and Warp.

Blocks: WarpBuilder

I prototyped this, but sadly it makes an already bad error message worse.
Before we get "can't convert null to object", when using CheckObjCoercible: "this is null". For reference Chrome gives "String.prototype.blink called on null or undefined", which is much better.

Assignee: nobody → evilpies
Blocks: jserror

I mostly wrote these patches for the improved error messages. If we actually want to improve the performance with Warp/baseline it might make sense to add a IsNullOrUndefined JSOp to replace the two strict equality comparisons. Luckily we already have this as a MIR/LIR instruction.

I hadn't noticed this before locally. But jit-test/tests/ion/dce-with-rinstructions.js fails with Assertion failure: input()->isRecoveredOnBailout() == mustBeRecovered_. The failing test seems to be rstr_split.

Turns out changing the call to and if + call would get us right over the inlinig limit for String_split. Setting --ion-limit-script-size=off when running the test is a simple fix suggested by Jan.

Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/a634c5346591 Remove RequireObjectCoercible from self-hosted String methods and improve error messages. r=jandem https://hg.mozilla.org/integration/autoland/rev/7b278c9988df Improve error message for C++ implemented String function and add a test. r=jandem
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: