[builtins] Allow API callbacks to return BigInts

This fixes the debug code which checks that API callbacks
return only valid JS values: BigInt was missing from the list
of allowable types.

Bug: chromium:985115
Change-Id: I8b3db409bd99e9e9b936d520d0fdbe75654e7602
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1706623
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62812}
This commit is contained in:
Adam Klein 2019-07-17 15:30:32 -07:00 committed by Commit Bot
parent 6e0473f343
commit 337891833b
2 changed files with 6 additions and 0 deletions

View File

@ -3093,6 +3093,9 @@ void CallApiFunctionAndReturn(MacroAssembler* masm, Register function_address,
__ CompareRoot(map, RootIndex::kHeapNumberMap);
__ j(equal, &ok, Label::kNear);
__ CompareRoot(map, RootIndex::kBigIntMap);
__ j(equal, &ok, Label::kNear);
__ CompareRoot(return_value, RootIndex::kUndefinedValue);
__ j(equal, &ok, Label::kNear);

View File

@ -3076,6 +3076,9 @@ void CallApiFunctionAndReturn(MacroAssembler* masm, Register function_address,
__ CompareRoot(map, RootIndex::kHeapNumberMap);
__ j(equal, &ok, Label::kNear);
__ CompareRoot(map, RootIndex::kBigIntMap);
__ j(equal, &ok, Label::kNear);
__ CompareRoot(return_value, RootIndex::kUndefinedValue);
__ j(equal, &ok, Label::kNear);