Object::GetPrototype does not allocate, so it cannot cause a GC. I'm fine
with
using the handlified wrapper of Object::GetPrototype inside already
handlified
functions.
But using it inside functions that use raw object pointers is misleading and
potentially dangerous: it appears to make the call to Object::GetProperty
GC-safe, but the surrounding code (including the callers of those functions)
that are not handlified are not GC-safe at all. Imagine we would at some
point
require Object::GetPrototype to actually allocate, then this would cause all
those unsafe parts to fail.
https://codereview.chromium.org/238973003/diff/20001/src/builtins.cc
File src/builtins.cc (right):
https://codereview.chromium.org/238973003/diff/20001/src/builtins.cc#newcode1114
src/builtins.cc:1114: Handle<FunctionTemplateInfo> type) {
It seems like we don't need to handlify this and its callers.
https://codereview.chromium.org/238973003/diff/20001/src/ic-inl.h
File src/ic-inl.h (right):
https://codereview.chromium.org/238973003/diff/20001/src/ic-inl.h#newcode162
src/ic-inl.h:162: InlineCacheHolderFlag holder) {
No need to handlify.
https://codereview.chromium.org/238973003/diff/20001/src/ic.cc
File src/ic.cc (right):
https://codereview.chromium.org/238973003/diff/20001/src/ic.cc#newcode265
src/ic.cc:265: if (Object::GetPrototype(isolate(), receiver)->IsNull())
return false;
No need to handlify this.
https://codereview.chromium.org/238973003/diff/20001/src/isolate.cc
File src/isolate.cc (right):
https://codereview.chromium.org/238973003/diff/20001/src/isolate.cc#newcode1037
src/isolate.cc:1037: prototype = Object::GetPrototype(this, prototype))
{
The DisallowHeapAllocation scope should already make sure that this is
safe without being handlified.
https://codereview.chromium.org/238973003/diff/20001/src/objects.cc
File src/objects.cc (right):
https://codereview.chromium.org/238973003/diff/20001/src/objects.cc#newcode3437
src/objects.cc:3437: for (Handle<Object> pt = handle(GetPrototype(),
isolate);
No need to handlify. Especially since none of the callers of this method
is handlified either.
https://codereview.chromium.org/238973003/diff/20001/src/objects.cc#newcode6433
src/objects.cc:6433: DisallowHeapAllocation no_alloc;
No need to handlify.
https://codereview.chromium.org/238973003/diff/20001/src/objects.cc#newcode11999
src/objects.cc:11999: if (JSReceiver::cast(*pt) == *object) {
you could use
if (pt.is_identical_to(object)) { ... }
https://codereview.chromium.org/238973003/diff/20001/src/runtime.cc
File src/runtime.cc (right):
https://codereview.chromium.org/238973003/diff/20001/src/runtime.cc#newcode12829
src/runtime.cc:12829: result = handle(JSObject::cast(*proto));
Use Handle<JSObject>::cast here. That will not create a new handle on
the handle stack.
https://codereview.chromium.org/238973003/diff/20001/src/runtime.cc#newcode13011
src/runtime.cc:13011: *Object::GetPrototype(isolate, handle(V,
isolate));
This function is not handlified. Please don't do it in part.
https://codereview.chromium.org/238973003/diff/20001/src/string-stream.cc
File src/string-stream.cc (right):
https://codereview.chromium.org/238973003/diff/20001/src/string-stream.cc#newcode513
src/string-stream.cc:513: p = Object::GetPrototype(isolate, p)) {
Please don't handlify here.
https://codereview.chromium.org/238973003/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.