Commit 990b0d4c authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[CSA] Add CSA_ASSERT to test for the empty context

Change-Id: Iae85e97cd59f3270959e506f43dae22e6a331217
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2078580Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66625}
parent d56275e3
......@@ -6935,6 +6935,7 @@ TNode<Numeric> CodeStubAssembler::NonNumberToNumberOrNumeric(
}
BIND(&if_inputisbigint);
CSA_ASSERT(this, Word32And(TaggedIsNotSmi(context), IsContext(context)));
if (mode == Object::Conversion::kToNumeric) {
var_result = CAST(input);
Goto(&end);
......@@ -6959,6 +6960,7 @@ TNode<Numeric> CodeStubAssembler::NonNumberToNumberOrNumeric(
BIND(&if_inputisreceiver);
{
CSA_ASSERT(this, Word32And(TaggedIsNotSmi(context), IsContext(context)));
// The {input} is a JSReceiver, we need to convert it to a Primitive first
// using the ToPrimitive type conversion, preferably yielding a Number.
Callable callable = CodeFactory::NonPrimitiveToPrimitive(
......@@ -6989,6 +6991,7 @@ TNode<Numeric> CodeStubAssembler::NonNumberToNumberOrNumeric(
BIND(&if_inputisother);
{
CSA_ASSERT(this, Word32And(TaggedIsNotSmi(context), IsContext(context)));
// The {input} is something else (e.g. Symbol), let the runtime figure
// out the correct exception.
// Note: We cannot tail call to the runtime here, as js-to-wasm
......
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