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

Issue 1304633002: Correctify instanceof and make it optimizable. (Closed)

Created:
5 years, 4 months ago by Benedikt Meurer
Modified:
5 years, 4 months ago
Reviewers:
Paul Lind, v8-mips-ports, Yang, Michael Starzinger, akos.palfi.imgtec
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Correctify instanceof and make it optimizable. The previous hack with HInstanceOfKnownGlobal was not only slower, but also very brittle and required a lot of weird hacks to support it. And what's even more important it wasn't even correct (because a map check on the lhs is never enough for instanceof). The new implementation provides a sane runtime implementation for InstanceOf plus a fast case in the InstanceOfStub, combined with a proper specialization in the case of a known global in CrankShaft, which does only the prototype chain walk (coupled with a code dependency on the known global). As a drive-by-fix: Also fix the incorrect Object.prototype.isPrototypeOf implementation. BUG=v8:4376 LOG=y Committed: https://crrev.com/5d875a57fa2e65c1a4a6b50aeb23c38299c3cfbc Cr-Commit-Position: refs/heads/master@{#30342}

Patch Set 1 : Initial patch (x64, arm and ia32) #

Patch Set 2 : Add arm64 port. #

Total comments: 2

Patch Set 3 : REBASE #

Patch Set 4 : Address Yangs comment. #

Patch Set 5 : REBASE. Add MIPS/MIPS64 ports. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1170 lines, -2974 lines) Patch
M src/arm/code-stubs-arm.cc View 1 2 3 1 chunk +95 lines, -196 lines 0 comments Download
M src/arm/interface-descriptors-arm.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/arm/lithium-arm.h View 3 chunks +13 lines, -29 lines 0 comments Download
M src/arm/lithium-arm.cc View 2 chunks +10 lines, -19 lines 0 comments Download
M src/arm/lithium-codegen-arm.h View 2 chunks +3 lines, -3 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 2 chunks +35 lines, -148 lines 0 comments Download
M src/arm/macro-assembler-arm.h View 2 chunks +2 lines, -13 lines 0 comments Download
M src/arm/macro-assembler-arm.cc View 3 chunks +2 lines, -106 lines 0 comments Download
M src/arm64/code-stubs-arm64.cc View 1 2 3 1 chunk +94 lines, -178 lines 0 comments Download
M src/arm64/interface-descriptors-arm64.cc View 1 2 1 chunk +2 lines, -10 lines 0 comments Download
M src/arm64/lithium-arm64.h View 1 3 chunks +16 lines, -27 lines 0 comments Download
M src/arm64/lithium-arm64.cc View 1 2 chunks +11 lines, -18 lines 0 comments Download
M src/arm64/lithium-codegen-arm64.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/arm64/lithium-codegen-arm64.cc View 1 1 chunk +26 lines, -122 lines 0 comments Download
M src/arm64/macro-assembler-arm64.h View 1 2 chunks +2 lines, -21 lines 0 comments Download
M src/arm64/macro-assembler-arm64.cc View 1 3 chunks +2 lines, -54 lines 0 comments Download
M src/bailout-reason.h View 1 chunk +0 lines, -2 lines 0 comments Download
M src/builtins.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/code-factory.h View 1 chunk +1 line, -1 line 0 comments Download
M src/code-factory.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M src/code-stubs.h View 1 2 3 4 2 chunks +6 lines, -39 lines 0 comments Download
M src/code-stubs.cc View 1 2 3 4 1 chunk +0 lines, -8 lines 0 comments Download
M src/compiler/js-generic-lowering.cc View 1 chunk +1 line, -4 lines 0 comments Download
M src/full-codegen/arm/full-codegen-arm.cc View 1 2 1 chunk +6 lines, -7 lines 0 comments Download
M src/full-codegen/arm64/full-codegen-arm64.cc View 1 2 1 chunk +6 lines, -5 lines 0 comments Download
M src/full-codegen/ia32/full-codegen-ia32.cc View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M src/full-codegen/mips/full-codegen-mips.cc View 1 2 3 4 1 chunk +7 lines, -5 lines 0 comments Download
M src/full-codegen/mips64/full-codegen-mips64.cc View 1 2 3 4 1 chunk +7 lines, -5 lines 0 comments Download
M src/full-codegen/x64/full-codegen-x64.cc View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M src/hydrogen.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M src/hydrogen.cc View 1 2 3 4 2 chunks +25 lines, -5 lines 0 comments Download
M src/hydrogen-instructions.h View 2 chunks +17 lines, -19 lines 0 comments Download
M src/hydrogen-instructions.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/ia32/code-stubs-ia32.cc View 1 2 3 1 chunk +95 lines, -220 lines 0 comments Download
M src/ia32/interface-descriptors-ia32.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.h View 2 chunks +3 lines, -3 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 2 chunks +39 lines, -107 lines 0 comments Download
M src/ia32/lithium-ia32.h View 3 chunks +16 lines, -27 lines 0 comments Download
M src/ia32/lithium-ia32.cc View 2 chunks +11 lines, -19 lines 0 comments Download
M src/ia32/macro-assembler-ia32.h View 1 2 3 4 1 chunk +2 lines, -5 lines 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 2 chunks +3 lines, -37 lines 0 comments Download
M src/interface-descriptors.h View 1 2 2 chunks +5 lines, -5 lines 0 comments Download
M src/interface-descriptors.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/mips/code-stubs-mips.cc View 1 2 3 4 1 chunk +93 lines, -190 lines 0 comments Download
M src/mips/interface-descriptors-mips.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M src/mips/lithium-codegen-mips.h View 1 2 3 4 2 chunks +5 lines, -7 lines 0 comments Download
M src/mips/lithium-codegen-mips.cc View 1 2 3 4 2 chunks +38 lines, -136 lines 0 comments Download
M src/mips/lithium-mips.h View 1 2 3 4 3 chunks +13 lines, -29 lines 0 comments Download
M src/mips/lithium-mips.cc View 1 2 3 4 2 chunks +10 lines, -19 lines 0 comments Download
M src/mips/macro-assembler-mips.h View 1 2 3 4 2 chunks +2 lines, -14 lines 0 comments Download
M src/mips/macro-assembler-mips.cc View 1 2 3 4 3 chunks +2 lines, -96 lines 0 comments Download
M src/mips64/code-stubs-mips64.cc View 1 2 3 4 1 chunk +93 lines, -190 lines 0 comments Download
M src/mips64/interface-descriptors-mips64.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M src/mips64/lithium-codegen-mips64.h View 1 2 3 4 2 chunks +5 lines, -6 lines 0 comments Download
M src/mips64/lithium-codegen-mips64.cc View 1 2 3 4 2 chunks +39 lines, -133 lines 0 comments Download
M src/mips64/lithium-mips64.h View 1 2 3 4 3 chunks +13 lines, -29 lines 0 comments Download
M src/mips64/lithium-mips64.cc View 1 2 3 4 2 chunks +10 lines, -19 lines 0 comments Download
M src/mips64/macro-assembler-mips64.h View 1 2 3 4 2 chunks +2 lines, -14 lines 0 comments Download
M src/mips64/macro-assembler-mips64.cc View 1 2 3 4 3 chunks +2 lines, -125 lines 0 comments Download
M src/objects.h View 1 2 3 4 3 chunks +9 lines, -0 lines 0 comments Download
M src/runtime.js View 1 2 2 chunks +0 lines, -33 lines 0 comments Download
M src/runtime/runtime.h View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M src/runtime/runtime-object.cc View 1 2 2 chunks +54 lines, -10 lines 0 comments Download
M src/v8natives.js View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/x64/code-stubs-x64.cc View 1 2 3 1 chunk +98 lines, -210 lines 0 comments Download
M src/x64/interface-descriptors-x64.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M src/x64/lithium-codegen-x64.h View 2 chunks +3 lines, -3 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 2 chunks +36 lines, -117 lines 0 comments Download
M src/x64/lithium-x64.h View 3 chunks +10 lines, -26 lines 0 comments Download
M src/x64/lithium-x64.cc View 2 chunks +10 lines, -18 lines 0 comments Download
M src/x64/macro-assembler-x64.h View 1 chunk +1 line, -4 lines 0 comments Download
M src/x64/macro-assembler-x64.cc View 2 chunks +2 lines, -38 lines 0 comments Download
A test/mjsunit/regress/regress-4376-1.js View 1 chunk +12 lines, -0 lines 0 comments Download
A + test/mjsunit/regress/regress-4376-2.js View 1 chunk +5 lines, -3 lines 0 comments Download
A + test/mjsunit/regress/regress-4376-3.js View 1 chunk +6 lines, -3 lines 0 comments Download
M test/webkit/fast/js/object-prototype-properties-expected.txt View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 23 (12 generated)
Benedikt Meurer
Yang: Please do the overall review. Michi: Please take a look at the TF changes. ...
5 years, 4 months ago (2015-08-21 10:27:58 UTC) #10
Michael Starzinger
LGTM on TurboFan, CodeFactory and InterfaceDescriptor. Didn't look at the rest.
5 years, 4 months ago (2015-08-21 10:32:35 UTC) #11
Yang
On 2015/08/21 10:32:35, Michael Starzinger wrote: > LGTM on TurboFan, CodeFactory and InterfaceDescriptor. Didn't look ...
5 years, 4 months ago (2015-08-24 07:30:49 UTC) #12
Yang
... and the comment https://codereview.chromium.org/1304633002/diff/180001/src/arm/code-stubs-arm.cc File src/arm/code-stubs-arm.cc (right): https://codereview.chromium.org/1304633002/diff/180001/src/arm/code-stubs-arm.cc#newcode1305 src/arm/code-stubs-arm.cc:1305: // Lookup the {function} and ...
5 years, 4 months ago (2015-08-24 07:31:06 UTC) #13
Benedikt Meurer
https://codereview.chromium.org/1304633002/diff/180001/src/arm/code-stubs-arm.cc File src/arm/code-stubs-arm.cc (right): https://codereview.chromium.org/1304633002/diff/180001/src/arm/code-stubs-arm.cc#newcode1305 src/arm/code-stubs-arm.cc:1305: // Lookup the {function} and the {object} map in ...
5 years, 4 months ago (2015-08-24 07:37:47 UTC) #14
akos.palfi.imgtec
Hi Benedikt - We are working on the mips port, will upload the port ASAP.
5 years, 4 months ago (2015-08-24 10:51:31 UTC) #16
paul.l...
Hey Benedikt - MIPS ports in https://codereview.chromium.org/1316543002/
5 years, 4 months ago (2015-08-25 01:30:53 UTC) #17
Benedikt Meurer
On 2015/08/25 01:30:53, paul.l... wrote: > Hey Benedikt - MIPS ports in https://codereview.chromium.org/1316543002/ Thanks a ...
5 years, 4 months ago (2015-08-25 04:23:33 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1304633002/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1304633002/240001
5 years, 4 months ago (2015-08-25 04:24:06 UTC) #21
commit-bot: I haz the power
Committed patchset #5 (id:240001)
5 years, 4 months ago (2015-08-25 04:48:45 UTC) #22
commit-bot: I haz the power
5 years, 4 months ago (2015-08-25 04:49:04 UTC) #23
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/5d875a57fa2e65c1a4a6b50aeb23c38299c3cfbc
Cr-Commit-Position: refs/heads/master@{#30342}

Powered by Google App Engine
This is Rietveld 408576698