On 2014/10/30 10:59:46, Yang wrote:
On 2014/10/30 10:53:01, aandrey wrote:
> https://codereview.chromium.org/653023004/diff/1/src/object-observe.js
> File src/object-observe.js (right):
>
>
https://codereview.chromium.org/653023004/diff/1/src/object-observe.js#newcode574
> src/object-observe.js:574: %DebugPushPromise(null);
> But should not we patch Isolate::DoThrow() instead?
>
> Maybe we just call smth like %SetVerboseNextTryCatch() before entering
the
> try-catch block to make it alike the verbose v8::TryCatch? Message
reporting
and
> debug event will work naturally w/o any changes.
Something like %SetVerboseNextTryCatch is not easily implemented. We push
try-catch handlers in generated code onto the stack, so to implement
something
like verbosity, we would have to involve the parser and change
platform-dependent code. At this point, I also have no idea what would
happen
in
turbo fan code. So it's just a lot easier to piggyback on the existing
infrastructure for promises.
If performance becomes a problem, we could implement %DebugPushPromise and
%DebugPopPromise in generated code and change the data structure of the
promise
stack.
Also, implementing %DebugPushPromise and %DebugPopPromise in generated code
would basically be the same as supporting verbose try-catch scopes without
introducing a custom javascript syntax and having to support it in the
parser/code generator, except that it's explicit instead of implicit.
For console output and window.onerror we plan to introduce something
similar to
the PromiseRejectCallback. It's similar to it in the way that throwing in
the
deliver-loop does not stop execution. That callback would be implemented as
a
runtime function called in the catch block.
https://codereview.chromium.org/653023004/
--
--
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.