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

Issue 5550003: Add optimized compiler support for generic global loads.... (Closed)

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

Description

Add optimized compiler support for generic global loads. These are needed if an access check is required or if we read from a global variable that has not beed introduced yet.

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 10

Patch Set 3 : '' #

Patch Set 4 : rebased and refactored #

Patch Set 5 : '' #

Patch Set 6 : ported to x64 and arm #

Unified diffs Side-by-side diffs Delta from patch set Stats (+187 lines, -32 lines) Patch
M src/arm/lithium-arm.h View 1 2 3 4 5 2 chunks +8 lines, -0 lines 0 comments Download
M src/arm/lithium-arm.cc View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 2 3 4 5 1 chunk +12 lines, -0 lines 0 comments Download
M src/hydrogen.h View 1 2 3 4 5 4 chunks +10 lines, -2 lines 0 comments Download
M src/hydrogen.cc View 1 2 3 4 5 6 chunks +48 lines, -30 lines 0 comments Download
M src/hydrogen-instructions.h View 1 2 3 4 5 2 chunks +33 lines, -0 lines 0 comments Download
M src/hydrogen-instructions.cc View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 2 3 4 5 1 chunk +13 lines, -0 lines 0 comments Download
M src/ia32/lithium-ia32.h View 1 2 3 4 5 2 chunks +16 lines, -0 lines 0 comments Download
M src/ia32/lithium-ia32.cc View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 2 3 4 5 1 chunk +12 lines, -0 lines 0 comments Download
M src/x64/lithium-x64.h View 1 2 3 4 5 2 chunks +8 lines, -0 lines 0 comments Download
M src/x64/lithium-x64.cc View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
fschneider
10 years ago (2010-12-07 15:22:39 UTC) #1
Kevin Millikin (Chromium)
Sorry I didn't get to this yesterday. This will now need to change after my ...
10 years ago (2010-12-09 13:16:51 UTC) #2
fschneider
10 years ago (2010-12-22 16:02:33 UTC) #3
Uploaded a new rebased/refactored version.

Please have another look.

http://codereview.chromium.org/5550003/diff/9001/src/hydrogen.cc
File src/hydrogen.cc (right):

http://codereview.chromium.org/5550003/diff/9001/src/hydrogen.cc#newcode2116
src/hydrogen.cc:2116: void HGraphBuilder::VisitForTypeofValue(Expression* expr)
{
On 2010/12/09 13:16:51, Kevin Millikin wrote:
> It seems to me that "parent is typeof" is just a flag on a value context, so
> this function could be:
> 
> void HGraphBuilder::VisitForTypeofValue(Expression* expr) {
>   ValueContext for_value(this);
>   for_value.mark_as_typeof();
>   Visit(expr);
> }
> 
> That also dodges any problems with "HandleGlobalVariableLoad" (see below).

Done.

http://codereview.chromium.org/5550003/diff/9001/src/hydrogen.cc#newcode2118
src/hydrogen.cc:2118: if (proxy != NULL && !proxy->var()->is_this() &&
proxy->var()->is_global()) {
On 2010/12/09 13:16:51, Kevin Millikin wrote:
> I think you can just ask the proxy is_this (and maybe is_global?).  If you
> follow my suggestion above you don't need to do anything here, though.

Done. This part of the code is now gone.

http://codereview.chromium.org/5550003/diff/9001/src/hydrogen.cc#newcode2957
src/hydrogen.cc:2957: void
HGraphBuilder::LookupGlobalPropertyCell(VariableProxy* expr,
On 2010/12/09 13:16:51, Kevin Millikin wrote:
> It seems like it would be cleaner for this function to return a boolean
> indicating whether it was found or not, rather than taking a pointer to a
flag.

I wanted to be able to use the BAILOUT macro from inside, but maybe it's not
worth it.

http://codereview.chromium.org/5550003/diff/9001/src/hydrogen.cc#newcode2979
src/hydrogen.cc:2979: void
HGraphBuilder::HandleGlobalVariableLoad(VariableProxy* expr,
On 2010/12/09 13:16:51, Kevin Millikin wrote:
> We need to restore some sanity to these helper functions.  There are dozens of
> "Visit....", "Build....", and "Handle...." in here with no consistent naming
> scheme.
> 
> I actually inlined this function and removed its definition in my last change
> because I was about to put a comment to the effect of "This function should
only
> be called in tail position as part of visiting...." and just decided to get
rid
> of the (called once) helper.

Done.

http://codereview.chromium.org/5550003/diff/9001/src/hydrogen.cc#newcode2988
src/hydrogen.cc:2988: PushAndAdd(new HLoadGlobalGeneric(expr->var()->name(),
inside_typeof));
On 2010/12/09 13:16:51, Kevin Millikin wrote:
> Here you could just ask the ast_context if it is a typeof context, which is
only
> true for value contexts with the typeof bit set.  There's no need to even pass
> it to this helper if you set up the context of the subexpression as suggested
> above.

Done.

Powered by Google App Engine
This is Rietveld 408576698