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

Issue 553149: Implement simple fast-path code for functions containing this property stores and global variables. (Closed)

Created:
10 years, 10 months ago by Kevin Millikin (Chromium)
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Implement simple fast-path code for functions containing this property stores and global variables. Code is specialized to the initial receiver. Committed: http://code.google.com/p/v8/source/detail?r=3760

Patch Set 1 #

Patch Set 2 : Add missing file to change list. #

Total comments: 29

Patch Set 3 : Incorporated codereview comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+783 lines, -251 lines) Patch
M src/SConscript View 3 chunks +3 lines, -0 lines 0 comments Download
M src/arm/codegen-arm.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A src/arm/fast-codegen-arm.cc View 1 2 1 chunk +139 lines, -0 lines 0 comments Download
M src/arm/full-codegen-arm.cc View 1 2 2 chunks +76 lines, -72 lines 0 comments Download
M src/compiler.h View 2 chunks +11 lines, -1 line 0 comments Download
M src/compiler.cc View 1 2 2 chunks +3 lines, -4 lines 0 comments Download
M src/data-flow.h View 2 chunks +5 lines, -1 line 0 comments Download
M src/data-flow.cc View 1 chunk +5 lines, -2 lines 0 comments Download
M src/fast-codegen.h View 1 2 2 chunks +35 lines, -6 lines 0 comments Download
M src/fast-codegen.cc View 1 2 6 chunks +58 lines, -26 lines 0 comments Download
M src/full-codegen.h View 3 chunks +10 lines, -3 lines 0 comments Download
M src/full-codegen.cc View 2 chunks +1 line, -2 lines 0 comments Download
M src/ia32/codegen-ia32.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A src/ia32/fast-codegen-ia32.cc View 1 2 1 chunk +141 lines, -0 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 1 chunk +66 lines, -64 lines 0 comments Download
M src/x64/codegen-x64.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A src/x64/fast-codegen-x64.cc View 1 2 1 chunk +140 lines, -0 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 1 chunk +69 lines, -67 lines 0 comments Download
M tools/gyp/v8.gyp View 3 chunks +3 lines, -0 lines 0 comments Download
M tools/visual_studio/v8_base.vcproj View 1 chunk +4 lines, -0 lines 0 comments Download
M tools/visual_studio/v8_base_arm.vcproj View 1 chunk +4 lines, -0 lines 0 comments Download
M tools/visual_studio/v8_base_x64.vcproj View 2 chunks +7 lines, -3 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Kevin Millikin (Chromium)
This change is not as big as it looks.
10 years, 10 months ago (2010-01-29 17:50:34 UTC) #1
antonm
minor notes and one question for my education. http://codereview.chromium.org/553149/diff/2001/2004 File src/arm/fast-codegen-arm.cc (right): http://codereview.chromium.org/553149/diff/2001/2004#newcode47 src/arm/fast-codegen-arm.cc:47: __ ...
10 years, 10 months ago (2010-01-29 19:16:11 UTC) #2
Lasse Reichstein
http://codereview.chromium.org/553149/diff/2001/2018 File src/x64/fast-codegen-x64.cc (right): http://codereview.chromium.org/553149/diff/2001/2018#newcode48 src/x64/fast-codegen-x64.cc:48: __ j(is_smi, bailout()); JumpIfSmi is preferred. It's a convenience ...
10 years, 10 months ago (2010-01-29 20:05:06 UTC) #3
Kasper Lund
LGTM. http://codereview.chromium.org/553149/diff/2001/2004 File src/arm/fast-codegen-arm.cc (right): http://codereview.chromium.org/553149/diff/2001/2004#newcode72 src/arm/fast-codegen-arm.cc:72: int index = 2 + function()->scope()->num_parameters(); Maybe refactor ...
10 years, 10 months ago (2010-02-01 09:29:02 UTC) #4
fschneider
LGTM! http://codereview.chromium.org/553149/diff/2001/2010 File src/fast-codegen.cc (right): http://codereview.chromium.org/553149/diff/2001/2010#newcode362 src/fast-codegen.cc:362: full_cgen.Generate(fun, FullCodeGenerator::SECONDARY); Should we also pass the CompilationInfo ...
10 years, 10 months ago (2010-02-01 10:04:59 UTC) #5
Kevin Millikin (Chromium)
10 years, 10 months ago (2010-02-01 10:38:40 UTC) #6
Thanks for the comments.  I'll work on incorporating them.

I'm not sure about the missing write barrier when writing context parameters. 
We should look into it because that code is unchanged from bleeding_edge.

I can do that when I get to work, but that will be about 7 hours from now....

http://codereview.chromium.org/553149/diff/2001/2005
File src/arm/full-codegen-arm.cc (right):

http://codereview.chromium.org/553149/diff/2001/2005#newcode84
src/arm/full-codegen-arm.cc:84: __ CallRuntime(Runtime::kNewContext, 1);
On 2010/02/01 09:29:02, Kasper Lund wrote:
> Consider using the faster new context stub if possible. At least add a TODO.

I didn't change this code at all (to be honest, I didn't even look at it).  I
guess the new context stub was never ported to the full code generator.

http://codereview.chromium.org/553149/diff/2001/2005#newcode99
src/arm/full-codegen-arm.cc:99: __ str(r0, MemOperand(cp,
Context::SlotOffset(slot->index())));
On 2010/02/01 09:29:02, Kasper Lund wrote:
> This doesn't use the write barrier and that is safe because? At least we
should
> have a comment.

I'm not sure that it is safe.  We should take a look because this whole code
block inside if (mode == PRIMARY) is on bleeding_edge.

http://codereview.chromium.org/553149/diff/2001/2010
File src/fast-codegen.cc (right):

http://codereview.chromium.org/553149/diff/2001/2010#newcode362
src/fast-codegen.cc:362: full_cgen.Generate(fun, FullCodeGenerator::SECONDARY);
On 2010/02/01 10:04:59, fschneider wrote:
> Should we also pass the CompilationInfo to the full code generator to
propagate
> loop nesting information, etc.?

If we need it, we will pass it.  Right now it would be unused.

http://codereview.chromium.org/553149/diff/2001/2010#newcode368
src/fast-codegen.cc:368: Code::Flags flags = Code::ComputeFlags(Code::FUNCTION,
NOT_IN_LOOP);
On 2010/02/01 10:04:59, fschneider wrote:
> (info->loop_nesting() == 0 ? NOT_IN_LOOP : IN_LOOP) instead?

I'm not sure that's right.  I don't know if we use the IN_LOOP flag for code
objects other than CallICs.  This function is just building the code of a
regular JS Function.

I'll take a look.

http://codereview.chromium.org/553149/diff/2001/2010#newcode537
src/fast-codegen.cc:537: expr->num(), expr->num(), *name_string,
expr->value()->num());
On 2010/02/01 10:04:59, fschneider wrote:
> As a separate change: It would be nice to emit these as codegen comments, too.

As we discussed, that's the intent (probably GC the --print-ir flag too, because
it will be reduntant).

I want a Comment constructor that takes a printf style format string and
varargs.  Until we have that, it's too annoying to use our abstracted sprintf at
every comment site.

http://codereview.chromium.org/553149/diff/2001/2013
File src/full-codegen.h (right):

http://codereview.chromium.org/553149/diff/2001/2013#newcode66
src/full-codegen.h:66: enum Mode {
On 2010/02/01 09:29:02, Kasper Lund wrote:
> So you're falling back to the full code generator (SECONDARY), not to the
> old-school optimizing one?

Yes initially, for simplicity.

The full codegen was built with this use case in mind---it can take an assembler
as input and generate code into the same buffer.  The plumbing on the classic
code generator needs to be rerouted to make that work.

Powered by Google App Engine
This is Rietveld 408576698