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

Issue 6708085: Enable GVN for polymorphic loads by not expanding them at the HIR level. (Closed)

Created:
9 years, 9 months ago by fschneider
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Enable GVN for polymorphic loads by not expanding them at the HIR level. This change adds a new IR instruction for polymorphic loads. It performs map compares and loads in one IR instruction instead of splitting each load into a graph of map-compares and field loads. The advantage is a smaller IR and less basic blocks, plus it allows to do GVN on polymorphic loads. Committed: http://code.google.com/p/v8/source/detail?r=7336

Patch Set 1 #

Total comments: 15

Patch Set 2 : '' #

Patch Set 3 : x64 and arm code #

Total comments: 10

Patch Set 4 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+389 lines, -71 lines) Patch
M src/arm/lithium-arm.h View 1 2 2 chunks +14 lines, -0 lines 0 comments Download
M src/arm/lithium-arm.cc View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
M src/arm/lithium-codegen-arm.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 2 3 1 chunk +66 lines, -0 lines 1 comment Download
M src/hydrogen.h View 1 chunk +0 lines, -4 lines 0 comments Download
M src/hydrogen.cc View 2 chunks +2 lines, -66 lines 0 comments Download
M src/hydrogen-instructions.h View 1 2 3 2 chunks +32 lines, -0 lines 0 comments Download
M src/hydrogen-instructions.cc View 1 2 3 1 chunk +54 lines, -0 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 2 3 2 chunks +66 lines, -1 line 0 comments Download
M src/ia32/lithium-ia32.h View 1 2 chunks +16 lines, -0 lines 0 comments Download
M src/ia32/lithium-ia32.cc View 1 chunk +15 lines, -0 lines 0 comments Download
M src/x64/lithium-codegen-x64.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 2 3 1 chunk +66 lines, -0 lines 0 comments Download
M src/x64/lithium-x64.h View 1 2 2 chunks +14 lines, -0 lines 0 comments Download
M src/x64/lithium-x64.cc View 1 2 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
fschneider
RFC: Only ia32 for now. We should also discuss what to do for stores.
9 years, 9 months ago (2011-03-22 15:15:24 UTC) #1
Kevin Millikin (Chromium)
I like the approach. Comments below. http://codereview.chromium.org/6708085/diff/1/src/hydrogen-instructions.cc File src/hydrogen-instructions.cc (right): http://codereview.chromium.org/6708085/diff/1/src/hydrogen-instructions.cc#newcode1202 src/hydrogen-instructions.cc:1202: return false; This ...
9 years, 9 months ago (2011-03-23 08:08:53 UTC) #2
fschneider
Addressed comments. http://codereview.chromium.org/6708085/diff/1/src/hydrogen-instructions.cc File src/hydrogen-instructions.cc (right): http://codereview.chromium.org/6708085/diff/1/src/hydrogen-instructions.cc#newcode1202 src/hydrogen-instructions.cc:1202: return false; On 2011/03/23 08:08:53, Kevin Millikin ...
9 years, 9 months ago (2011-03-23 13:57:55 UTC) #3
Kevin Millikin (Chromium)
http://codereview.chromium.org/6708085/diff/1/src/ia32/lithium-codegen-ia32.cc File src/ia32/lithium-codegen-ia32.cc (right): http://codereview.chromium.org/6708085/diff/1/src/ia32/lithium-codegen-ia32.cc#newcode2155 src/ia32/lithium-codegen-ia32.cc:2155: __ cmp(FieldOperand(object, HeapObject::kMapOffset), map); OK, leaving it for later ...
9 years, 9 months ago (2011-03-23 14:17:04 UTC) #4
fschneider
Added x64 and ARM files.
9 years, 9 months ago (2011-03-23 15:13:54 UTC) #5
Kevin Millikin (Chromium)
Next round of comments. http://codereview.chromium.org/6708085/diff/13003/src/arm/lithium-codegen-arm.cc File src/arm/lithium-codegen-arm.cc (right): http://codereview.chromium.org/6708085/diff/13003/src/arm/lithium-codegen-arm.cc#newcode2202 src/arm/lithium-codegen-arm.cc:2202: int map_count = instr->hydrogen()->types()->length(); This ...
9 years, 9 months ago (2011-03-23 15:37:29 UTC) #6
fschneider
http://codereview.chromium.org/6708085/diff/13003/src/arm/lithium-codegen-arm.cc File src/arm/lithium-codegen-arm.cc (right): http://codereview.chromium.org/6708085/diff/13003/src/arm/lithium-codegen-arm.cc#newcode2202 src/arm/lithium-codegen-arm.cc:2202: int map_count = instr->hydrogen()->types()->length(); On 2011/03/23 15:37:29, Kevin Millikin ...
9 years, 9 months ago (2011-03-24 08:43:30 UTC) #7
Kevin Millikin (Chromium)
9 years, 9 months ago (2011-03-24 09:28:24 UTC) #8
http://codereview.chromium.org/6708085/diff/14001/src/arm/lithium-codegen-arm.cc
File src/arm/lithium-codegen-arm.cc (right):

http://codereview.chromium.org/6708085/diff/14001/src/arm/lithium-codegen-arm...
src/arm/lithium-codegen-arm.cc:2228: EmitLoadField(result, object, map, name);
BTW, you can write a single call to EmitLoadField by branching on eq and moving
EmitLoadField out of the if:

if (...) {
  Label load;
  __ b(eq, &load);
  // Call
  __ b(&done);
  __ bind(&load);
} else {
  DeoptimizeIf(...);
}
EmitLoadField(...);

It probably doesn't make much difference.

Powered by Google App Engine
This is Rietveld 408576698