|
|
Description[ast] Annotate Runtime ast nodes
Changes output from
CALL RUNTIME (context function) code = 0x3e9ea90a2049 at -1
to
CALL RUNTIME async_function_promise_create code = 0x3e9ea90a2049 at -1
This makes the ast more useful. I didn't annotate all the runtime calls,
only some for now. We can annotate others if necessary.
Review-Url: https://codereview.chromium.org/2654113002
Cr-Commit-Position: refs/heads/master@{#42671}
Committed: https://chromium.googlesource.com/v8/v8/+/c6f925d7ed002e4bbd57a674cf90627384c81964
Patch Set 1 #Patch Set 2 : annotate one more #Patch Set 3 : fix #
Total comments: 6
Patch Set 4 : move to ast.cc #
Total comments: 1
Messages
Total messages: 39 (25 generated)
The CQ bit was checked by gsathya@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== [ast] Annotate Runtime ast nodes Changes output from CALL RUNTIME (context function) code = 0x3e9ea90a2049 at -1 to CALL RUNTIME (context function) name = AsyncFunctionPromiseCreate code = 0x3e9ea90a2049 at -1 This makes the ast more useful ========== to ========== [ast] Annotate Runtime ast nodes Changes output from CALL RUNTIME (context function) code = 0x3e9ea90a2049 at -1 to CALL RUNTIME (context function) name = AsyncFunctionPromiseCreate code = 0x3e9ea90a2049 at -1 This makes the ast more useful. I didn't annotate all the runtime calls, only some for now. We can annotate others if necessary. ==========
gsathya@chromium.org changed reviewers: + adamk@chromium.org, neis@chromium.org
Description was changed from ========== [ast] Annotate Runtime ast nodes Changes output from CALL RUNTIME (context function) code = 0x3e9ea90a2049 at -1 to CALL RUNTIME (context function) name = AsyncFunctionPromiseCreate code = 0x3e9ea90a2049 at -1 This makes the ast more useful. I didn't annotate all the runtime calls, only some for now. We can annotate others if necessary. ========== to ========== [ast] Annotate Runtime ast nodes Changes output from CALL RUNTIME (context function) code = 0x3e9ea90a2049 at -1 to CALL RUNTIME (context function) name = AsyncFunctionPromiseCreate code = 0x3e9ea90a2049 at -1 This makes the ast more useful. I didn't annotate all the runtime calls, only some for now. We can annotate others if necessary. ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by gsathya@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
I like the idea, but I don't think we should spend any AST memory on this. Caitlin did something almost exactly like this in https://codereview.chromium.org/2593823002 for the bytecode golden files. Could you move the NameForNativeContextIntrinsicIndex() from that CL to somewhere commonly accessible, and update CallRuntime::debug_name() to use it?
Patchset #3 (id:40001) has been deleted
The CQ bit was checked by gsathya@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== [ast] Annotate Runtime ast nodes Changes output from CALL RUNTIME (context function) code = 0x3e9ea90a2049 at -1 to CALL RUNTIME (context function) name = AsyncFunctionPromiseCreate code = 0x3e9ea90a2049 at -1 This makes the ast more useful. I didn't annotate all the runtime calls, only some for now. We can annotate others if necessary. ========== to ========== [ast] Annotate Runtime ast nodes Changes output from CALL RUNTIME (context function) code = 0x3e9ea90a2049 at -1 to CALL RUNTIME async_function_promise_create code = 0x3e9ea90a2049 at -1 This makes the ast more useful. I didn't annotate all the runtime calls, only some for now. We can annotate others if necessary. ==========
On 2017/01/25 19:23:54, adamk wrote: > I like the idea, but I don't think we should spend any AST memory on this. > Caitlin did something almost exactly like this in > https://codereview.chromium.org/2593823002 for the bytecode golden files. Could > you move the NameForNativeContextIntrinsicIndex() from that CL to somewhere > commonly accessible, and update CallRuntime::debug_name() to use it? I just copied NameForNativeContextIntrinsicIndex over to ast.h because 1) build the switch statement only for debug build (--print-ast is debug only) 2) the test version used only a subset of the context fields
https://codereview.chromium.org/2654113002/diff/50001/src/ast/ast.h File src/ast/ast.h (right): https://codereview.chromium.org/2654113002/diff/50001/src/ast/ast.h#newcode115 src/ast/ast.h:115: static const char* NameForNativeContextIntrinsicIndex(uint32_t idx) { Rather than copying this, what about exposing it in contexts.h? If we go that route, I'd also suggest moving the implementation of CallRuntime::debug_name into ast.cc.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2654113002/diff/50001/src/ast/ast.h File src/ast/ast.h (right): https://codereview.chromium.org/2654113002/diff/50001/src/ast/ast.h#newcode115 src/ast/ast.h:115: static const char* NameForNativeContextIntrinsicIndex(uint32_t idx) { On 2017/01/25 20:26:43, adamk wrote: > Rather than copying this, what about exposing it in contexts.h? If we go that > route, I'd also suggest moving the implementation of CallRuntime::debug_name > into ast.cc. Why is moving to contexts.h better?
https://codereview.chromium.org/2654113002/diff/50001/src/ast/ast.h File src/ast/ast.h (right): https://codereview.chromium.org/2654113002/diff/50001/src/ast/ast.h#newcode115 src/ast/ast.h:115: static const char* NameForNativeContextIntrinsicIndex(uint32_t idx) { On 2017/01/25 21:05:19, gsathya wrote: > On 2017/01/25 20:26:43, adamk wrote: > > Rather than copying this, what about exposing it in contexts.h? If we go that > > route, I'd also suggest moving the implementation of CallRuntime::debug_name > > into ast.cc. > > Why is moving to contexts.h better? I'd rather not have two copies of this function. Maybe I misunderstood the reason for putting this here: is this not exactly the same as what's in caitp's patch?
https://codereview.chromium.org/2654113002/diff/50001/src/ast/ast.h File src/ast/ast.h (right): https://codereview.chromium.org/2654113002/diff/50001/src/ast/ast.h#newcode115 src/ast/ast.h:115: static const char* NameForNativeContextIntrinsicIndex(uint32_t idx) { On 2017/01/25 21:11:17, adamk wrote: > On 2017/01/25 21:05:19, gsathya wrote: > > On 2017/01/25 20:26:43, adamk wrote: > > > Rather than copying this, what about exposing it in contexts.h? If we go > that > > > route, I'd also suggest moving the implementation of CallRuntime::debug_name > > > into ast.cc. > > > > Why is moving to contexts.h better? > > I'd rather not have two copies of this function. Maybe I misunderstood the > reason for putting this here: is this not exactly the same as what's in caitp's > patch? It's not exactly the same. As mentioned in my previous comment, caitp's version uses only a subset of the native context fields (only the intrinsics). It's fine to merge them though. Also as mentioned in my previous comment, what about the #ifdef DEBUG? I dont see why we need this for release builds. I can't reuse this in the test if it's debug only.
https://codereview.chromium.org/2654113002/diff/50001/src/ast/ast.h File src/ast/ast.h (right): https://codereview.chromium.org/2654113002/diff/50001/src/ast/ast.h#newcode115 src/ast/ast.h:115: static const char* NameForNativeContextIntrinsicIndex(uint32_t idx) { On 2017/01/25 21:17:17, gsathya wrote: > On 2017/01/25 21:11:17, adamk wrote: > > On 2017/01/25 21:05:19, gsathya wrote: > > > On 2017/01/25 20:26:43, adamk wrote: > > > > Rather than copying this, what about exposing it in contexts.h? If we go > > that > > > > route, I'd also suggest moving the implementation of > CallRuntime::debug_name > > > > into ast.cc. > > > > > > Why is moving to contexts.h better? > > > > I'd rather not have two copies of this function. Maybe I misunderstood the > > reason for putting this here: is this not exactly the same as what's in > caitp's > > patch? > > It's not exactly the same. As mentioned in my previous comment, caitp's version > uses only a subset of the native context fields (only the intrinsics). It's fine > to merge them though. Also as mentioned in my previous comment, what about the > #ifdef DEBUG? I dont see why we need this for release builds. I can't reuse this > in the test if it's debug only. Sorry, missed the details of the macros. I'm ok with the duplication now, but I'd prefer if this code lived in ast.cc (just to keep implementation details hidden).
The CQ bit was checked by gsathya@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2654113002/diff/50001/src/ast/ast.h File src/ast/ast.h (right): https://codereview.chromium.org/2654113002/diff/50001/src/ast/ast.h#newcode115 src/ast/ast.h:115: static const char* NameForNativeContextIntrinsicIndex(uint32_t idx) { On 2017/01/25 23:13:58, adamk wrote: > On 2017/01/25 21:17:17, gsathya wrote: > > On 2017/01/25 21:11:17, adamk wrote: > > > On 2017/01/25 21:05:19, gsathya wrote: > > > > On 2017/01/25 20:26:43, adamk wrote: > > > > > Rather than copying this, what about exposing it in contexts.h? If we go > > > that > > > > > route, I'd also suggest moving the implementation of > > CallRuntime::debug_name > > > > > into ast.cc. > > > > > > > > Why is moving to contexts.h better? > > > > > > I'd rather not have two copies of this function. Maybe I misunderstood the > > > reason for putting this here: is this not exactly the same as what's in > > caitp's > > > patch? > > > > It's not exactly the same. As mentioned in my previous comment, caitp's > version > > uses only a subset of the native context fields (only the intrinsics). It's > fine > > to merge them though. Also as mentioned in my previous comment, what about the > > #ifdef DEBUG? I dont see why we need this for release builds. I can't reuse > this > > in the test if it's debug only. > > Sorry, missed the details of the macros. I'm ok with the duplication now, but > I'd prefer if this code lived in ast.cc (just to keep implementation details > hidden). Done.
lgtm
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by gsathya@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 70001, "attempt_start_ts": 1485388803893540, "parent_rev": "bc7eb04d925fa3d4b07c163f6708808177c6c843", "commit_rev": "c6f925d7ed002e4bbd57a674cf90627384c81964"}
Message was sent while issue was closed.
Description was changed from ========== [ast] Annotate Runtime ast nodes Changes output from CALL RUNTIME (context function) code = 0x3e9ea90a2049 at -1 to CALL RUNTIME async_function_promise_create code = 0x3e9ea90a2049 at -1 This makes the ast more useful. I didn't annotate all the runtime calls, only some for now. We can annotate others if necessary. ========== to ========== [ast] Annotate Runtime ast nodes Changes output from CALL RUNTIME (context function) code = 0x3e9ea90a2049 at -1 to CALL RUNTIME async_function_promise_create code = 0x3e9ea90a2049 at -1 This makes the ast more useful. I didn't annotate all the runtime calls, only some for now. We can annotate others if necessary. Review-Url: https://codereview.chromium.org/2654113002 Cr-Commit-Position: refs/heads/master@{#42671} Committed: https://chromium.googlesource.com/v8/v8/+/c6f925d7ed002e4bbd57a674cf90627384c... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:70001) as https://chromium.googlesource.com/v8/v8/+/c6f925d7ed002e4bbd57a674cf90627384c...
Message was sent while issue was closed.
Nice!
Message was sent while issue was closed.
caitp@igalia.com changed reviewers: + caitp@igalia.com
Message was sent while issue was closed.
https://codereview.chromium.org/2654113002/diff/70001/src/ast/ast.cc File src/ast/ast.cc (right): https://codereview.chromium.org/2654113002/diff/70001/src/ast/ast.cc#newcode1084 src/ast/ast.cc:1084: return NameForNativeContextIntrinsicIndex(context_index_); Hey, sorry I didn't catch this sooner. This makes intrinsics not installed on the native context print the useless "UnknownIntrinsicIndex". This needs a `is_jsruntime()` predicate like in the release build case below |