Closed
Bug 956402
Opened 11 years ago
Closed 11 years ago
OdinMonkey: refactoring: add Float to NumLit
Categories
(Core :: JavaScript Engine: JIT, defect)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: luke, Assigned: luke)
Details
Attachments
(1 file)
39.52 KB,
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
I just noticed that we could simplify the float logic by having float literals use the same NumLit/IsNumericLiteral/ExtractNumericLiteral machinery as everything else. Doing this caused a cascade of minor simplifications which altogether remove 40 lines. The patch would've been shorter if I hadn't had to move NumLit et al to be under ModuleCompiler (b/c they now depend on the definition of ModuleCompiler).
Attachment #8355647 -
Flags: review?(benj)
Comment 1•11 years ago
|
||
Comment on attachment 8355647 [details] [diff] [review]
factor-f32-literal
Review of attachment 8355647 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks! That's a great refactoring, it integrates way cleaner with the pre-existing code.
::: js/src/jit/AsmJS.cpp
@@ +1672,5 @@
> +
> +// Represents the type and value of an asm.js numeric literal.
> +//
> +// A literal is a double iff the literal contains an exponent or decimal point
> +// (even if the fractional part is 0). Otherwise, integers may be classified:
This comment asks for an update.
@@ +1716,5 @@
> + }
> +
> + float toFloat() const {
> + JS_ASSERT(which_ == Float);
> + return (float)v_.toDouble();
nit: wouldn't you prefer a C++-er conversion, like
return float(v_.toDouble());
though it probably doesn't make a difference for the compiler.
Attachment #8355647 -
Flags: review?(benj) → review+
![]() |
Assignee | |
Comment 2•11 years ago
|
||
I would prefer that :)
https://hg.mozilla.org/integration/mozilla-inbound/rev/5568609fa907
Assignee: nobody → luke
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in
before you can comment on or make changes to this bug.
Description
•