Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(48)

Issue 1355113002: [ic] Also collect known map for relational comparison. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 year, 8 months ago by Benedikt Meurer
Modified:
1 year, 8 months ago
Reviewers:
adamk, Jakob Kummerow
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[ic] Also collect known map for relational comparison. Previously we only collected the known map for equality comparisons. But if we also collect it for relational comparisons, we can inline a fast path of ToPrimitive on the objects, which is especially interesting since both sides have the same map. For now we only inline a very limited subset of ToPrimitive in Crankshaft, which is when the receiver map (and its prototype chain) doesn't have @@toPrimitive, and both valueOf and toString are the default versions on the %ObjectPrototype%. In this case the relational comparison would reduce to a string comparison of "[object CLASS]" with itself and so we can reduce that to a boolean constant plus map checks on both left and right hand side, plus code dependencies on the prototype chain. This repairs the regression on box2d. R=jkummerow@chromium.org BUG=chromium:534200 LOG=n Committed: https://crrev.com/e56f265f6d41fadbcea2be65d9b573bad8b4709d Cr-Commit-Position: refs/heads/master@{#30852}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Address Jakob's comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+197 lines, -24 lines) Patch
M src/arm/code-stubs-arm.cc View 1 chunk +14 lines, -2 lines 0 comments Download
M src/arm64/code-stubs-arm64.cc View 1 chunk +13 lines, -0 lines 0 comments Download
M src/code-stubs.cc View 1 chunk +0 lines, -1 line 0 comments Download
M src/contexts.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/hydrogen.cc View 1 chunk +40 lines, -0 lines 0 comments Download
M src/ia32/code-stubs-ia32.cc View 1 chunk +15 lines, -6 lines 0 comments Download
M src/ic/ic-state.cc View 2 chunks +4 lines, -5 lines 0 comments Download
M src/mips/code-stubs-mips.cc View 1 chunk +14 lines, -2 lines 0 comments Download
M src/mips64/code-stubs-mips64.cc View 1 chunk +14 lines, -2 lines 0 comments Download
M src/v8natives.js View 1 chunk +2 lines, -0 lines 0 comments Download
M src/x64/code-stubs-x64.cc View 1 chunk +15 lines, -6 lines 0 comments Download
M test/mjsunit/compare-known-objects.js View 1 2 chunks +32 lines, -0 lines 0 comments Download
M test/mjsunit/compare-known-objects-slow.js View 1 2 chunks +32 lines, -0 lines 0 comments Download
Commit queue not available (can’t edit this change).

Messages

Total messages: 12 (3 generated)
Benedikt Meurer
1 year, 8 months ago (2015-09-21 13:03:07 UTC) #1
Benedikt Meurer
Hey Jakob, Here's the - actually not even so hacky - fix for the Box2d ...
1 year, 8 months ago (2015-09-21 13:05:00 UTC) #2
Jakob Kummerow
LGTM, but please test ALL the affected comparison operators. https://codereview.chromium.org/1355113002/diff/1/test/mjsunit/compare-known-objects.js File test/mjsunit/compare-known-objects.js (right): https://codereview.chromium.org/1355113002/diff/1/test/mjsunit/compare-known-objects.js#newcode46 test/mjsunit/compare-known-objects.js:46: ...
1 year, 8 months ago (2015-09-21 13:36:26 UTC) #3
Benedikt Meurer
https://codereview.chromium.org/1355113002/diff/1/test/mjsunit/compare-known-objects.js File test/mjsunit/compare-known-objects.js (right): https://codereview.chromium.org/1355113002/diff/1/test/mjsunit/compare-known-objects.js#newcode46 test/mjsunit/compare-known-objects.js:46: function ge(a, b) { On 2015/09/21 13:36:26, Jakob wrote: ...
1 year, 8 months ago (2015-09-21 15:39:49 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1355113002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1355113002/20001
1 year, 8 months ago (2015-09-21 15:39:56 UTC) #7
commit-bot: I haz the power
Committed patchset #2 (id:20001)
1 year, 8 months ago (2015-09-21 16:05:32 UTC) #8
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/e56f265f6d41fadbcea2be65d9b573bad8b4709d Cr-Commit-Position: refs/heads/master@{#30852}
1 year, 8 months ago (2015-09-21 16:05:53 UTC) #9
adamk
I don't see mention of @@toStringTag in this patch, but it seems like you're expecting ...
1 year, 8 months ago (2015-09-21 22:27:08 UTC) #11
Benedikt Meurer
1 year, 8 months ago (2015-09-22 03:30:59 UTC) #12
Message was sent while issue was closed.
On 2015/09/21 22:27:08, adamk wrote:
> I don't see mention of @@toStringTag in this patch, but it seems like you're
> expecting that you know the output of Object.prototype.toString. How does this
> work with objects that have a  @@toStringTag property?

Nice catch, thanks. We need to make sure that if @@toStringTag is present, it
must not be an accessor property.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 650457f06