Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Issue 2843049: Simplify the transitions in the Binary Op ICs. Now a single call... (Closed)

Created:
10 years, 5 months ago by Erik Corry
Modified:
9 years, 7 months ago
Reviewers:
Kasper Lund
CC:
v8-dev
Visibility:
Public.

Description

Simplify the transitions in the Binary Op ICs. Now a single call to the runtime will both patch in the more specialized binary op stub and calculate the answer. This eliminates the need to call both the rest of the binary op and the patching runtime call. The runtime routines are altered to be more agressive in returning Smis so we don't get spurious heap numbers as inputs to binary ops while we are patching the binary op ICs. Committed: http://code.google.com/p/v8/source/detail?r=5026

Patch Set 1 #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+329 lines, -283 lines) Patch
M src/arm/codegen-arm.cc View 3 chunks +211 lines, -218 lines 4 comments Download
M src/ia32/codegen-ia32.cc View 2 chunks +7 lines, -29 lines 2 comments Download
M src/ic.cc View 2 chunks +59 lines, -5 lines 0 comments Download
M src/runtime.cc View 4 chunks +4 lines, -4 lines 2 comments Download
M src/x64/codegen-x64.cc View 3 chunks +5 lines, -26 lines 0 comments Download
M test/mjsunit/math-min-max.js View 1 chunk +10 lines, -1 line 0 comments Download
A test/mjsunit/value-of.js View 1 chunk +33 lines, -0 lines 2 comments Download

Messages

Total messages: 3 (0 generated)
Erik Corry
10 years, 5 months ago (2010-07-06 11:19:13 UTC) #1
Kasper Lund
LGTM. As we discussed, it would be nice to start moving this tricky code out ...
10 years, 5 months ago (2010-07-06 11:56:35 UTC) #2
Erik Corry
10 years, 5 months ago (2010-07-06 12:53:21 UTC) #3
http://codereview.chromium.org/2843049/diff/1/2
File src/arm/codegen-arm.cc (right):

http://codereview.chromium.org/2843049/diff/1/2#newcode7838
src/arm/codegen-arm.cc:7838: if (generate_code_to_calculate_answer ||
slow_reverse.is_linked()) {
On 2010/07/06 11:56:35, Kasper Lund wrote:
> Maybe just move the if (lhs.is(r0)) code into the next then-part that's
guarded
> by if (generate_code...)?

Done.

http://codereview.chromium.org/2843049/diff/1/2#newcode7849
src/arm/codegen-arm.cc:7849: if (generate_code_to_calculate_answer ||
slow.is_linked()) {
On 2010/07/06 11:56:35, Kasper Lund wrote:
> I would consider negating the condition and returning at this point.

Done.

http://codereview.chromium.org/2843049/diff/1/3
File src/ia32/codegen-ia32.cc (right):

http://codereview.chromium.org/2843049/diff/1/3#newcode10233
src/ia32/codegen-ia32.cc:10233: // Patch the caller to an appropriate
specialized stub and return the
On 2010/07/06 11:56:35, Kasper Lund wrote:
> I guess it doesn't really return anymore? Does it?

Well it's a tail call so it returns the answer to the caller of the stub.

http://codereview.chromium.org/2843049/diff/1/5
File src/runtime.cc (right):

http://codereview.chromium.org/2843049/diff/1/5#newcode5580
src/runtime.cc:5580: return Heap::NumberFromDouble(x + y);
On 2010/07/06 11:56:35, Kasper Lund wrote:
> No more AllocateHeapNumber left in runtime.cc?

I removed one for integer Math.pow, but the rest were very unlikely to be Smis
so I left them as plain AllocateHeapNumber because it is faster for things that
are not Smis.

http://codereview.chromium.org/2843049/diff/1/8
File test/mjsunit/value-of.js (right):

http://codereview.chromium.org/2843049/diff/1/8#newcode33
test/mjsunit/value-of.js:33: assertThrows(function() {o + 1; }, MyException);
On 2010/07/06 11:56:35, Kasper Lund wrote:
> {o + 1; } => { o + 1 }

Done.

Powered by Google App Engine
This is Rietveld 408576698