More comments.

http://codereview.chromium.org/6286043/diff/1009/src/compilation-cache.h
File src/compilation-cache.h (right):

http://codereview.chromium.org/6286043/diff/1009/src/compilation-cache.h#newcode52
src/compilation-cache.h:52: static Handle<SharedFunctionInfo>
LookupEval(Handle<String> source,
Good catch. We wouldn't want that.

http://codereview.chromium.org/6286043/diff/1009/src/compiler.h
File src/compiler.h (right):

http://codereview.chromium.org/6286043/diff/1009/src/compiler.h#newcode168
src/compiler.h:168: class IsStrict: public BitField<bool, 4, 1> {};
Move it below IsInLoop, to keep bits in order.

http://codereview.chromium.org/6286043/diff/1009/src/objects.cc
File src/objects.cc (right):

http://codereview.chromium.org/6286043/diff/1009/src/objects.cc#newcode7993
src/objects.cc:7993: bool strict = Smi::cast(pair->get(2))->value() !=
0;
Do you need to store the strictness in a separate field? Could we store
it on the SharedFunctionInfo instead?

http://codereview.chromium.org/6286043/diff/1009/src/objects.cc#newcode8011
src/objects.cc:8011: hash ^= strict ? 0x8000 : 0x800;
I don't think it matters what you do for strict-mode hash, since we are
unlikely to have the same code as both strict and non-strict. I wouldn't
mind a hash collision in that case (but xoring by 0x8000 (or anything
non-zero) in one case is fine, I don't see why you xor by something
non-zero in the other case).

http://codereview.chromium.org/6286043/diff/1009/src/objects.cc#newcode9006
src/objects.cc:9006: StringSharedKey key(src,
context->closure()->shared(), is_strict);
I'm not sure I understand the question.
You can have many JSFunctions created using the same SharedFunctionInfo.
The SharedFunctionInfo corresponds to the function literal in the
source, so it identifies the function code as well as the closure that
it has access to.
If a two functions have the same SharedFunctionInfo, they will be able
to use the same code, because they run in the same environment.

http://codereview.chromium.org/6286043/diff/1009/src/objects.h
File src/objects.h (right):

http://codereview.chromium.org/6286043/diff/1009/src/objects.h#newcode4175
src/objects.h:4175: inline void set_strict_mode(bool value);
Is the argument needed? I.e., do we ever set a function back from strict
mode to non-strict mode?

http://codereview.chromium.org/6286043/diff/1009/src/parser.cc
File src/parser.cc (right):

http://codereview.chromium.org/6286043/diff/1009/src/parser.cc#newcode755
src/parser.cc:755: }
Is it only for lazily compiled functions that the SharedFunctionInfo
holds the strict-mode, or is it all SharedFunctionInfo?

http://codereview.chromium.org/6286043/diff/1009/src/runtime.cc
File src/runtime.cc (right):

http://codereview.chromium.org/6286043/diff/1009/src/runtime.cc#newcode9816
src/runtime.cc:9816: false);
It deserves a comment that we always run the code as non-strict, even in
a strict code context.

http://codereview.chromium.org/6286043/

--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev

Reply via email to