Make CodeGenerator visit() methods infallible

RESOLVED FIXED in mozilla37

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: bhackett, Assigned: bhackett)

Tracking

(Blocks: 1 bug)

Trunk
mozilla37
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
Created attachment 8531399 [details] [diff] [review]
patch

The visit() methods, which are the main way Ion generates code, can only fail on OOM.  In such cases the OOM can be more cleanly indicated within the macro assembler.  The attached patch makes the visit methods infallible in this fashion, along with many other CodeGenerator methods called by the visit methods.

35 files changed, 2528 insertions(+), 3469 deletions(-)
Attachment #8531399 - Flags: review?(jdemooij)
Comment on attachment 8531399 [details] [diff] [review]
patch

Review of attachment 8531399 [details] [diff] [review]:
-----------------------------------------------------------------

Seems reasonable, it's similar to what we're already doing in the MacroAssembler.

::: js/src/jit/CodeGenerator.cpp
@@ -867,5 @@
>  
>      OutOfLineCode *ool = oolCallVM(IntToStringInfo, lir, (ArgList(), input),
>                                     StoreRegisterTo(output));
> -    if (!ool)
> -        return false;

The OutOfLineCode allocation is infallible so we shouldn't get a nullptr ool right?
Attachment #8531399 - Flags: review?(jdemooij) → review+
(Assignee)

Comment 2

4 years ago
(In reply to Jan de Mooij [:jandem] from comment #1)
> The OutOfLineCode allocation is infallible so we shouldn't get a nullptr ool
> right?

Yes, the code was already assuming that OutOfLineCode allocations were infallible, and the only way this function could fail earlier was if we failed to append to some vector.
https://hg.mozilla.org/mozilla-central/rev/60bb5b8e5ae0
Assignee: nobody → bhackett1024
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.