PTAL
https://codereview.chromium.org/16154027/diff/9/src/types.cc
File src/types.cc (right):
https://codereview.chromium.org/16154027/diff/9/src/types.cc#newcode95
src/types.cc:95: default:
On 2013/06/05 08:02:41, Sven Panne wrote:
Are there really unhandled cases? If yes, how many? Default cases are
a road to
maintenance hell...
I know, unfortunately, there are several dozens of them -- as many as we
have 'internal' heap objects...
If you forget to add a new instance type you'll get an assertion failure
right away, so it's not too bad.
https://codereview.chromium.org/16154027/diff/9/src/types.cc#newcode246
src/types.cc:246: if (isolate == NULL) isolate =
HeapObject::cast(*type2)->GetIsolate();
On 2013/06/05 08:02:41, Sven Panne wrote:
The test is a nano-optimization, leaving it out makes things more
symmetrical.
Done.
https://codereview.chromium.org/16154027/diff/9/src/types.cc#newcode272
src/types.cc:272: if (type->is_bitset())
On 2013/06/05 08:02:41, Sven Panne wrote:
I would have expected a ternary ?: from you... ;-)
Right you are! :)
https://codereview.chromium.org/16154027/diff/9/src/types.h
File src/types.h (right):
https://codereview.chromium.org/16154027/diff/9/src/types.h#newcode38
src/types.h:38: class Type : public Object {
On 2013/06/05 08:02:41, Sven Panne wrote:
Although I hate comments in general, a comment describing the cunning
Type
representation might be appropriate here.
Done.
https://codereview.chromium.org/16154027/diff/9/src/types.h#newcode117
src/types.h:117: Handle<HeapObject> as_constant() { return
Handle<HeapObject>::cast(handle());}
On 2013/06/05 08:02:41, Sven Panne wrote:
Cheater! ;-)
No more, wanted to add an assertion anyway. :)
https://codereview.chromium.org/16154027/diff/9/src/types.h#newcode122
src/types.h:122: ASSERT(type->IsHeapObject());
On 2013/06/05 08:02:41, Sven Panne wrote:
No need for this ASSERT, HeapObject::cast already does the same.
Yeah, but I wanted to make it very explicit.
https://codereview.chromium.org/16154027/
--
--
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/groups/opt_out.