Addressed feedback, waiting to land this until our bleeding_edge is open for
non-bug-fixes again...
https://codereview.chromium.org/11190050/diff/14009/include/v8.h
File include/v8.h (right):
https://codereview.chromium.org/11190050/diff/14009/include/v8.h#newc...
include/v8.h:1632: * a field, you must use
GetAlignedPointerFromInternalField, everything else
On 2012/10/25 09:41:53, Michael Starzinger wrote:
> Can we rephrase the comment so that it doesn't use personal pronouns.
E.g. "Such
> a field must be retrieved via GetAlignedPointerFromInternalField,
everything
> else [...]"
Done here and at similar places.
https://codereview.chromium.org/11190050/diff/14009/src/api.cc
File src/api.cc (right):
https://codereview.chromium.org/11190050/diff/14009/src/api.cc#newcod...
src/api.cc:827: data->set(index, *Utils::OpenHandle(*value));
On 2012/10/25 09:41:53, Michael Starzinger wrote:
> Even though this pattern is safe, GCMole might report it as a false
positive.
Done.
https://codereview.chromium.org/11190050/diff/14009/src/api.cc#newcod...
src/api.cc:4239: static bool ObjectFieldOK(i::Handle<i::JSObject> obj,
On 2012/10/25 09:41:53, Michael Starzinger wrote:
> Can we call this InternalFieldOK?
Done.
https://codereview.chromium.org/11190050/diff/14009/src/api.cc#newcod...
src/api.cc:4262: obj->SetInternalField(index,
*Utils::OpenHandle(*value));
On 2012/10/25 09:41:53, Michael Starzinger wrote:
> Even though this pattern is safe, GCMole might report it as a false
positive.
Done.
https://codereview.chromium.org/11190050/diff/14009/src/api.cc#newcod...
src/api.cc:4742: // TODO(svenpanne) This should somehow be
Utils::ToLocal.
On 2012/10/25 09:41:53, Michael Starzinger wrote:
> You can get a ToLocal by calling it ExternalToLocal and adding the
following
> line to api.h, I would prefer that:
> MAKE_TO_LOCAL(ExternalToLocal, JSObject, External)
Ooops, forgot that TODO. Good point, one can even remove the old
incorrect conversion From Foreign to External.
https://codereview.chromium.org/11190050/diff/14009/src/bootstrapper.cc
File src/bootstrapper.cc (right):
https://codereview.chromium.org/11190050/diff/14009/src/bootstrapper....
src/bootstrapper.cc:1244:
native_context()->set_embedder_data(*factory->NewFixedArray(2));
On 2012/10/25 09:41:53, Michael Starzinger wrote:
> This pattern is not GC-safe and GCMole will (hopefully) complain about
it. First
> allocate the array, and then take the native_context dereference.
> Handle<FixedArray> embedder_data = factory->NewFixedArray(2);
> native_context()->set_embedder_data(embedder_data);
Done.
https://codereview.chromium.org/11190050/diff/14009/src/compiler.cc
File src/compiler.cc (right):
https://codereview.chromium.org/11190050/diff/14009/src/compiler.cc#n...
src/compiler.cc:436: FixedArray* array =
(*isolate->native_context())->embedder_data();
On 2012/10/25 09:41:53, Michael Starzinger wrote:
> This can just be "isolate->native_context()->embedder_data()" without
the
> explicit dereference.
Done. Excessive overloading FTW! :-P
https://codereview.chromium.org/11190050/diff/14009/src/objects.h
File src/objects.h (right):
https://codereview.chromium.org/11190050/diff/14009/src/objects.h#new...
src/objects.h:2414: STATIC_CHECK(kHeaderSize ==
Internals::kFixedArrayHeaderSize);
On 2012/10/25 09:41:53, Michael Starzinger wrote:
> Can we move this to FixedArrayBase, right after the constant is
actually
> defined? Closer is better.
I put the check here intentionally, and I think it is actually a better
place than the one in FixedArrayBase: The user of kFixedArrayHeaderSize
only cares about the fact that the object in question is a FixedArray
and not about the implementation hierarchy. I really want to assert that
FixedArray::kHeaderSize is equal to kFixedArrayHeaderSize, so it belongs
here.
https://codereview.chromium.org/11190050/diff/14009/test/cctest/test-...
File test/cctest/test-api.cc (right):
https://codereview.chromium.org/11190050/diff/14009/test/cctest/test-...
test/cctest/test-api.cc:2060:
On 2012/10/25 09:41:53, Michael Starzinger wrote:
> Add second empty newline for readability.
Done.
https://codereview.chromium.org/11190050/