Needs moar Handles.
Basically, in a function that does allocation, it's a Bad Idea to not use
Handles, because any of your raw Object* stored on the stack might get
relocated.
That's why I asked you add DisallowHeapAllocation to the places where you
loop
over the linked list. Another option in those callsites is just to use a
Handle
to store your pointer into the list (though that's a little slower).
https://codereview.chromium.org/236143002/diff/1/src/objects.cc
File src/objects.cc (right):
https://codereview.chromium.org/236143002/diff/1/src/objects.cc#newcode16046
src/objects.cc:16046: table->NumberOfElements() +
table->NumberOfDeletedElements();
On 2014/04/14 19:51:49, arv wrote:
On 2014/04/14 19:15:42, adamk wrote:
> I see this a lot, maybe OrderedHashTable should expose an accessor
that
returns
> the result of this expression.
Any suggestion for a name?
FilledCapacity()? UsedCapacity()?
https://codereview.chromium.org/236143002/diff/60001/src/objects.cc
File src/objects.cc (right):
https://codereview.chromium.org/236143002/diff/60001/src/objects.cc#newcode15918
src/objects.cc:15918: Object* undefined =
table->GetHeap()->undefined_value();
Please use a Handle here (available from
isolate->factory()->undefined_value()).
https://codereview.chromium.org/236143002/diff/60001/src/objects.cc#newcode15926
src/objects.cc:15926: Object* old_iterator = table->iterators();
Style-wise I'd also handl-ify this one (in case more code gets added
below that happens to cause allocations).
https://codereview.chromium.org/236143002/diff/60001/src/objects.cc#newcode16076
src/objects.cc:16076: Object* object = iterator->table();
Need to use a Handle here.
https://codereview.chromium.org/236143002/diff/60001/src/objects.cc#newcode16115
src/objects.cc:16115: OrderedHashSet* table =
OrderedHashSet::cast(iterator->table());
Needs to be a Handle too.
https://codereview.chromium.org/236143002/diff/60001/src/objects.cc#newcode16145
src/objects.cc:16145: OrderedHashMap* table =
OrderedHashMap::cast(iterator->table());
And this one too.
https://codereview.chromium.org/236143002/diff/60001/src/objects.cc#newcode16156
src/objects.cc:16156: Object* value = table->get(entry_index + 1);
These both need to be Handles.
https://codereview.chromium.org/236143002/
--
--
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.