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

Issue 2547043002: [Interpreter] Optimize equality check with null/undefined with a check on the map. (Closed)

Created:
4 years ago by mythria
Modified:
4 years ago
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[Interpreter] Optimize equality check with null/undefined with a check on the map. Equality with null/undefined is equivalent to a check on the undetectable bit on the map of the object. This would be more efficient than performing the entire comparison operation. This cl introduces: 1. A new bytecode called TestUndetectable that checks if the object is null/undefined. 2. Updates peeophole optimizer to emit TestUndetectable when a LdaNull/Undefined precedes equality check. 4. TestUndetectable is transformed to ObjectIsUndetectable operator when building turbofan graph. BUG=v8:4280 Committed: https://crrev.com/9119d16904e9062d319427029c2c74270776e68e Cr-Commit-Position: refs/heads/master@{#41514}

Patch Set 1 #

Patch Set 2 : Fixed a bug in reducing JSIsUndetectable. #

Total comments: 15

Patch Set 3 : addressed comments from Ross. #

Patch Set 4 : Reduce to simplified operator instead of using a new JSOperator. #

Patch Set 5 : A couple of fixes: 1. TestUndetectable writes boolean to accumulator 2. New optimization to load un… #

Total comments: 11

Patch Set 6 : Address comments from Ross. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+298 lines, -40 lines) Patch
M src/compiler/bytecode-graph-builder.cc View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M src/interpreter/bytecode-generator.h View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M src/interpreter/bytecode-generator.cc View 1 2 3 4 5 2 chunks +10 lines, -2 lines 0 comments Download
M src/interpreter/bytecode-peephole-optimizer.cc View 1 2 3 4 5 2 chunks +21 lines, -0 lines 0 comments Download
M src/interpreter/bytecode-peephole-table.h View 1 chunk +11 lines, -10 lines 0 comments Download
M src/interpreter/bytecodes.h View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M src/interpreter/interpreter.cc View 1 chunk +32 lines, -0 lines 0 comments Download
M src/interpreter/mkpeephole.cc View 1 2 3 4 5 1 chunk +13 lines, -0 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ForOf.golden View 1 2 3 4 12 chunks +16 lines, -20 lines 0 comments Download
A test/cctest/interpreter/bytecode_expectations/GenerateTestUndetectable.golden View 1 2 3 4 1 chunk +123 lines, -0 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/Generators.golden View 1 2 3 4 3 chunks +6 lines, -7 lines 0 comments Download
M test/cctest/interpreter/test-bytecode-generator.cc View 1 2 3 4 1 chunk +25 lines, -0 lines 0 comments Download
M test/cctest/test-serialize.cc View 1 chunk +1 line, -1 line 0 comments Download
M test/unittests/interpreter/bytecode-array-builder-unittest.cc View 2 chunks +7 lines, -0 lines 0 comments Download
M test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc View 1 2 1 chunk +19 lines, -0 lines 0 comments Download

Messages

Total messages: 47 (34 generated)
mythria
This cl simplified checks with null/undefined by a check on the undetectable bit on the ...
4 years ago (2016-12-05 10:05:42 UTC) #12
rmcilroy
LGTM once comments are addressed. One question - do we need a separate js-operator for ...
4 years ago (2016-12-05 10:57:19 UTC) #13
Benedikt Meurer
LGTM % question: Wouldn't it make sense to have a JumpIfIsUndetectable instruction then?
4 years ago (2016-12-05 11:29:12 UTC) #14
rmcilroy
On 2016/12/05 11:29:12, Benedikt Meurer wrote: > LGTM % question: Wouldn't it make sense to ...
4 years ago (2016-12-05 14:14:35 UTC) #15
mythria
Thanks Benedikt and Ross. Benedikt, That is a good suggestion. I will do the JumpIfUndetectable ...
4 years ago (2016-12-05 14:53:11 UTC) #20
mythria
When building turbofan graph for TestUndetectable, now I use the simplified operator ObjectIsUndetectable directly. So ...
4 years ago (2016-12-05 15:25:30 UTC) #25
mythria
I am sorry for so many mails and patches. I am somehow seem to be ...
4 years ago (2016-12-05 17:48:12 UTC) #32
Benedikt Meurer
Ack. LGTM still.
4 years ago (2016-12-05 18:30:12 UTC) #33
rmcilroy
LGTM, thanks. https://codereview.chromium.org/2547043002/diff/20001/src/interpreter/bytecode-peephole-optimizer.cc File src/interpreter/bytecode-peephole-optimizer.cc (right): https://codereview.chromium.org/2547043002/diff/20001/src/interpreter/bytecode-peephole-optimizer.cc#newcode270 src/interpreter/bytecode-peephole-optimizer.cc:270: if (!node->source_info().is_valid() || !last()->source_info().is_valid()) { On 2016/12/05 ...
4 years ago (2016-12-05 19:08:09 UTC) #34
mythria
Thanks for your reviews. Ross, Fixed all of them. Thanks, Mythri https://codereview.chromium.org/2547043002/diff/80001/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): ...
4 years ago (2016-12-06 10:13:27 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2547043002/100001
4 years ago (2016-12-06 11:30:07 UTC) #42
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years ago (2016-12-06 11:32:17 UTC) #45
commit-bot: I haz the power
4 years ago (2016-12-06 11:32:44 UTC) #47
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/9119d16904e9062d319427029c2c74270776e68e
Cr-Commit-Position: refs/heads/master@{#41514}

Powered by Google App Engine
This is Rietveld 408576698