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

Issue 146623007: Merge BuildLoadKeyedGeneric and BuildStoreKeyedGeneric, switch on AccessType (Closed)

Created:
6 years, 10 months ago by Toon Verwaest
Modified:
6 years, 10 months ago
CC:
v8-dev
Visibility:
Public.

Description

Merge BuildLoadKeyedGeneric and BuildStoreKeyedGeneric, switch on AccessType R=ishell@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=19228

Patch Set 1 #

Patch Set 2 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -33 lines) Patch
M src/hydrogen.h View 1 2 chunks +4 lines, -5 lines 0 comments Download
M src/hydrogen.cc View 5 chunks +15 lines, -28 lines 2 comments Download

Messages

Total messages: 5 (0 generated)
Toon Verwaest
PTAL
6 years, 10 months ago (2014-02-10 14:41:20 UTC) #1
Igor Sheludko
lgtm
6 years, 10 months ago (2014-02-10 14:47:11 UTC) #2
Toon Verwaest
Committed patchset #2 manually as r19228 (presubmit successful).
6 years, 10 months ago (2014-02-10 14:58:31 UTC) #3
tfarina
https://codereview.chromium.org/146623007/diff/40001/src/hydrogen.cc File src/hydrogen.cc (right): https://codereview.chromium.org/146623007/diff/40001/src/hydrogen.cc#newcode6177 src/hydrogen.cc:6177: } else { no 'else' after return. you can ...
6 years, 10 months ago (2014-02-10 15:01:28 UTC) #4
Sven Panne
6 years, 10 months ago (2014-02-11 07:08:35 UTC) #5
Message was sent while issue was closed.
Late DBC...

https://codereview.chromium.org/146623007/diff/40001/src/hydrogen.cc
File src/hydrogen.cc (right):

https://codereview.chromium.org/146623007/diff/40001/src/hydrogen.cc#newcode6177
src/hydrogen.cc:6177: } else {
On 2014/02/10 15:01:29, tfarina wrote:
> no 'else' after return.

Although I am a big fan of "comb-like" control flow, where you simply chain
together ifs with early returns for special cases without nesting them (humans
are *very* bad at mentally following nested things), this would be a wrong place
for using it IMHO: Returning early for LOAD would make it look like a special
case, which it isn't.


> you can also use a ternay operator here:
> 
> return (access_type == LOAD) ? New<...>(...) : New<...>(...);

Nope, both "branches" of a ternary have to be of the same type, inheritance
doesn't work here as one would expect. Having said that, I normally prefer
ternaries very much, but only when possible. ;-)

Powered by Google App Engine
This is Rietveld 408576698