Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: src/builtins/builtins-promise.cc

Issue 2705163005: [csa] Add Unreachable() and use it after throw sites (Closed)
Patch Set: Rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins-generator.cc ('k') | src/builtins/builtins-regexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-promise.cc
diff --git a/src/builtins/builtins-promise.cc b/src/builtins/builtins-promise.cc
index aac79f1e3fe8f9c31261609e6e0ad866f05c1306..11229a905061bb28148e4fa52148a0a8514ee37d 100644
--- a/src/builtins/builtins-promise.cc
+++ b/src/builtins/builtins-promise.cc
@@ -178,8 +178,7 @@ Node* PromiseBuiltinsAssembler::NewPromiseCapability(Node* context,
StoreObjectField(capability, JSPromiseCapability::kRejectOffset,
UndefinedConstant());
CallRuntime(Runtime::kThrowTypeError, context, message);
- var_result.Bind(UndefinedConstant());
- Goto(&out);
+ Unreachable();
}
Bind(&out);
@@ -251,8 +250,7 @@ Node* PromiseBuiltinsAssembler::ThrowIfNotJSReceiver(
isolate()->factory()->NewStringFromAsciiChecked(method_name));
Node* const message_id = SmiConstant(msg_template);
CallRuntime(Runtime::kThrowTypeError, context, message_id, method);
- var_value_map.Bind(UndefinedConstant());
- Goto(&out); // Never reached.
+ Unreachable();
}
Bind(&out);
@@ -325,7 +323,7 @@ Node* PromiseBuiltinsAssembler::SpeciesConstructor(Node* context, Node* object,
Node* const message_id =
SmiConstant(MessageTemplate::kSpeciesNotConstructor);
CallRuntime(Runtime::kThrowTypeError, context, message_id);
- Goto(&out);
+ Unreachable();
}
Bind(&out);
@@ -1115,7 +1113,7 @@ TF_BUILTIN(PromiseConstructor, PromiseBuiltinsAssembler) {
{
Node* const message_id = SmiConstant(MessageTemplate::kNotAPromise);
CallRuntime(Runtime::kThrowTypeError, context, message_id, new_target);
- Return(UndefinedConstant()); // Never reached.
+ Unreachable();
}
// 2. If IsCallable(executor) is false, throw a TypeError exception.
@@ -1124,7 +1122,7 @@ TF_BUILTIN(PromiseConstructor, PromiseBuiltinsAssembler) {
Node* const message_id =
SmiConstant(MessageTemplate::kResolverNotAFunction);
CallRuntime(Runtime::kThrowTypeError, context, message_id, executor);
- Return(UndefinedConstant()); // Never reached.
+ Unreachable();
}
// Silently fail if the stack looks fishy.
@@ -1495,7 +1493,8 @@ TF_BUILTIN(PromiseGetCapabilitiesExecutor, PromiseBuiltinsAssembler) {
Bind(&if_alreadyinvoked);
Node* message = SmiConstant(MessageTemplate::kPromiseExecutorAlreadyInvoked);
- Return(CallRuntime(Runtime::kThrowTypeError, context, message));
+ CallRuntime(Runtime::kThrowTypeError, context, message);
+ Unreachable();
}
TF_BUILTIN(NewPromiseCapability, PromiseBuiltinsAssembler) {
@@ -1652,7 +1651,7 @@ TF_BUILTIN(PromiseThrowerFinally, PromiseBuiltinsAssembler) {
Node* const reason = LoadContextElement(context, kOnFinallySlot);
CallRuntime(Runtime::kThrow, context, reason);
- Return(UndefinedConstant());
+ Unreachable();
}
Node* PromiseBuiltinsAssembler::CreateThrowerFunctionContext(
« no previous file with comments | « src/builtins/builtins-generator.cc ('k') | src/builtins/builtins-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698