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

Issue 6312055: Pass strict mode flag to eval. (Closed)

Created:
9 years, 10 months ago by Martin Maly
Modified:
9 years, 7 months ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

Pass flag to eval Save flag across late compilation Making arguments readonly in strict mode. Pass strict mode flag to ResolvePossiblyDirectEval BUG= TEST=

Patch Set 1 #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -19 lines) Patch
M src/compiler.h View 4 chunks +9 lines, -1 line 0 comments Download
M src/compiler.cc View 3 chunks +4 lines, -1 line 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 chunk +3 lines, -1 line 1 comment Download
M src/messages.js View 1 chunk +1 line, -1 line 0 comments Download
M src/objects.h View 2 chunks +5 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 chunk +9 lines, -0 lines 2 comments Download
M src/parser.h View 2 chunks +3 lines, -1 line 0 comments Download
M src/parser.cc View 7 chunks +16 lines, -5 lines 1 comment Download
M src/runtime.h View 1 chunk +1 line, -1 line 0 comments Download
M src/runtime.cc View 7 chunks +16 lines, -8 lines 3 comments Download
M src/scopes.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/scopes.cc View 1 chunk +7 lines, -0 lines 0 comments Download
M src/variables.h View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 1 (0 generated)
Lasse Reichstein
9 years, 10 months ago (2011-02-01 11:26:24 UTC) #1
http://codereview.chromium.org/6312055/diff/1/src/ia32/full-codegen-ia32.cc
File src/ia32/full-codegen-ia32.cc (right):

http://codereview.chromium.org/6312055/diff/1/src/ia32/full-codegen-ia32.cc#n...
src/ia32/full-codegen-ia32.cc:2274: __
push(Immediate(Smi::FromInt(info_->function()->strict_mode())));
If strict_mode() returns a boolean, convert it to a number explicitly instead of
relying on implicit conversion.

http://codereview.chromium.org/6312055/diff/1/src/objects-inl.h
File src/objects-inl.h (right):

http://codereview.chromium.org/6312055/diff/1/src/objects-inl.h#newcode2973
src/objects-inl.h:2973: 
Two lines of whitespace between function definitions.

http://codereview.chromium.org/6312055/diff/1/src/objects-inl.h#newcode2980
src/objects-inl.h:2980: kStrictModeFunction,
Indentation.

http://codereview.chromium.org/6312055/diff/1/src/parser.cc
File src/parser.cc (right):

http://codereview.chromium.org/6312055/diff/1/src/parser.cc#newcode3575
src/parser.cc:3575: top_scope_->SetAttributesConst();
Attributes? Should that be "Arguments"?

http://codereview.chromium.org/6312055/diff/1/src/runtime.cc
File src/runtime.cc (right):

http://codereview.chromium.org/6312055/diff/1/src/runtime.cc#newcode7630
src/runtime.cc:7630: if (!context->IsGlobalContext()) {
This is where we miss the official semantics. The call can still be direct even
if "eval" is aliased, as long as it's aliased to a variable called "eval".

http://codereview.chromium.org/6312055/diff/1/src/runtime.cc#newcode7656
src/runtime.cc:7656: static ObjectPair
Runtime_ResolvePossiblyDirectEvalNoLookup(Arguments args) {
Why no extra argument here? It seems this function can also be called from
strict code.

http://codereview.chromium.org/6312055/diff/1/src/runtime.cc#newcode9813
src/runtime.cc:9813: false); // We need to get this from the current function
We should check whether the debugger would want that. My guess is that they
depend on the non-strict eval to be able to change local variables (but I'm not
at all sure).
They may not want debugger input to be required to be strict code - but we
should consider whether it's safe to use non-struct code in a strict context.
After all, the spec is built to prevent that.

Powered by Google App Engine
This is Rietveld 408576698