http://codereview.chromium.org/6713074/diff/1/src/assembler.h
File src/assembler.h (right):

http://codereview.chromium.org/6713074/diff/1/src/assembler.h#newcode504
src/assembler.h:504: explicit ExternalReference(Builtins::CFunctionId
id, Isolate* isolate);
On 2011/03/21 17:06:57, Vitaly Repeshko wrote:
I think these should be moved to some class that already has the
current isolate
pointer, say, to the Assembler. Otherwise, the code looks too nasty.

I sort of agree. However, looking into it more, external references are
used for serialization and deserialization where there is no assembler.
So the assembler is not the right place. I could create a
ExternalReferenceFactory and have an instance on the isolate. However,
that would not help readability much I think. It would lead to:

ExternalReferenceFactory* external_reference_factory
    = masm()->isolate()->external_reference_factory();
__ DoStuffWithReference(external_reference_factory->Create(id));

instead of

__ DoStuffWithReference(ExternalReference(id, masm()->isolate()));

And that doesn't help.

I'm open to suggestions, but I don't see a good place for this that
would make the code any more readable.

http://codereview.chromium.org/6713074/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to