Commit bd68cc82 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[parser] Name outer promise ".promise" in the desugaring.

The Parser inserts a temporary .promise variable to hold the outer
promise for async functions, but doesn't assign an actually visible
name to it. This change puts the name ".promise" on it (similar to
what we do for other special variables like .result), which makes it
easier to debug this (for V8 developers). It's not observable to
regular developers.

Bug: v8:7522, v8:8015
Change-Id: I388352ad931a49102cb5afe350314337a505a150
Reviewed-on: https://chromium-review.googlesource.com/1249106Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56276}
parent d2e0166d
...@@ -194,48 +194,49 @@ class AstBigInt { ...@@ -194,48 +194,49 @@ class AstBigInt {
}; };
// For generating constants. // For generating constants.
#define AST_STRING_CONSTANTS(F) \ #define AST_STRING_CONSTANTS(F) \
F(anonymous_function, "(anonymous function)") \ F(anonymous_function, "(anonymous function)") \
F(arguments, "arguments") \ F(arguments, "arguments") \
F(async, "async") \ F(async, "async") \
F(await, "await") \ F(await, "await") \
F(bigint, "bigint") \ F(bigint, "bigint") \
F(boolean, "boolean") \ F(boolean, "boolean") \
F(constructor, "constructor") \ F(constructor, "constructor") \
F(default, "default") \ F(default, "default") \
F(done, "done") \ F(done, "done") \
F(dot, ".") \ F(dot, ".") \
F(dot_for, ".for") \ F(dot_for, ".for") \
F(dot_generator_object, ".generator_object") \ F(dot_generator_object, ".generator_object") \
F(dot_iterator, ".iterator") \ F(dot_iterator, ".iterator") \
F(dot_result, ".result") \ F(dot_promise, ".promise") \
F(dot_switch_tag, ".switch_tag") \ F(dot_result, ".result") \
F(dot_catch, ".catch") \ F(dot_switch_tag, ".switch_tag") \
F(empty, "") \ F(dot_catch, ".catch") \
F(eval, "eval") \ F(empty, "") \
F(function, "function") \ F(eval, "eval") \
F(get_space, "get ") \ F(function, "function") \
F(length, "length") \ F(get_space, "get ") \
F(let, "let") \ F(length, "length") \
F(name, "name") \ F(let, "let") \
F(native, "native") \ F(name, "name") \
F(new_target, ".new.target") \ F(native, "native") \
F(next, "next") \ F(new_target, ".new.target") \
F(number, "number") \ F(next, "next") \
F(object, "object") \ F(number, "number") \
F(proto, "__proto__") \ F(object, "object") \
F(prototype, "prototype") \ F(proto, "__proto__") \
F(return, "return") \ F(prototype, "prototype") \
F(set_space, "set ") \ F(return, "return") \
F(star_default_star, "*default*") \ F(set_space, "set ") \
F(string, "string") \ F(star_default_star, "*default*") \
F(symbol, "symbol") \ F(string, "string") \
F(this, "this") \ F(symbol, "symbol") \
F(this_function, ".this_function") \ F(this, "this") \
F(throw, "throw") \ F(this_function, ".this_function") \
F(undefined, "undefined") \ F(throw, "throw") \
F(use_asm, "use asm") \ F(undefined, "undefined") \
F(use_strict, "use strict") \ F(use_asm, "use asm") \
F(use_strict, "use strict") \
F(value, "value") F(value, "value")
class AstStringConstants final { class AstStringConstants final {
......
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
V(_, dot_for_string, ".for") \ V(_, dot_for_string, ".for") \
V(_, dot_generator_object_string, ".generator_object") \ V(_, dot_generator_object_string, ".generator_object") \
V(_, dot_iterator_string, ".iterator") \ V(_, dot_iterator_string, ".iterator") \
V(_, dot_promise_string, ".promise") \
V(_, dot_result_string, ".result") \ V(_, dot_result_string, ".result") \
V(_, dot_string, ".") \ V(_, dot_string, ".") \
V(_, dot_switch_tag_string, ".switch_tag") \ V(_, dot_switch_tag_string, ".switch_tag") \
......
...@@ -2955,7 +2955,7 @@ Variable* Parser::PromiseVariable() { ...@@ -2955,7 +2955,7 @@ Variable* Parser::PromiseVariable() {
Variable* promise = function_state_->scope()->promise_var(); Variable* promise = function_state_->scope()->promise_var();
if (promise == nullptr) { if (promise == nullptr) {
promise = function_state_->scope()->DeclarePromiseVar( promise = function_state_->scope()->DeclarePromiseVar(
ast_value_factory()->empty_string()); ast_value_factory()->dot_promise_string());
} }
return promise; return promise;
} }
......
...@@ -288,41 +288,41 @@ KNOWN_MAPS = { ...@@ -288,41 +288,41 @@ KNOWN_MAPS = {
("RO_SPACE", 0x04711): (171, "Tuple2Map"), ("RO_SPACE", 0x04711): (171, "Tuple2Map"),
("RO_SPACE", 0x047b1): (173, "ArrayBoilerplateDescriptionMap"), ("RO_SPACE", 0x047b1): (173, "ArrayBoilerplateDescriptionMap"),
("RO_SPACE", 0x04aa1): (161, "InterceptorInfoMap"), ("RO_SPACE", 0x04aa1): (161, "InterceptorInfoMap"),
("RO_SPACE", 0x06d11): (153, "AccessCheckInfoMap"), ("RO_SPACE", 0x06d29): (153, "AccessCheckInfoMap"),
("RO_SPACE", 0x06d61): (154, "AccessorInfoMap"), ("RO_SPACE", 0x06d79): (154, "AccessorInfoMap"),
("RO_SPACE", 0x06db1): (155, "AccessorPairMap"), ("RO_SPACE", 0x06dc9): (155, "AccessorPairMap"),
("RO_SPACE", 0x06e01): (156, "AliasedArgumentsEntryMap"), ("RO_SPACE", 0x06e19): (156, "AliasedArgumentsEntryMap"),
("RO_SPACE", 0x06e51): (157, "AllocationMementoMap"), ("RO_SPACE", 0x06e69): (157, "AllocationMementoMap"),
("RO_SPACE", 0x06ea1): (158, "AsyncGeneratorRequestMap"), ("RO_SPACE", 0x06eb9): (158, "AsyncGeneratorRequestMap"),
("RO_SPACE", 0x06ef1): (159, "DebugInfoMap"), ("RO_SPACE", 0x06f09): (159, "DebugInfoMap"),
("RO_SPACE", 0x06f41): (160, "FunctionTemplateInfoMap"), ("RO_SPACE", 0x06f59): (160, "FunctionTemplateInfoMap"),
("RO_SPACE", 0x06f91): (162, "InterpreterDataMap"), ("RO_SPACE", 0x06fa9): (162, "InterpreterDataMap"),
("RO_SPACE", 0x06fe1): (163, "ModuleInfoEntryMap"), ("RO_SPACE", 0x06ff9): (163, "ModuleInfoEntryMap"),
("RO_SPACE", 0x07031): (164, "ModuleMap"), ("RO_SPACE", 0x07049): (164, "ModuleMap"),
("RO_SPACE", 0x07081): (165, "ObjectTemplateInfoMap"), ("RO_SPACE", 0x07099): (165, "ObjectTemplateInfoMap"),
("RO_SPACE", 0x070d1): (166, "PromiseCapabilityMap"), ("RO_SPACE", 0x070e9): (166, "PromiseCapabilityMap"),
("RO_SPACE", 0x07121): (167, "PromiseReactionMap"), ("RO_SPACE", 0x07139): (167, "PromiseReactionMap"),
("RO_SPACE", 0x07171): (168, "PrototypeInfoMap"), ("RO_SPACE", 0x07189): (168, "PrototypeInfoMap"),
("RO_SPACE", 0x071c1): (169, "ScriptMap"), ("RO_SPACE", 0x071d9): (169, "ScriptMap"),
("RO_SPACE", 0x07211): (170, "StackFrameInfoMap"), ("RO_SPACE", 0x07229): (170, "StackFrameInfoMap"),
("RO_SPACE", 0x07261): (172, "Tuple3Map"), ("RO_SPACE", 0x07279): (172, "Tuple3Map"),
("RO_SPACE", 0x072b1): (174, "WasmDebugInfoMap"), ("RO_SPACE", 0x072c9): (174, "WasmDebugInfoMap"),
("RO_SPACE", 0x07301): (175, "WasmExportedFunctionDataMap"), ("RO_SPACE", 0x07319): (175, "WasmExportedFunctionDataMap"),
("RO_SPACE", 0x07351): (176, "CallableTaskMap"), ("RO_SPACE", 0x07369): (176, "CallableTaskMap"),
("RO_SPACE", 0x073a1): (177, "CallbackTaskMap"), ("RO_SPACE", 0x073b9): (177, "CallbackTaskMap"),
("RO_SPACE", 0x073f1): (178, "PromiseFulfillReactionJobTaskMap"), ("RO_SPACE", 0x07409): (178, "PromiseFulfillReactionJobTaskMap"),
("RO_SPACE", 0x07441): (179, "PromiseRejectReactionJobTaskMap"), ("RO_SPACE", 0x07459): (179, "PromiseRejectReactionJobTaskMap"),
("RO_SPACE", 0x07491): (180, "PromiseResolveThenableJobTaskMap"), ("RO_SPACE", 0x074a9): (180, "PromiseResolveThenableJobTaskMap"),
("RO_SPACE", 0x074e1): (181, "MicrotaskQueueMap"), ("RO_SPACE", 0x074f9): (181, "MicrotaskQueueMap"),
("RO_SPACE", 0x07531): (182, "AllocationSiteWithWeakNextMap"), ("RO_SPACE", 0x07549): (182, "AllocationSiteWithWeakNextMap"),
("RO_SPACE", 0x07581): (182, "AllocationSiteWithoutWeakNextMap"), ("RO_SPACE", 0x07599): (182, "AllocationSiteWithoutWeakNextMap"),
("RO_SPACE", 0x075d1): (213, "LoadHandler1Map"), ("RO_SPACE", 0x075e9): (213, "LoadHandler1Map"),
("RO_SPACE", 0x07621): (213, "LoadHandler2Map"), ("RO_SPACE", 0x07639): (213, "LoadHandler2Map"),
("RO_SPACE", 0x07671): (213, "LoadHandler3Map"), ("RO_SPACE", 0x07689): (213, "LoadHandler3Map"),
("RO_SPACE", 0x076c1): (220, "StoreHandler0Map"), ("RO_SPACE", 0x076d9): (220, "StoreHandler0Map"),
("RO_SPACE", 0x07711): (220, "StoreHandler1Map"), ("RO_SPACE", 0x07729): (220, "StoreHandler1Map"),
("RO_SPACE", 0x07761): (220, "StoreHandler2Map"), ("RO_SPACE", 0x07779): (220, "StoreHandler2Map"),
("RO_SPACE", 0x077b1): (220, "StoreHandler3Map"), ("RO_SPACE", 0x077c9): (220, "StoreHandler3Map"),
("MAP_SPACE", 0x02201): (1057, "ExternalMap"), ("MAP_SPACE", 0x02201): (1057, "ExternalMap"),
("MAP_SPACE", 0x02251): (1072, "JSMessageObjectMap"), ("MAP_SPACE", 0x02251): (1072, "JSMessageObjectMap"),
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment