From e34c42db278c3431d31445af72bf5c35ffee67eb Mon Sep 17 00:00:00 2001 From: Tobias Tebbi Date: Wed, 20 Nov 2019 13:49:28 +0100 Subject: [PATCH] [torque] type context of JS builtins as NativeContext That's possible because JS builtins are JSFunctions that embed a NativeContext. Bug: v8:7793 Change-Id: Id2bf7844fcfb53df733100f1e3e554f25a78482a Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1926150 Reviewed-by: Michael Stanton Commit-Queue: Tobias Tebbi Cr-Commit-Position: refs/heads/master@{#65068} --- src/builtins/array-copywithin.tq | 3 +- src/builtins/array-every.tq | 6 +- src/builtins/array-filter.tq | 8 +-- src/builtins/array-find.tq | 8 +-- src/builtins/array-findindex.tq | 8 +-- src/builtins/array-foreach.tq | 8 +-- src/builtins/array-isarray.tq | 4 +- src/builtins/array-join.tq | 14 ++-- src/builtins/array-lastindexof.tq | 3 +- src/builtins/array-map.tq | 7 +- src/builtins/array-of.tq | 3 +- src/builtins/array-reduce-right.tq | 10 +-- src/builtins/array-reduce.tq | 10 +-- src/builtins/array-reverse.tq | 3 +- src/builtins/array-shift.tq | 3 +- src/builtins/array-slice.tq | 4 +- src/builtins/array-some.tq | 6 +- src/builtins/array-splice.tq | 2 +- src/builtins/array-unshift.tq | 3 +- src/builtins/base.tq | 4 +- src/builtins/boolean.tq | 6 +- src/builtins/builtins-string.tq | 20 +++--- src/builtins/console.tq | 2 +- src/builtins/data-view.tq | 68 ++++++++++++------ src/builtins/math.tq | 80 ++++++++++----------- src/builtins/number.tq | 3 +- src/builtins/object-fromentries.tq | 2 +- src/builtins/object.tq | 10 +-- src/builtins/promise-abstract-operations.tq | 8 ++- src/builtins/proxy-constructor.tq | 2 +- src/builtins/proxy-revocable.tq | 4 +- src/builtins/proxy-revoke.tq | 2 +- src/builtins/reflect.tq | 18 +++-- src/builtins/regexp-exec.tq | 3 +- src/builtins/regexp-match-all.tq | 8 +-- src/builtins/regexp-match.tq | 3 +- src/builtins/regexp-replace.tq | 3 +- src/builtins/regexp-search.tq | 3 +- src/builtins/regexp-source.tq | 2 +- src/builtins/regexp-split.tq | 3 +- src/builtins/regexp-test.tq | 3 +- src/builtins/regexp.tq | 14 ++-- src/builtins/string-endswith.tq | 3 +- src/builtins/string-html.tq | 27 +++---- src/builtins/string-iterator.tq | 4 +- src/builtins/string-pad.tq | 4 +- src/builtins/string-repeat.tq | 3 +- src/builtins/string-replaceall.tq | 2 +- src/builtins/string-slice.tq | 3 +- src/builtins/string-startswith.tq | 3 +- src/builtins/string-substr.tq | 3 +- src/builtins/string-substring.tq | 3 +- src/builtins/symbol.tq | 9 +-- src/builtins/typed-array-every.tq | 2 +- src/builtins/typed-array-filter.tq | 3 +- src/builtins/typed-array-find.tq | 2 +- src/builtins/typed-array-findindex.tq | 5 +- src/builtins/typed-array-foreach.tq | 5 +- src/builtins/typed-array-from.tq | 4 +- src/builtins/typed-array-of.tq | 4 +- src/builtins/typed-array-reduce.tq | 5 +- src/builtins/typed-array-reduceright.tq | 5 +- src/builtins/typed-array-set.tq | 2 +- src/builtins/typed-array-slice.tq | 3 +- src/builtins/typed-array-some.tq | 2 +- src/builtins/typed-array-sort.tq | 2 +- src/builtins/typed-array-subarray.tq | 2 +- src/torque/constants.h | 1 + src/torque/implementation-visitor.cc | 6 +- src/torque/type-oracle.h | 4 ++ third_party/v8/builtins/array-sort.tq | 2 +- 71 files changed, 289 insertions(+), 218 deletions(-) diff --git a/src/builtins/array-copywithin.tq b/src/builtins/array-copywithin.tq index 12241cc252..d6ca6a3e74 100644 --- a/src/builtins/array-copywithin.tq +++ b/src/builtins/array-copywithin.tq @@ -9,7 +9,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.copyWithin transitioning javascript builtin ArrayPrototypeCopyWithin( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { // 1. Let O be ? ToObject(this value). const object: JSReceiver = ToObject_Inline(context, receiver); diff --git a/src/builtins/array-every.tq b/src/builtins/array-every.tq index 8f4c0e1f23..ef7c0295c6 100644 --- a/src/builtins/array-every.tq +++ b/src/builtins/array-every.tq @@ -5,7 +5,7 @@ namespace array { transitioning javascript builtin ArrayEveryLoopEagerDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny): JSAny { // All continuation points in the optimized every implementation are // after the ToObject(O) call that ensures we are dealing with a @@ -26,7 +26,7 @@ namespace array { transitioning javascript builtin ArrayEveryLoopLazyDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny, result: JSAny): JSAny { // All continuation points in the optimized every implementation are @@ -110,7 +110,7 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.every transitioning javascript builtin - ArrayEvery(js-implicit context: Context, receiver: JSAny)(...arguments): + ArrayEvery(js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny { try { RequireObjectCoercible(receiver, 'Array.prototype.every'); diff --git a/src/builtins/array-filter.tq b/src/builtins/array-filter.tq index 8f5ba1699f..44e8b34d7d 100644 --- a/src/builtins/array-filter.tq +++ b/src/builtins/array-filter.tq @@ -5,7 +5,7 @@ namespace array { transitioning javascript builtin ArrayFilterLoopEagerDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, thisArg: JSAny, array: JSAny, initialK: JSAny, length: JSAny, initialTo: JSAny): JSAny { // All continuation points in the optimized filter implementation are @@ -29,7 +29,7 @@ namespace array { transitioning javascript builtin ArrayFilterLoopLazyDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, thisArg: JSAny, array: JSAny, initialK: JSAny, length: JSAny, valueK: JSAny, initialTo: JSAny, result: JSAny): JSAny { // All continuation points in the optimized filter implementation are @@ -146,8 +146,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.filter transitioning javascript builtin - ArrayFilter(js-implicit context: Context, receiver: JSAny)(...arguments): - JSAny { + ArrayFilter(js-implicit context: NativeContext, receiver: JSAny)( + ...arguments): JSAny { try { RequireObjectCoercible(receiver, 'Array.prototype.filter'); diff --git a/src/builtins/array-find.tq b/src/builtins/array-find.tq index ea7b0ea165..e1a32511f5 100644 --- a/src/builtins/array-find.tq +++ b/src/builtins/array-find.tq @@ -5,7 +5,7 @@ namespace array { transitioning javascript builtin ArrayFindLoopEagerDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny): JSAny { // All continuation points in the optimized find implementation are // after the ToObject(O) call that ensures we are dealing with a @@ -25,7 +25,7 @@ namespace array { transitioning javascript builtin ArrayFindLoopLazyDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( _callback: JSAny, _thisArg: JSAny, _initialK: JSAny, _length: JSAny, _result: JSAny): JSAny { // This deopt continuation point is never actually called, it just @@ -39,7 +39,7 @@ namespace array { // before iteration continues. transitioning javascript builtin ArrayFindLoopAfterCallbackLazyDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny, foundValue: JSAny, isFound: JSAny): JSAny { // All continuation points in the optimized find implementation are @@ -117,7 +117,7 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.find transitioning javascript builtin - ArrayPrototypeFind(js-implicit context: Context, receiver: JSAny)( + ArrayPrototypeFind(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): JSAny { try { RequireObjectCoercible(receiver, 'Array.prototype.find'); diff --git a/src/builtins/array-findindex.tq b/src/builtins/array-findindex.tq index 9d0df957b7..c1be9e95d6 100644 --- a/src/builtins/array-findindex.tq +++ b/src/builtins/array-findindex.tq @@ -5,7 +5,7 @@ namespace array { transitioning javascript builtin ArrayFindIndexLoopEagerDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny): JSAny { // All continuation points in the optimized findIndex implementation are // after the ToObject(O) call that ensures we are dealing with a @@ -25,7 +25,7 @@ namespace array { transitioning javascript builtin ArrayFindIndexLoopLazyDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( _callback: JSAny, _thisArg: JSAny, _initialK: JSAny, _length: JSAny, _result: JSAny): JSAny { // This deopt continuation point is never actually called, it just @@ -39,7 +39,7 @@ namespace array { // before iteration continues. transitioning javascript builtin ArrayFindIndexLoopAfterCallbackLazyDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny, foundValue: JSAny, isFound: JSAny): JSAny { // All continuation points in the optimized findIndex implementation are @@ -118,7 +118,7 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex transitioning javascript builtin - ArrayPrototypeFindIndex(js-implicit context: Context, receiver: JSAny)( + ArrayPrototypeFindIndex(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): JSAny { try { RequireObjectCoercible(receiver, 'Array.prototype.findIndex'); diff --git a/src/builtins/array-foreach.tq b/src/builtins/array-foreach.tq index d3a9aa29d3..a8f077b24b 100644 --- a/src/builtins/array-foreach.tq +++ b/src/builtins/array-foreach.tq @@ -5,7 +5,7 @@ namespace array { transitioning javascript builtin ArrayForEachLoopEagerDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny): JSAny { // All continuation points in the optimized forEach implemntation are // after the ToObject(O) call that ensures we are dealing with a @@ -22,7 +22,7 @@ namespace array { transitioning javascript builtin ArrayForEachLoopLazyDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny, _result: JSAny): JSAny { // All continuation points in the optimized forEach implemntation are @@ -91,8 +91,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.foreach transitioning javascript builtin - ArrayForEach(js-implicit context: Context, receiver: JSAny)(...arguments): - JSAny { + ArrayForEach(js-implicit context: NativeContext, receiver: JSAny)( + ...arguments): JSAny { try { RequireObjectCoercible(receiver, 'Array.prototype.forEach'); diff --git a/src/builtins/array-isarray.tq b/src/builtins/array-isarray.tq index 081e88d7b5..48fca60339 100644 --- a/src/builtins/array-isarray.tq +++ b/src/builtins/array-isarray.tq @@ -8,8 +8,8 @@ namespace runtime { namespace array { // ES #sec-array.isarray - javascript builtin ArrayIsArray(js-implicit context: Context)(arg: JSAny): - JSAny { + javascript builtin ArrayIsArray(js-implicit context: + NativeContext)(arg: JSAny): JSAny { // 1. Return ? IsArray(arg). typeswitch (arg) { case (JSArray): { diff --git a/src/builtins/array-join.tq b/src/builtins/array-join.tq index 15177f81f8..e70e34aa22 100644 --- a/src/builtins/array-join.tq +++ b/src/builtins/array-join.tq @@ -549,7 +549,7 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.join transitioning javascript builtin - ArrayPrototypeJoin(js-implicit context: Context, receiver: JSAny)( + ArrayPrototypeJoin(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): JSAny { const separator: JSAny = arguments[0]; @@ -569,7 +569,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.tolocalestring transitioning javascript builtin ArrayPrototypeToLocaleString( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const locales: JSAny = arguments[0]; const options: JSAny = arguments[1]; @@ -589,7 +590,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.tostring transitioning javascript builtin ArrayPrototypeToString( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { // 1. Let array be ? ToObject(this value). const array: JSReceiver = ToObject_Inline(context, receiver); @@ -610,7 +612,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join transitioning javascript builtin TypedArrayPrototypeJoin( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const separator: JSAny = arguments[0]; // Spec: ValidateTypedArray is applied to the this value prior to evaluating @@ -625,7 +628,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.tolocalestring transitioning javascript builtin TypedArrayPrototypeToLocaleString( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const locales: JSAny = arguments[0]; const options: JSAny = arguments[1]; diff --git a/src/builtins/array-lastindexof.tq b/src/builtins/array-lastindexof.tq index 66bc810c29..eef87c2402 100644 --- a/src/builtins/array-lastindexof.tq +++ b/src/builtins/array-lastindexof.tq @@ -131,7 +131,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.lastIndexOf transitioning javascript builtin ArrayPrototypeLastIndexOf( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { // 1. Let O be ? ToObject(this value). const object: JSReceiver = ToObject_Inline(context, receiver); diff --git a/src/builtins/array-map.tq b/src/builtins/array-map.tq index c1533b4746..a91ca8e84d 100644 --- a/src/builtins/array-map.tq +++ b/src/builtins/array-map.tq @@ -5,7 +5,7 @@ namespace array { transitioning javascript builtin ArrayMapLoopEagerDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, thisArg: JSAny, array: JSAny, initialK: JSAny, length: JSAny): JSAny { // All continuation points in the optimized filter implementation are @@ -28,7 +28,7 @@ namespace array { transitioning javascript builtin ArrayMapLoopLazyDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, thisArg: JSAny, array: JSAny, initialK: JSAny, length: JSAny, result: JSAny): JSAny { // All continuation points in the optimized filter implementation are @@ -224,7 +224,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.map transitioning javascript builtin - ArrayMap(js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + ArrayMap(js-implicit context: NativeContext, receiver: JSAny)(...arguments): + JSAny { try { RequireObjectCoercible(receiver, 'Array.prototype.map'); diff --git a/src/builtins/array-of.tq b/src/builtins/array-of.tq index ad74759fc2..2df961b995 100644 --- a/src/builtins/array-of.tq +++ b/src/builtins/array-of.tq @@ -5,7 +5,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.of transitioning javascript builtin - ArrayOf(js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + ArrayOf(js-implicit context: NativeContext, receiver: JSAny)(...arguments): + JSAny { // 1. Let len be the actual number of arguments passed to this function. const len: Smi = Convert(arguments.length); diff --git a/src/builtins/array-reduce-right.tq b/src/builtins/array-reduce-right.tq index e512c75405..ec876b34bf 100644 --- a/src/builtins/array-reduce-right.tq +++ b/src/builtins/array-reduce-right.tq @@ -5,7 +5,7 @@ namespace array { transitioning javascript builtin ArrayReduceRightPreLoopEagerDeoptContinuation( - js-implicit context: Context, + js-implicit context: NativeContext, receiver: JSAny)(callback: JSAny, length: JSAny): JSAny { // All continuation points in the optimized every implementation are // after the ToObject(O) call that ensures we are dealing with a @@ -27,7 +27,7 @@ namespace array { transitioning javascript builtin ArrayReduceRightLoopEagerDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, initialK: JSAny, length: JSAny, accumulator: JSAny): JSAny { // All continuation points in the optimized every implementation are @@ -48,7 +48,7 @@ namespace array { transitioning javascript builtin ArrayReduceRightLoopLazyDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, initialK: JSAny, length: JSAny, result: JSAny): JSAny { // All continuation points in the optimized every implementation are // after the ToObject(O) call that ensures we are dealing with a @@ -157,8 +157,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.reduceRight transitioning javascript builtin - ArrayReduceRight(js-implicit context: Context, receiver: JSAny)(...arguments): - JSAny { + ArrayReduceRight(js-implicit context: NativeContext, receiver: JSAny)( + ...arguments): JSAny { try { RequireObjectCoercible(receiver, 'Array.prototype.reduceRight'); diff --git a/src/builtins/array-reduce.tq b/src/builtins/array-reduce.tq index 10d0f929ea..fd9d3837d4 100644 --- a/src/builtins/array-reduce.tq +++ b/src/builtins/array-reduce.tq @@ -5,7 +5,7 @@ namespace array { transitioning javascript builtin ArrayReducePreLoopEagerDeoptContinuation( - js-implicit context: Context, + js-implicit context: NativeContext, receiver: JSAny)(callback: JSAny, length: JSAny): JSAny { // All continuation points in the optimized every implementation are // after the ToObject(O) call that ensures we are dealing with a @@ -27,7 +27,7 @@ namespace array { transitioning javascript builtin ArrayReduceLoopEagerDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, initialK: JSAny, length: JSAny, accumulator: JSAny): JSAny { // All continuation points in the optimized every implementation are @@ -48,7 +48,7 @@ namespace array { transitioning javascript builtin ArrayReduceLoopLazyDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, initialK: JSAny, length: JSAny, result: JSAny): JSAny { // All continuation points in the optimized every implementation are // after the ToObject(O) call that ensures we are dealing with a @@ -157,8 +157,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.reduce transitioning javascript builtin - ArrayReduce(js-implicit context: Context, receiver: JSAny)(...arguments): - JSAny { + ArrayReduce(js-implicit context: NativeContext, receiver: JSAny)( + ...arguments): JSAny { try { RequireObjectCoercible(receiver, 'Array.prototype.reduce'); diff --git a/src/builtins/array-reverse.tq b/src/builtins/array-reverse.tq index 9e420632ce..89d4d1728f 100644 --- a/src/builtins/array-reverse.tq +++ b/src/builtins/array-reverse.tq @@ -165,7 +165,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.reverse transitioning javascript builtin ArrayPrototypeReverse( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { try { TryFastPackedArrayReverse(receiver) otherwise Baseline; return receiver; diff --git a/src/builtins/array-shift.tq b/src/builtins/array-shift.tq index bce8d2d037..26137058aa 100644 --- a/src/builtins/array-shift.tq +++ b/src/builtins/array-shift.tq @@ -95,7 +95,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.shift transitioning javascript builtin ArrayPrototypeShift( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { try { return TryFastArrayShift(receiver) otherwise Slow, Runtime; } diff --git a/src/builtins/array-slice.tq b/src/builtins/array-slice.tq index 6076d49672..499cb7e251 100644 --- a/src/builtins/array-slice.tq +++ b/src/builtins/array-slice.tq @@ -122,7 +122,7 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.slice transitioning javascript builtin - ArrayPrototypeSlice(js-implicit context: Context, receiver: JSAny)( + ArrayPrototypeSlice(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): JSAny { // Handle array cloning case if the receiver is a fast array. if (arguments.length == 0) { @@ -171,7 +171,7 @@ namespace array { assert(count <= len); try { - return HandleFastSlice(UnsafeCast(context), o, k, count) + return HandleFastSlice(context, o, k, count) otherwise Slow; } label Slow {} diff --git a/src/builtins/array-some.tq b/src/builtins/array-some.tq index 5d93dd0b72..87cb9166a7 100644 --- a/src/builtins/array-some.tq +++ b/src/builtins/array-some.tq @@ -5,7 +5,7 @@ namespace array { transitioning javascript builtin ArraySomeLoopEagerDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny): JSAny { // All continuation points in the optimized some implementation are // after the ToObject(O) call that ensures we are dealing with a @@ -26,7 +26,7 @@ namespace array { transitioning javascript builtin ArraySomeLoopLazyDeoptContinuation( - js-implicit context: Context, receiver: JSAny)( + js-implicit context: NativeContext, receiver: JSAny)( callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny, result: JSAny): JSAny { // All continuation points in the optimized some implementation are @@ -110,7 +110,7 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.some transitioning javascript builtin - ArraySome(js-implicit context: Context, receiver: JSAny)(...arguments): + ArraySome(js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny { try { RequireObjectCoercible(receiver, 'Array.prototype.some'); diff --git a/src/builtins/array-splice.tq b/src/builtins/array-splice.tq index 7babd6b094..6e8832d12b 100644 --- a/src/builtins/array-splice.tq +++ b/src/builtins/array-splice.tq @@ -350,7 +350,7 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.splice transitioning javascript builtin - ArrayPrototypeSplice(js-implicit context: Context, receiver: JSAny)( + ArrayPrototypeSplice(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): JSAny { // 1. Let O be ? ToObject(this value). const o: JSReceiver = ToObject(context, receiver); diff --git a/src/builtins/array-unshift.tq b/src/builtins/array-unshift.tq index ff00ec6dc7..faa6c1e41c 100644 --- a/src/builtins/array-unshift.tq +++ b/src/builtins/array-unshift.tq @@ -78,7 +78,8 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.unshift transitioning javascript builtin ArrayPrototypeUnshift( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { try { const array: FastJSArray = Cast(receiver) otherwise Slow; array::EnsureWriteableFastElements(array); diff --git a/src/builtins/base.tq b/src/builtins/base.tq index d4837273a0..79a4132f91 100644 --- a/src/builtins/base.tq +++ b/src/builtins/base.tq @@ -1,6 +1,6 @@ // Copyright 2018 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// Use of this source code is governed by a BSD-style license that can be: +// Context found in the LICENSE file. #include 'src/builtins/builtins-regexp-gen.h' #include 'src/builtins/builtins-utils-gen.h' diff --git a/src/builtins/boolean.tq b/src/builtins/boolean.tq index f1bf4c642a..aafc29149f 100644 --- a/src/builtins/boolean.tq +++ b/src/builtins/boolean.tq @@ -10,7 +10,7 @@ namespace boolean { javascript builtin BooleanConstructor( - js-implicit context: Context, receiver: JSAny, newTarget: JSAny, + js-implicit context: NativeContext, receiver: JSAny, newTarget: JSAny, target: JSFunction)(...arguments): JSAny { const value = SelectBooleanConstant(ToBoolean(arguments[0])); @@ -28,7 +28,7 @@ namespace boolean { // ES #sec-boolean.prototype.tostring transitioning javascript builtin BooleanPrototypeToString( - js-implicit context: Context, receiver: JSAny)(): JSAny { + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { // 1. Let b be ? thisBooleanValue(this value). const b = ThisBooleanValue(receiver, 'Boolean.prototype.toString'); // 2. If b is true, return "true"; else return "false". @@ -37,7 +37,7 @@ namespace boolean { // ES #sec-boolean.prototype.valueof transitioning javascript builtin BooleanPrototypeValueOf( - js-implicit context: Context, receiver: JSAny)(): JSAny { + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { // 1. Return ? thisBooleanValue(this value). return ThisBooleanValue(receiver, 'Boolean.prototype.valueOf'); } diff --git a/src/builtins/builtins-string.tq b/src/builtins/builtins-string.tq index bc349e31d4..b3d5d6899f 100644 --- a/src/builtins/builtins-string.tq +++ b/src/builtins/builtins-string.tq @@ -10,14 +10,14 @@ namespace string { // ES6 #sec-string.prototype.tostring transitioning javascript builtin - StringPrototypeToString(js-implicit context: Context, receiver: JSAny)(): - JSAny { + StringPrototypeToString( + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { return ToThisValue(receiver, kString, 'String.prototype.toString'); } // ES6 #sec-string.prototype.valueof transitioning javascript builtin - StringPrototypeValueOf(js-implicit context: Context, receiver: JSAny)(): + StringPrototypeValueOf(js-implicit context: NativeContext, receiver: JSAny)(): JSAny { return ToThisValue(receiver, kString, 'String.prototype.valueOf'); } @@ -93,7 +93,8 @@ namespace string { // ES6 #sec-string.prototype.charat transitioning javascript builtin StringPrototypeCharAt( - js-implicit context: Context, receiver: JSAny)(position: JSAny): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(position: JSAny): JSAny { try { GenerateStringAt(receiver, position, 'String.prototype.charAt') otherwise IfInBounds, IfOutOfBounds; @@ -109,7 +110,8 @@ namespace string { // ES6 #sec-string.prototype.charcodeat transitioning javascript builtin StringPrototypeCharCodeAt( - js-implicit context: Context, receiver: JSAny)(position: JSAny): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(position: JSAny): JSAny { try { GenerateStringAt(receiver, position, 'String.prototype.charCodeAt') otherwise IfInBounds, IfOutOfBounds; @@ -125,7 +127,8 @@ namespace string { // ES6 #sec-string.prototype.codepointat transitioning javascript builtin StringPrototypeCodePointAt( - js-implicit context: Context, receiver: JSAny)(position: JSAny): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(position: JSAny): JSAny { try { GenerateStringAt(receiver, position, 'String.prototype.codePointAt') otherwise IfInBounds, IfOutOfBounds; @@ -145,7 +148,8 @@ namespace string { // ES6 String.prototype.concat(...args) // ES6 #sec-string.prototype.concat transitioning javascript builtin StringPrototypeConcat( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { // Check that {receiver} is coercible to Object and convert it to a String. let string: String = ToThisString(receiver, 'String.prototype.concat'); @@ -164,7 +168,7 @@ namespace string { // ES #sec-string-constructor // https://tc39.github.io/ecma262/#sec-string-constructor transitioning javascript builtin StringConstructor( - js-implicit context: Context, receiver: JSAny, newTarget: JSAny, + js-implicit context: NativeContext, receiver: JSAny, newTarget: JSAny, target: JSFunction)(...arguments): JSAny { const length: intptr = Convert(arguments.length); let s: String; diff --git a/src/builtins/console.tq b/src/builtins/console.tq index dd6769d7e7..48d5d08abc 100644 --- a/src/builtins/console.tq +++ b/src/builtins/console.tq @@ -7,7 +7,7 @@ namespace console { Context)(JSFunction, JSAny, int32): JSAny; javascript builtin FastConsoleAssert( - js-implicit context: Context, receiver: JSAny, newTarget: JSAny, + js-implicit context: NativeContext, receiver: JSAny, newTarget: JSAny, target: JSFunction)(...arguments): JSAny { if (ToBoolean(arguments[0])) { return Undefined; diff --git a/src/builtins/data-view.tq b/src/builtins/data-view.tq index c52e6e2449..1ec98a6d69 100644 --- a/src/builtins/data-view.tq +++ b/src/builtins/data-view.tq @@ -74,7 +74,7 @@ namespace data_view { // ES6 section 24.2.4.1 get DataView.prototype.buffer javascript builtin DataViewPrototypeGetBuffer( - js-implicit context: Context, + js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSArrayBuffer { const dataView: JSDataView = ValidateDataView(context, receiver, 'get DataView.prototype.buffer'); @@ -83,7 +83,8 @@ namespace data_view { // ES6 section 24.2.4.2 get DataView.prototype.byteLength javascript builtin DataViewPrototypeGetByteLength( - js-implicit context: Context, receiver: JSAny)(...arguments): Number { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): Number { const dataView: JSDataView = ValidateDataView( context, receiver, 'get DataView.prototype.byte_length'); if (WasDetached(dataView)) { @@ -96,7 +97,8 @@ namespace data_view { // ES6 section 24.2.4.3 get DataView.prototype.byteOffset javascript builtin DataViewPrototypeGetByteOffset( - js-implicit context: Context, receiver: JSAny)(...arguments): Number { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): Number { const dataView: JSDataView = ValidateDataView( context, receiver, 'get DataView.prototype.byte_offset'); if (WasDetached(dataView)) { @@ -426,19 +428,22 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeGetUint8( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; return DataViewGet(context, receiver, offset, Undefined, UINT8_ELEMENTS); } transitioning javascript builtin DataViewPrototypeGetInt8( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; return DataViewGet(context, receiver, offset, Undefined, INT8_ELEMENTS); } transitioning javascript builtin DataViewPrototypeGetUint16( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const isLittleEndian: JSAny = arguments.length > 1 ? arguments[1] : Undefined; @@ -447,7 +452,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeGetInt16( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const isLittleEndian: JSAny = arguments.length > 1 ? arguments[1] : Undefined; @@ -456,7 +462,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeGetUint32( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const isLittleEndian: JSAny = arguments.length > 1 ? arguments[1] : Undefined; @@ -465,7 +472,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeGetInt32( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const isLittleEndian: JSAny = arguments.length > 1 ? arguments[1] : Undefined; @@ -474,7 +482,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeGetFloat32( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const isLittleEndian: JSAny = arguments.length > 1 ? arguments[1] : Undefined; @@ -483,7 +492,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeGetFloat64( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const isLittleEndian: JSAny = arguments.length > 1 ? arguments[1] : Undefined; @@ -492,7 +502,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeGetBigUint64( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const isLittleEndian: JSAny = arguments.length > 1 ? arguments[1] : Undefined; @@ -501,7 +512,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeGetBigInt64( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const isLittleEndian: JSAny = arguments.length > 1 ? arguments[1] : Undefined; @@ -729,7 +741,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeSetUint8( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const value: JSAny = arguments.length > 1 ? arguments[1] : Undefined; return DataViewSet( @@ -737,7 +750,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeSetInt8( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const value: JSAny = arguments.length > 1 ? arguments[1] : Undefined; return DataViewSet( @@ -745,7 +759,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeSetUint16( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const value: JSAny = arguments.length > 1 ? arguments[1] : Undefined; const isLittleEndian: JSAny = @@ -755,7 +770,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeSetInt16( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const value: JSAny = arguments.length > 1 ? arguments[1] : Undefined; const isLittleEndian: JSAny = @@ -765,7 +781,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeSetUint32( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const value: JSAny = arguments.length > 1 ? arguments[1] : Undefined; const isLittleEndian: JSAny = @@ -775,7 +792,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeSetInt32( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const value: JSAny = arguments.length > 1 ? arguments[1] : Undefined; const isLittleEndian: JSAny = @@ -785,7 +803,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeSetFloat32( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const value: JSAny = arguments.length > 1 ? arguments[1] : Undefined; const isLittleEndian: JSAny = @@ -795,7 +814,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeSetFloat64( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const value: JSAny = arguments.length > 1 ? arguments[1] : Undefined; const isLittleEndian: JSAny = @@ -805,7 +825,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeSetBigUint64( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const value: JSAny = arguments.length > 1 ? arguments[1] : Undefined; const isLittleEndian: JSAny = @@ -815,7 +836,8 @@ namespace data_view { } transitioning javascript builtin DataViewPrototypeSetBigInt64( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const offset: JSAny = arguments.length > 0 ? arguments[0] : Undefined; const value: JSAny = arguments.length > 1 ? arguments[1] : Undefined; const isLittleEndian: JSAny = diff --git a/src/builtins/math.tq b/src/builtins/math.tq index 26832405b8..ecb2065a11 100644 --- a/src/builtins/math.tq +++ b/src/builtins/math.tq @@ -36,7 +36,7 @@ namespace math { constexpr float64 generates '0.0 - kSmiMinValue'; transitioning javascript builtin - MathAbs(js-implicit context: Context)(x: JSAny): Number { + MathAbs(js-implicit context: NativeContext)(x: JSAny): Number { try { ReduceToSmiOrFloat64(x) otherwise SmiResult, Float64Result; } @@ -67,7 +67,7 @@ namespace math { // ES6 #sec-math.ceil extern macro Float64Ceil(float64): float64; transitioning javascript builtin - MathCeil(js-implicit context: Context)(x: JSAny): Number { + MathCeil(js-implicit context: NativeContext)(x: JSAny): Number { try { ReduceToSmiOrFloat64(x) otherwise SmiResult, Float64Result; } @@ -82,7 +82,7 @@ namespace math { // ES6 #sec-math.floor extern macro Float64Floor(float64): float64; transitioning javascript builtin - MathFloor(js-implicit context: Context)(x: JSAny): Number { + MathFloor(js-implicit context: NativeContext)(x: JSAny): Number { try { ReduceToSmiOrFloat64(x) otherwise SmiResult, Float64Result; } @@ -97,7 +97,7 @@ namespace math { // ES6 #sec-math.round extern macro Float64Round(float64): float64; transitioning javascript builtin - MathRound(js-implicit context: Context)(x: JSAny): Number { + MathRound(js-implicit context: NativeContext)(x: JSAny): Number { try { ReduceToSmiOrFloat64(x) otherwise SmiResult, Float64Result; } @@ -112,7 +112,7 @@ namespace math { // ES6 #sec-math.trunc extern macro Float64Trunc(float64): float64; transitioning javascript builtin - MathTrunc(js-implicit context: Context)(x: JSAny): Number { + MathTrunc(js-implicit context: NativeContext)(x: JSAny): Number { try { ReduceToSmiOrFloat64(x) otherwise SmiResult, Float64Result; } @@ -139,14 +139,15 @@ namespace math { } transitioning javascript builtin - MathPow(js-implicit context: Context)(base: JSAny, exponent: JSAny): Number { + MathPow(js-implicit context: NativeContext)(base: JSAny, exponent: JSAny): + Number { return MathPowImpl(base, exponent); } // ES6 #sec-math.max extern macro Float64Max(float64, float64): float64; transitioning javascript builtin - MathMax(js-implicit context: Context)(...arguments): Number { + MathMax(js-implicit context: NativeContext)(...arguments): Number { let result: float64 = MINUS_V8_INFINITY; const argCount = arguments.length; for (let i: intptr = 0; i < argCount; i++) { @@ -159,7 +160,7 @@ namespace math { // ES6 #sec-math.min extern macro Float64Min(float64, float64): float64; transitioning javascript builtin - MathMin(js-implicit context: Context)(...arguments): Number { + MathMin(js-implicit context: NativeContext)(...arguments): Number { let result: float64 = V8_INFINITY; const argCount = arguments.length; for (let i: intptr = 0; i < argCount; i++) { @@ -173,7 +174,7 @@ namespace math { extern macro Float64Acos(float64): float64; transitioning javascript builtin - MathAcos(js-implicit context: Context)(x: JSAny): Number { + MathAcos(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Acos(value)); } @@ -182,7 +183,7 @@ namespace math { extern macro Float64Acosh(float64): float64; transitioning javascript builtin - MathAcosh(js-implicit context: Context)(x: JSAny): Number { + MathAcosh(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Acosh(value)); } @@ -191,7 +192,7 @@ namespace math { extern macro Float64Asin(float64): float64; transitioning javascript builtin - MathAsin(js-implicit context: Context)(x: JSAny): Number { + MathAsin(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Asin(value)); } @@ -200,7 +201,7 @@ namespace math { extern macro Float64Asinh(float64): float64; transitioning javascript builtin - MathAsinh(js-implicit context: Context)(x: JSAny): Number { + MathAsinh(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Asinh(value)); } @@ -209,7 +210,7 @@ namespace math { extern macro Float64Atan(float64): float64; transitioning javascript builtin - MathAtan(js-implicit context: Context)(x: JSAny): Number { + MathAtan(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Atan(value)); } @@ -218,7 +219,7 @@ namespace math { extern macro Float64Atan2(float64, float64): float64; transitioning javascript builtin - MathAtan2(js-implicit context: Context)(y: JSAny, x: JSAny): Number { + MathAtan2(js-implicit context: NativeContext)(y: JSAny, x: JSAny): Number { const yValue = Convert(ToNumber_Inline(y)); const xValue = Convert(ToNumber_Inline(x)); return Convert(Float64Atan2(yValue, xValue)); @@ -228,7 +229,7 @@ namespace math { extern macro Float64Atanh(float64): float64; transitioning javascript builtin - MathAtanh(js-implicit context: Context)(x: JSAny): Number { + MathAtanh(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Atanh(value)); } @@ -237,7 +238,7 @@ namespace math { extern macro Float64Cbrt(float64): float64; transitioning javascript builtin - MathCbrt(js-implicit context: Context)(x: JSAny): Number { + MathCbrt(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Cbrt(value)); } @@ -246,7 +247,7 @@ namespace math { extern macro Word32Clz(int32): int32; transitioning javascript builtin - MathClz32(js-implicit context: Context)(x: JSAny): Number { + MathClz32(js-implicit context: NativeContext)(x: JSAny): Number { const value: int32 = Convert(ToNumber_Inline(x)); return Convert(Word32Clz(value)); } @@ -255,7 +256,7 @@ namespace math { extern macro Float64Cos(float64): float64; transitioning javascript builtin - MathCos(js-implicit context: Context)(x: JSAny): Number { + MathCos(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Cos(value)); } @@ -264,7 +265,7 @@ namespace math { extern macro Float64Cosh(float64): float64; transitioning javascript builtin - MathCosh(js-implicit context: Context)(x: JSAny): Number { + MathCosh(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Cosh(value)); } @@ -273,7 +274,7 @@ namespace math { extern macro Float64Exp(float64): float64; transitioning javascript builtin - MathExp(js-implicit context: Context)(x: JSAny): Number { + MathExp(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Exp(value)); } @@ -282,14 +283,14 @@ namespace math { extern macro Float64Expm1(float64): float64; transitioning javascript builtin - MathExpm1(js-implicit context: Context)(x: JSAny): Number { + MathExpm1(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Expm1(value)); } // ES6 #sec-math.fround transitioning javascript builtin - MathFround(js-implicit context: Context)(x: JSAny): Number { + MathFround(js-implicit context: NativeContext)(x: JSAny): Number { const x32 = Convert(ToNumber_Inline(x)); const x64 = Convert(x32); return Convert(x64); @@ -297,7 +298,7 @@ namespace math { // ES6 #sec-math.imul transitioning javascript builtin - MathImul(js-implicit context: Context)(x: JSAny, y: JSAny): Number { + MathImul(js-implicit context: NativeContext)(x: JSAny, y: JSAny): Number { const x = Convert(ToNumber_Inline(x)); const y = Convert(ToNumber_Inline(y)); return Convert(x * y); @@ -307,7 +308,7 @@ namespace math { extern macro Float64Log(float64): float64; transitioning javascript builtin - MathLog(js-implicit context: Context)(x: JSAny): Number { + MathLog(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Log(value)); } @@ -316,7 +317,7 @@ namespace math { extern macro Float64Log1p(float64): float64; transitioning javascript builtin - MathLog1p(js-implicit context: Context)(x: JSAny): Number { + MathLog1p(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Log1p(value)); } @@ -325,7 +326,7 @@ namespace math { extern macro Float64Log10(float64): float64; transitioning javascript builtin - MathLog10(js-implicit context: Context)(x: JSAny): Number { + MathLog10(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Log10(value)); } @@ -334,7 +335,7 @@ namespace math { extern macro Float64Log2(float64): float64; transitioning javascript builtin - MathLog2(js-implicit context: Context)(x: JSAny): Number { + MathLog2(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Log2(value)); } @@ -343,14 +344,14 @@ namespace math { extern macro Float64Sin(float64): float64; transitioning javascript builtin - MathSin(js-implicit context: Context)(x: JSAny): Number { + MathSin(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Sin(value)); } // ES6 #sec-math.sign transitioning javascript builtin - MathSign(js-implicit context: Context)(x: JSAny): Number { + MathSign(js-implicit context: NativeContext)(x: JSAny): Number { const num = ToNumber_Inline(x); const value = Convert(num); @@ -367,7 +368,7 @@ namespace math { extern macro Float64Sinh(float64): float64; transitioning javascript builtin - MathSinh(js-implicit context: Context)(x: JSAny): Number { + MathSinh(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Sinh(value)); } @@ -376,7 +377,7 @@ namespace math { extern macro Float64Sqrt(float64): float64; transitioning javascript builtin - MathSqrt(js-implicit context: Context)(x: JSAny): Number { + MathSqrt(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Sqrt(value)); } @@ -385,7 +386,7 @@ namespace math { extern macro Float64Tan(float64): float64; transitioning javascript builtin - MathTan(js-implicit context: Context)(x: JSAny): Number { + MathTan(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Tan(value)); } @@ -394,14 +395,14 @@ namespace math { extern macro Float64Tanh(float64): float64; transitioning javascript builtin - MathTanh(js-implicit context: Context)(x: JSAny): Number { + MathTanh(js-implicit context: NativeContext)(x: JSAny): Number { const value = Convert(ToNumber_Inline(x)); return Convert(Float64Tanh(value)); } // ES6 #sec-math.hypot transitioning javascript builtin - MathHypot(js-implicit context: Context, receiver: JSAny)(...arguments): + MathHypot(js-implicit context: NativeContext, receiver: JSAny)(...arguments): Number { const length = arguments.length; if (length == 0) { @@ -449,19 +450,18 @@ namespace math { extern macro RefillMathRandom(NativeContext): Smi; transitioning javascript builtin - MathRandom(js-implicit context: Context, receiver: JSAny)(): Number { - const nativeContext: NativeContext = LoadNativeContext(context); - let smiIndex: Smi = Cast(nativeContext[MATH_RANDOM_INDEX_INDEX]) + MathRandom(js-implicit context: NativeContext, receiver: JSAny)(): Number { + let smiIndex: Smi = Cast(context[MATH_RANDOM_INDEX_INDEX]) otherwise unreachable; if (smiIndex == 0) { // refill math random. - smiIndex = RefillMathRandom(nativeContext); + smiIndex = RefillMathRandom(context); } const newSmiIndex: Smi = smiIndex - 1; - nativeContext[MATH_RANDOM_INDEX_INDEX] = newSmiIndex; + context[MATH_RANDOM_INDEX_INDEX] = newSmiIndex; const array: FixedDoubleArray = - Cast(nativeContext[MATH_RANDOM_CACHE_INDEX]) + Cast(context[MATH_RANDOM_CACHE_INDEX]) otherwise unreachable; const random: float64 = array.floats[Convert(newSmiIndex)]; return AllocateHeapNumberWithValue(random); diff --git a/src/builtins/number.tq b/src/builtins/number.tq index 863fe00bb6..300da50ed4 100644 --- a/src/builtins/number.tq +++ b/src/builtins/number.tq @@ -26,7 +26,8 @@ namespace number { // https://tc39.github.io/ecma262/#sec-number.prototype.tostring transitioning javascript builtin NumberPrototypeToString( - js-implicit context: Context, receiver: JSAny)(...arguments): String { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): String { // 1. Let x be ? thisNumberValue(this value). const x = ThisNumberValue(receiver, 'Number.prototype.toString'); diff --git a/src/builtins/object-fromentries.tq b/src/builtins/object-fromentries.tq index fc36e34038..c355103f8c 100644 --- a/src/builtins/object-fromentries.tq +++ b/src/builtins/object-fromentries.tq @@ -33,7 +33,7 @@ namespace object { } transitioning javascript builtin - ObjectFromEntries(js-implicit context: Context, receiver: JSAny)( + ObjectFromEntries(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): JSAny { const iterable: JSAny = arguments[0]; try { diff --git a/src/builtins/object.tq b/src/builtins/object.tq index 5ba2bb1740..7ac4bc2563 100644 --- a/src/builtins/object.tq +++ b/src/builtins/object.tq @@ -138,25 +138,27 @@ namespace object { // ES6 section 19.1.2.11 Object.isExtensible ( O ) transitioning javascript builtin - ObjectIsExtensible(js-implicit context: Context)(object: JSAny): JSAny { + ObjectIsExtensible(js-implicit context: NativeContext)(object: JSAny): JSAny { return object::ObjectIsExtensibleImpl(object); } // ES6 section 19.1.2.18 Object.preventExtensions ( O ) transitioning javascript builtin - ObjectPreventExtensions(js-implicit context: Context)(object: JSAny): JSAny { + ObjectPreventExtensions(js-implicit context: NativeContext)(object: JSAny): + JSAny { return object::ObjectPreventExtensionsThrow(object); } // ES6 section 19.1.2.9 Object.getPrototypeOf ( O ) transitioning javascript builtin - ObjectGetPrototypeOf(js-implicit context: Context)(object: JSAny): JSAny { + ObjectGetPrototypeOf(js-implicit context: NativeContext)(object: JSAny): + JSAny { return object::ObjectGetPrototypeOfImpl(object); } // ES6 section 19.1.2.21 Object.setPrototypeOf ( O, proto ) transitioning javascript builtin ObjectSetPrototypeOf( - js-implicit context: Context)(object: JSAny, proto: JSAny): JSAny { + js-implicit context: NativeContext)(object: JSAny, proto: JSAny): JSAny { // 1. Set O to ? RequireObjectCoercible(O). RequireObjectCoercible(object, 'Object.setPrototypeOf'); diff --git a/src/builtins/promise-abstract-operations.tq b/src/builtins/promise-abstract-operations.tq index c8169bc498..48e6d94e34 100644 --- a/src/builtins/promise-abstract-operations.tq +++ b/src/builtins/promise-abstract-operations.tq @@ -360,8 +360,9 @@ namespace promise { // https://tc39.es/ecma262/#sec-promise-reject-functions transitioning javascript builtin - PromiseCapabilityDefaultReject(js-implicit context: Context, receiver: JSAny)( - reason: JSAny): JSAny { + PromiseCapabilityDefaultReject( + js-implicit context: NativeContext, + receiver: JSAny)(reason: JSAny): JSAny { // 2. Let promise be F.[[Promise]]. const promise = UnsafeCast(context[kPromiseBuiltinsPromiseSlot]); @@ -386,7 +387,8 @@ namespace promise { // https://tc39.es/ecma262/#sec-promise-resolve-functions transitioning javascript builtin PromiseCapabilityDefaultResolve( - js-implicit context: Context, receiver: JSAny)(resolution: JSAny): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(resolution: JSAny): JSAny { // 2. Let promise be F.[[Promise]]. const promise = UnsafeCast(context[kPromiseBuiltinsPromiseSlot]); diff --git a/src/builtins/proxy-constructor.tq b/src/builtins/proxy-constructor.tq index cfb11046a7..83b10dd1e9 100644 --- a/src/builtins/proxy-constructor.tq +++ b/src/builtins/proxy-constructor.tq @@ -10,7 +10,7 @@ namespace proxy { // https://tc39.github.io/ecma262/#sec-proxy-constructor transitioning javascript builtin ProxyConstructor( - js-implicit context: Context, receiver: JSAny, + js-implicit context: NativeContext, receiver: JSAny, newTarget: JSAny)(target: JSAny, handler: JSAny): JSProxy { try { // 1. If NewTarget is undefined, throw a TypeError exception. diff --git a/src/builtins/proxy-revocable.tq b/src/builtins/proxy-revocable.tq index 465b1aef96..ce69823ec1 100644 --- a/src/builtins/proxy-revocable.tq +++ b/src/builtins/proxy-revocable.tq @@ -12,8 +12,8 @@ namespace proxy { // Proxy.revocable(target, handler) // https://tc39.github.io/ecma262/#sec-proxy.revocable transitioning javascript builtin - ProxyRevocable(js-implicit context: Context)(target: JSAny, handler: JSAny): - JSProxyRevocableResult { + ProxyRevocable(js-implicit context: NativeContext)( + target: JSAny, handler: JSAny): JSProxyRevocableResult { try { const targetJSReceiver = Cast(target) otherwise ThrowProxyNonObject; diff --git a/src/builtins/proxy-revoke.tq b/src/builtins/proxy-revoke.tq index d89b54077a..7300f4d717 100644 --- a/src/builtins/proxy-revoke.tq +++ b/src/builtins/proxy-revoke.tq @@ -9,7 +9,7 @@ namespace proxy { // Proxy Revocation Functions // https://tc39.github.io/ecma262/#sec-proxy-revocation-functions transitioning javascript builtin - ProxyRevoke(js-implicit context: Context)(): Undefined { + ProxyRevoke(js-implicit context: NativeContext)(): Undefined { // 1. Let p be F.[[RevocableProxy]]. const proxyObject: Object = context[PROXY_SLOT]; diff --git a/src/builtins/reflect.tq b/src/builtins/reflect.tq index 5c5e15c554..95d83b5ead 100644 --- a/src/builtins/reflect.tq +++ b/src/builtins/reflect.tq @@ -9,7 +9,8 @@ namespace reflect { // ES6 section 26.1.10 Reflect.isExtensible transitioning javascript builtin - ReflectIsExtensible(js-implicit context: Context)(object: JSAny): JSAny { + ReflectIsExtensible(js-implicit context: NativeContext)(object: JSAny): + JSAny { const objectJSReceiver = Cast(object) otherwise ThrowTypeError(kCalledOnNonObject, 'Reflect.isExtensible'); return object::ObjectIsExtensibleImpl(objectJSReceiver); @@ -17,7 +18,8 @@ namespace reflect { // ES6 section 26.1.12 Reflect.preventExtensions transitioning javascript builtin - ReflectPreventExtensions(js-implicit context: Context)(object: JSAny): JSAny { + ReflectPreventExtensions(js-implicit context: NativeContext)(object: JSAny): + JSAny { const objectJSReceiver = Cast(object) otherwise ThrowTypeError(kCalledOnNonObject, 'Reflect.preventExtensions'); return object::ObjectPreventExtensionsDontThrow(objectJSReceiver); @@ -25,7 +27,8 @@ namespace reflect { // ES6 section 26.1.8 Reflect.getPrototypeOf transitioning javascript builtin - ReflectGetPrototypeOf(js-implicit context: Context)(object: JSAny): JSAny { + ReflectGetPrototypeOf(js-implicit context: NativeContext)(object: JSAny): + JSAny { const objectJSReceiver = Cast(object) otherwise ThrowTypeError(kCalledOnNonObject, 'Reflect.getPrototypeOf'); return object::JSReceiverGetPrototypeOf(objectJSReceiver); @@ -33,7 +36,7 @@ namespace reflect { // ES6 section 26.1.14 Reflect.setPrototypeOf transitioning javascript builtin ReflectSetPrototypeOf( - js-implicit context: Context)(object: JSAny, proto: JSAny): JSAny { + js-implicit context: NativeContext)(object: JSAny, proto: JSAny): JSAny { const objectJSReceiver = Cast(object) otherwise ThrowTypeError(kCalledOnNonObject, 'Reflect.setPrototypeOf'); typeswitch (proto) { @@ -57,7 +60,7 @@ namespace reflect { // ES6 section 26.1.6 Reflect.get transitioning javascript builtin - ReflectGet(js-implicit context: Context)(...arguments): JSAny { + ReflectGet(js-implicit context: NativeContext)(...arguments): JSAny { const length = arguments.length; const object: JSAny = length > 0 ? arguments[0] : Undefined; const objectJSReceiver = Cast(object) @@ -71,7 +74,7 @@ namespace reflect { // ES6 section 26.1.4 Reflect.deleteProperty transitioning javascript builtin ReflectDeleteProperty( - js-implicit context: Context)(object: JSAny, key: JSAny): JSAny { + js-implicit context: NativeContext)(object: JSAny, key: JSAny): JSAny { const objectJSReceiver = Cast(object) otherwise ThrowTypeError(kCalledOnNonObject, 'Reflect.deleteProperty'); return DeleteProperty(objectJSReceiver, key, kSloppy); @@ -79,7 +82,8 @@ namespace reflect { // ES section #sec-reflect.has transitioning javascript builtin - ReflectHas(js-implicit context: Context)(object: JSAny, key: JSAny): JSAny { + ReflectHas(js-implicit context: NativeContext)(object: JSAny, key: JSAny): + JSAny { const objectJSReceiver = Cast(object) otherwise ThrowTypeError(kCalledOnNonObject, 'Reflect.has'); return HasProperty(objectJSReceiver, key); diff --git a/src/builtins/regexp-exec.tq b/src/builtins/regexp-exec.tq index 72027eb718..a21d905eb0 100644 --- a/src/builtins/regexp-exec.tq +++ b/src/builtins/regexp-exec.tq @@ -30,7 +30,8 @@ namespace regexp { // ES#sec-regexp.prototype.exec // RegExp.prototype.exec ( string ) transitioning javascript builtin RegExpPrototypeExec( - js-implicit context: Context, receiver: JSAny)(string: JSAny): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(string: JSAny): JSAny { // Ensure {receiver} is a JSRegExp. const receiver = Cast(receiver) otherwise ThrowTypeError( kIncompatibleMethodReceiver, 'RegExp.prototype.exec', receiver); diff --git a/src/builtins/regexp-match-all.tq b/src/builtins/regexp-match-all.tq index 87f9d2a072..13ba27ec32 100644 --- a/src/builtins/regexp-match-all.tq +++ b/src/builtins/regexp-match-all.tq @@ -99,9 +99,9 @@ namespace regexp { // https://tc39.github.io/proposal-string-matchall/ // RegExp.prototype [ @@matchAll ] ( string ) transitioning javascript builtin RegExpPrototypeMatchAll( - js-implicit context: Context, receiver: JSAny)(string: JSAny): JSAny { - const nativeContext: NativeContext = LoadNativeContext(context); - return RegExpPrototypeMatchAllImpl(nativeContext, receiver, string); + js-implicit context: NativeContext, + receiver: JSAny)(string: JSAny): JSAny { + return RegExpPrototypeMatchAllImpl(context, receiver, string); } const kJSRegExpStringIteratorDone: @@ -133,7 +133,7 @@ namespace regexp { // https://tc39.github.io/proposal-string-matchall/ // %RegExpStringIteratorPrototype%.next ( ) transitioning javascript builtin RegExpStringIteratorPrototypeNext( - js-implicit context: Context, receiver: JSAny)(): JSAny { + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { // 1. Let O be the this value. // 2. If Type(O) is not Object, throw a TypeError exception. // 3. If O does not have all of the internal slots of a RegExp String diff --git a/src/builtins/regexp-match.tq b/src/builtins/regexp-match.tq index eef10be0a7..7fa4ab14a4 100644 --- a/src/builtins/regexp-match.tq +++ b/src/builtins/regexp-match.tq @@ -138,7 +138,8 @@ namespace regexp { // ES#sec-regexp.prototype-@@match // RegExp.prototype [ @@match ] ( string ) transitioning javascript builtin RegExpPrototypeMatch( - js-implicit context: Context, receiver: JSAny)(string: JSAny): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(string: JSAny): JSAny { ThrowIfNotJSReceiver( receiver, kIncompatibleMethodReceiver, 'RegExp.prototype.@@match'); const receiver = UnsafeCast(receiver); diff --git a/src/builtins/regexp-replace.tq b/src/builtins/regexp-replace.tq index fe166be228..4bb606f6e6 100644 --- a/src/builtins/regexp-replace.tq +++ b/src/builtins/regexp-replace.tq @@ -215,7 +215,8 @@ namespace regexp { generates 'v8::Isolate::kRegExpReplaceCalledOnSlowRegExp'; transitioning javascript builtin RegExpPrototypeReplace( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { const methodName: constexpr string = 'RegExp.prototype.@@replace'; // RegExpPrototypeReplace is a bit of a beast - a summary of dispatch logic: diff --git a/src/builtins/regexp-search.tq b/src/builtins/regexp-search.tq index f473643fe0..0e6d36949c 100644 --- a/src/builtins/regexp-search.tq +++ b/src/builtins/regexp-search.tq @@ -89,7 +89,8 @@ namespace regexp { // ES#sec-regexp.prototype-@@search // RegExp.prototype [ @@search ] ( string ) transitioning javascript builtin RegExpPrototypeSearch( - js-implicit context: Context, receiver: JSAny)(string: JSAny): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(string: JSAny): JSAny { ThrowIfNotJSReceiver( receiver, kIncompatibleMethodReceiver, 'RegExp.prototype.@@search'); const receiver = UnsafeCast(receiver); diff --git a/src/builtins/regexp-source.tq b/src/builtins/regexp-source.tq index 266c9e7472..84b08dcc8f 100644 --- a/src/builtins/regexp-source.tq +++ b/src/builtins/regexp-source.tq @@ -9,7 +9,7 @@ namespace regexp { // ES6 21.2.5.10. // ES #sec-get-regexp.prototype.source transitioning javascript builtin RegExpPrototypeSourceGetter( - js-implicit context: Context, receiver: JSAny)(): JSAny { + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { typeswitch (receiver) { case (receiver: JSRegExp): { return receiver.source; diff --git a/src/builtins/regexp-split.tq b/src/builtins/regexp-split.tq index 4084e5e9c3..a774b4de83 100644 --- a/src/builtins/regexp-split.tq +++ b/src/builtins/regexp-split.tq @@ -54,7 +54,8 @@ namespace regexp { // ES#sec-regexp.prototype-@@split // RegExp.prototype [ @@split ] ( string, limit ) transitioning javascript builtin RegExpPrototypeSplit( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { ThrowIfNotJSReceiver( receiver, kIncompatibleMethodReceiver, 'RegExp.prototype.@@split'); const receiver = UnsafeCast(receiver); diff --git a/src/builtins/regexp-test.tq b/src/builtins/regexp-test.tq index 27738d9db1..44f8d019d1 100644 --- a/src/builtins/regexp-test.tq +++ b/src/builtins/regexp-test.tq @@ -9,7 +9,8 @@ namespace regexp { // ES#sec-regexp.prototype.test // RegExp.prototype.test ( S ) transitioning javascript builtin RegExpPrototypeTest( - js-implicit context: Context, receiver: JSAny)(string: JSAny): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(string: JSAny): JSAny { const methodName: constexpr string = 'RegExp.prototype.test'; const receiver = Cast(receiver) otherwise ThrowTypeError(kIncompatibleMethodReceiver, methodName); diff --git a/src/builtins/regexp.tq b/src/builtins/regexp.tq index 08245cf186..3a9fe9d694 100644 --- a/src/builtins/regexp.tq +++ b/src/builtins/regexp.tq @@ -212,7 +212,7 @@ namespace regexp { // ES6 21.2.5.4. // ES #sec-get-regexp.prototype.global transitioning javascript builtin RegExpPrototypeGlobalGetter( - js-implicit context: Context, receiver: JSAny)(): JSAny { + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { return FlagGetter( receiver, kGlobal, kRegExpPrototypeOldFlagGetter, 'RegExp.prototype.global'); @@ -221,7 +221,7 @@ namespace regexp { // ES6 21.2.5.5. // ES #sec-get-regexp.prototype.ignorecase transitioning javascript builtin RegExpPrototypeIgnoreCaseGetter( - js-implicit context: Context, receiver: JSAny)(): JSAny { + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { return FlagGetter( receiver, kIgnoreCase, kRegExpPrototypeOldFlagGetter, 'RegExp.prototype.ignoreCase'); @@ -230,7 +230,7 @@ namespace regexp { // ES6 21.2.5.7. // ES #sec-get-regexp.prototype.multiline transitioning javascript builtin RegExpPrototypeMultilineGetter( - js-implicit context: Context, receiver: JSAny)(): JSAny { + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { return FlagGetter( receiver, kMultiline, kRegExpPrototypeOldFlagGetter, 'RegExp.prototype.multiline'); @@ -238,7 +238,7 @@ namespace regexp { // ES #sec-get-regexp.prototype.dotAll transitioning javascript builtin RegExpPrototypeDotAllGetter( - js-implicit context: Context, receiver: JSAny)(): JSAny { + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { const kNoCounter: constexpr int31 = -1; return FlagGetter(receiver, kDotAll, kNoCounter, 'RegExp.prototype.dotAll'); } @@ -246,7 +246,7 @@ namespace regexp { // ES6 21.2.5.12. // ES #sec-get-regexp.prototype.sticky transitioning javascript builtin RegExpPrototypeStickyGetter( - js-implicit context: Context, receiver: JSAny)(): JSAny { + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { return FlagGetter( receiver, kSticky, kRegExpPrototypeStickyGetter, 'RegExp.prototype.sticky'); @@ -255,7 +255,7 @@ namespace regexp { // ES6 21.2.5.15. // ES #sec-get-regexp.prototype.unicode transitioning javascript builtin RegExpPrototypeUnicodeGetter( - js-implicit context: Context, receiver: JSAny)(): JSAny { + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { return FlagGetter( receiver, kUnicode, kRegExpPrototypeUnicodeGetter, 'RegExp.prototype.unicode'); @@ -281,7 +281,7 @@ namespace regexp { // ES #sec-get-regexp.prototype.flags // TFJ(RegExpPrototypeFlagsGetter, 0, kReceiver) \ transitioning javascript builtin RegExpPrototypeFlagsGetter( - js-implicit context: Context, receiver: JSAny)(): String { + js-implicit context: NativeContext, receiver: JSAny)(): String { ThrowIfNotJSReceiver(receiver, kRegExpNonObject, 'RegExp.prototype.flags'); // The check is strict because the following code relies on individual flag diff --git a/src/builtins/string-endswith.tq b/src/builtins/string-endswith.tq index 963f6915e0..f18e5c466a 100644 --- a/src/builtins/string-endswith.tq +++ b/src/builtins/string-endswith.tq @@ -26,7 +26,8 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.endswith transitioning javascript builtin StringPrototypeEndsWith( - js-implicit context: Context, receiver: JSAny)(...arguments): Boolean { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): Boolean { const searchString: JSAny = arguments[0]; const endPosition: JSAny = arguments[1]; const kBuiltinName: constexpr string = 'String.prototype.endsWith'; diff --git a/src/builtins/string-html.tq b/src/builtins/string-html.tq index 5ec1bbfae5..f12c2dd22f 100644 --- a/src/builtins/string-html.tq +++ b/src/builtins/string-html.tq @@ -22,14 +22,15 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.anchor transitioning javascript builtin StringPrototypeAnchor( - js-implicit context: Context, receiver: JSAny)(...arguments): String { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): String { return CreateHTML( receiver, 'String.prototype.anchor', 'a', 'name', arguments[0]); } // https://tc39.github.io/ecma262/#sec-string.prototype.big transitioning javascript builtin - StringPrototypeBig(js-implicit context: Context, receiver: JSAny)( + StringPrototypeBig(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): String { return CreateHTML( receiver, 'String.prototype.big', 'big', kEmptyString, kEmptyString); @@ -37,7 +38,7 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.blink transitioning javascript builtin - StringPrototypeBlink(js-implicit context: Context, receiver: JSAny)( + StringPrototypeBlink(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): String { return CreateHTML( receiver, 'String.prototype.blink', 'blink', kEmptyString, @@ -46,7 +47,7 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.bold transitioning javascript builtin - StringPrototypeBold(js-implicit context: Context, receiver: JSAny)( + StringPrototypeBold(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): String { return CreateHTML( receiver, 'String.prototype.bold', 'b', kEmptyString, kEmptyString); @@ -54,7 +55,7 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.fontcolor transitioning javascript builtin - StringPrototypeFontcolor(js-implicit context: Context, receiver: JSAny)( + StringPrototypeFontcolor(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): String { return CreateHTML( receiver, 'String.prototype.fontcolor', 'font', 'color', arguments[0]); @@ -62,7 +63,7 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.fontsize transitioning javascript builtin - StringPrototypeFontsize(js-implicit context: Context, receiver: JSAny)( + StringPrototypeFontsize(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): String { return CreateHTML( receiver, 'String.prototype.fontsize', 'font', 'size', arguments[0]); @@ -70,7 +71,7 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.fixed transitioning javascript builtin - StringPrototypeFixed(js-implicit context: Context, receiver: JSAny)( + StringPrototypeFixed(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): String { return CreateHTML( receiver, 'String.prototype.fixed', 'tt', kEmptyString, kEmptyString); @@ -78,7 +79,7 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.italics transitioning javascript builtin - StringPrototypeItalics(js-implicit context: Context, receiver: JSAny)( + StringPrototypeItalics(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): String { return CreateHTML( receiver, 'String.prototype.italics', 'i', kEmptyString, kEmptyString); @@ -86,7 +87,7 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.link transitioning javascript builtin - StringPrototypeLink(js-implicit context: Context, receiver: JSAny)( + StringPrototypeLink(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): String { return CreateHTML( receiver, 'String.prototype.link', 'a', 'href', arguments[0]); @@ -94,7 +95,7 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.small transitioning javascript builtin - StringPrototypeSmall(js-implicit context: Context, receiver: JSAny)( + StringPrototypeSmall(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): String { return CreateHTML( receiver, 'String.prototype.small', 'small', kEmptyString, @@ -103,7 +104,7 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.strike transitioning javascript builtin - StringPrototypeStrike(js-implicit context: Context, receiver: JSAny)( + StringPrototypeStrike(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): String { return CreateHTML( receiver, 'String.prototype.strike', 'strike', kEmptyString, @@ -112,7 +113,7 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.sub transitioning javascript builtin - StringPrototypeSub(js-implicit context: Context, receiver: JSAny)( + StringPrototypeSub(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): String { return CreateHTML( receiver, 'String.prototype.sub', 'sub', kEmptyString, kEmptyString); @@ -120,7 +121,7 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.sup transitioning javascript builtin - StringPrototypeSup(js-implicit context: Context, receiver: JSAny)( + StringPrototypeSup(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): String { return CreateHTML( receiver, 'String.prototype.sup', 'sup', kEmptyString, kEmptyString); diff --git a/src/builtins/string-iterator.tq b/src/builtins/string-iterator.tq index 34667cdc67..6a390d4336 100644 --- a/src/builtins/string-iterator.tq +++ b/src/builtins/string-iterator.tq @@ -17,7 +17,7 @@ namespace string { // ES6 #sec-string.prototype-@@iterator transitioning javascript builtin StringPrototypeIterator( - js-implicit context: Context, receiver: JSAny)(): JSStringIterator { + js-implicit context: NativeContext, receiver: JSAny)(): JSStringIterator { const name: String = ToThisString(receiver, 'String.prototype[Symbol.iterator]'); const index: Smi = 0; @@ -26,7 +26,7 @@ namespace string { // ES6 #sec-%stringiteratorprototype%.next transitioning javascript builtin StringIteratorPrototypeNext( - js-implicit context: Context, receiver: JSAny)(): JSObject { + js-implicit context: NativeContext, receiver: JSAny)(): JSObject { const iterator = Cast(receiver) otherwise ThrowTypeError( kIncompatibleMethodReceiver, 'String Iterator.prototype.next', receiver); diff --git a/src/builtins/string-pad.tq b/src/builtins/string-pad.tq index 2ab4980d66..4a4c370406 100644 --- a/src/builtins/string-pad.tq +++ b/src/builtins/string-pad.tq @@ -95,7 +95,7 @@ namespace string { // ES6 #sec-string.prototype.padstart transitioning javascript builtin - StringPrototypePadStart(js-implicit context: Context, receiver: JSAny)( + StringPrototypePadStart(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): String { const methodName: constexpr string = 'String.prototype.padStart'; return StringPad(receiver, arguments, methodName, kStringPadStart); @@ -103,7 +103,7 @@ namespace string { // ES6 #sec-string.prototype.padend transitioning javascript builtin - StringPrototypePadEnd(js-implicit context: Context, receiver: JSAny)( + StringPrototypePadEnd(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): String { const methodName: constexpr string = 'String.prototype.padEnd'; return StringPad(receiver, arguments, methodName, kStringPadEnd); diff --git a/src/builtins/string-repeat.tq b/src/builtins/string-repeat.tq index 1d1504ce1f..a5c51b90ff 100644 --- a/src/builtins/string-repeat.tq +++ b/src/builtins/string-repeat.tq @@ -28,7 +28,8 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.repeat transitioning javascript builtin StringPrototypeRepeat( - js-implicit context: Context, receiver: JSAny)(count: JSAny): String { + js-implicit context: NativeContext, + receiver: JSAny)(count: JSAny): String { // 1. Let O be ? RequireObjectCoercible(this value). // 2. Let S be ? ToString(O). const s: String = ToThisString(receiver, kBuiltinName); diff --git a/src/builtins/string-replaceall.tq b/src/builtins/string-replaceall.tq index 0ac9e703b7..d3568adddd 100644 --- a/src/builtins/string-replaceall.tq +++ b/src/builtins/string-replaceall.tq @@ -87,7 +87,7 @@ namespace string { // https://tc39.es/ecma262/#sec-string.prototype.replaceall transitioning javascript builtin StringPrototypeReplaceAll( - js-implicit context: Context, + js-implicit context: NativeContext, receiver: JSAny)(searchValue: JSAny, replaceValue: JSAny): JSAny { // 1. Let O be ? RequireObjectCoercible(this value). RequireObjectCoercible(receiver, 'String.prototype.replaceAll'); diff --git a/src/builtins/string-slice.tq b/src/builtins/string-slice.tq index 0961fb06c9..ea95d44a82 100644 --- a/src/builtins/string-slice.tq +++ b/src/builtins/string-slice.tq @@ -6,7 +6,8 @@ namespace string { // ES6 #sec-string.prototype.slice ( start, end ) // https://tc39.github.io/ecma262/#sec-string.prototype.slice transitioning javascript builtin StringPrototypeSlice( - js-implicit context: Context, receiver: JSAny)(...arguments): String { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): String { // 1. Let O be ? RequireObjectCoercible(this value). // 2. Let S be ? ToString(O). const string: String = ToThisString(receiver, 'String.prototype.slice'); diff --git a/src/builtins/string-startswith.tq b/src/builtins/string-startswith.tq index 4ec709fe21..bb7cac36db 100644 --- a/src/builtins/string-startswith.tq +++ b/src/builtins/string-startswith.tq @@ -7,7 +7,8 @@ namespace string { // https://tc39.github.io/ecma262/#sec-string.prototype.startswith transitioning javascript builtin StringPrototypeStartsWith( - js-implicit context: Context, receiver: JSAny)(...arguments): Boolean { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): Boolean { const searchString: JSAny = arguments[0]; const position: JSAny = arguments[1]; const kBuiltinName: constexpr string = 'String.prototype.startsWith'; diff --git a/src/builtins/string-substr.tq b/src/builtins/string-substr.tq index a5f393a6a8..917bee691e 100644 --- a/src/builtins/string-substr.tq +++ b/src/builtins/string-substr.tq @@ -7,7 +7,8 @@ namespace string { // String.prototype.substr ( start, length ) // ES6 #sec-string.prototype.substr transitioning javascript builtin StringPrototypeSubstr( - js-implicit context: Context, receiver: JSAny)(...arguments): String { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): String { const methodName: constexpr string = 'String.prototype.substr'; // 1. Let O be ? RequireObjectCoercible(this value). // 2. Let S be ? ToString(O). diff --git a/src/builtins/string-substring.tq b/src/builtins/string-substring.tq index 992f7328bb..e4e7d70000 100644 --- a/src/builtins/string-substring.tq +++ b/src/builtins/string-substring.tq @@ -6,7 +6,8 @@ namespace string { // ES6 #sec-string.prototype.substring transitioning javascript builtin StringPrototypeSubstring( - js-implicit context: Context, receiver: JSAny)(...arguments): String { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): String { // Check that {receiver} is coercible to Object and convert it to a String. const string: String = ToThisString(receiver, 'String.prototype.substring'); const length: uintptr = string.length_uintptr; diff --git a/src/builtins/symbol.tq b/src/builtins/symbol.tq index 7f7f5f3eff..470b9516cd 100644 --- a/src/builtins/symbol.tq +++ b/src/builtins/symbol.tq @@ -13,7 +13,7 @@ namespace symbol { // ES #sec-symbol.prototype.description transitioning javascript builtin SymbolPrototypeDescriptionGetter( - js-implicit context: Context, receiver: JSAny)(): String|Undefined { + js-implicit context: NativeContext, receiver: JSAny)(): String|Undefined { // 1. Let s be the this value. // 2. Let sym be ? thisSymbolValue(s). const sym: Symbol = @@ -24,14 +24,15 @@ namespace symbol { // ES6 #sec-symbol.prototype-@@toprimitive transitioning javascript builtin SymbolPrototypeToPrimitive( - js-implicit context: Context, receiver: JSAny)(_hint: JSAny): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(_hint: JSAny): JSAny { // 1. Return ? thisSymbolValue(this value). return ThisSymbolValue(receiver, 'Symbol.prototype [ @@toPrimitive ]'); } // ES6 #sec-symbol.prototype.tostring transitioning javascript builtin SymbolPrototypeToString( - js-implicit context: Context, receiver: JSAny)(): JSAny { + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { // 1. Let sym be ? thisSymbolValue(this value). const sym: Symbol = ThisSymbolValue(receiver, 'Symbol.prototype.toString'); // 2. Return SymbolDescriptiveString(sym). @@ -40,7 +41,7 @@ namespace symbol { // ES6 #sec-symbol.prototype.valueof transitioning javascript builtin SymbolPrototypeValueOf( - js-implicit context: Context, receiver: JSAny)(): JSAny { + js-implicit context: NativeContext, receiver: JSAny)(): JSAny { // 1. Return ? thisSymbolValue(this value). return ThisSymbolValue(receiver, 'Symbol.prototype.valueOf'); } diff --git a/src/builtins/typed-array-every.tq b/src/builtins/typed-array-every.tq index 83aa361d2c..5bf53e9f0a 100644 --- a/src/builtins/typed-array-every.tq +++ b/src/builtins/typed-array-every.tq @@ -30,7 +30,7 @@ namespace typed_array { // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.every transitioning javascript builtin - TypedArrayPrototypeEvery(js-implicit context: Context, receiver: JSAny)( + TypedArrayPrototypeEvery(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): JSAny { // arguments[0] = callback // arguments[1] = thisArg diff --git a/src/builtins/typed-array-filter.tq b/src/builtins/typed-array-filter.tq index a37ce7b7ff..3a28b8b13b 100644 --- a/src/builtins/typed-array-filter.tq +++ b/src/builtins/typed-array-filter.tq @@ -7,7 +7,8 @@ namespace typed_array { // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.filter transitioning javascript builtin TypedArrayPrototypeFilter( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { // arguments[0] = callback // arguments[1] = thisArg try { diff --git a/src/builtins/typed-array-find.tq b/src/builtins/typed-array-find.tq index 492366f10f..4888b0af0e 100644 --- a/src/builtins/typed-array-find.tq +++ b/src/builtins/typed-array-find.tq @@ -30,7 +30,7 @@ namespace typed_array { // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.find transitioning javascript builtin - TypedArrayPrototypeFind(js-implicit context: Context, receiver: JSAny)( + TypedArrayPrototypeFind(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): JSAny { // arguments[0] = callback // arguments[1] = thisArg diff --git a/src/builtins/typed-array-findindex.tq b/src/builtins/typed-array-findindex.tq index 4bcdbf3b28..4534fa15d3 100644 --- a/src/builtins/typed-array-findindex.tq +++ b/src/builtins/typed-array-findindex.tq @@ -32,8 +32,9 @@ namespace typed_array { // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.findIndex transitioning javascript builtin - TypedArrayPrototypeFindIndex(js-implicit context: Context, receiver: JSAny)( - ...arguments): JSAny { + TypedArrayPrototypeFindIndex( + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { // arguments[0] = callback // arguments[1] = thisArg. try { diff --git a/src/builtins/typed-array-foreach.tq b/src/builtins/typed-array-foreach.tq index 2c8587862b..4b532d381f 100644 --- a/src/builtins/typed-array-foreach.tq +++ b/src/builtins/typed-array-foreach.tq @@ -28,8 +28,9 @@ namespace typed_array { // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.every transitioning javascript builtin - TypedArrayPrototypeForEach(js-implicit context: Context, receiver: JSAny)( - ...arguments): Undefined { + TypedArrayPrototypeForEach( + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): Undefined { // arguments[0] = callback // arguments[1] = this_arg. diff --git a/src/builtins/typed-array-from.tq b/src/builtins/typed-array-from.tq index 4f1fb07d69..17b8443243 100644 --- a/src/builtins/typed-array-from.tq +++ b/src/builtins/typed-array-from.tq @@ -17,8 +17,8 @@ namespace typed_array { // %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) // https://tc39.github.io/ecma262/#sec-%typedarray%.from transitioning javascript builtin - TypedArrayFrom(js-implicit context: Context, receiver: JSAny)(...arguments): - JSTypedArray { + TypedArrayFrom(js-implicit context: NativeContext, receiver: JSAny)( + ...arguments): JSTypedArray { try { const source: JSAny = arguments[0]; diff --git a/src/builtins/typed-array-of.tq b/src/builtins/typed-array-of.tq index 9461977a43..466d45cdf8 100644 --- a/src/builtins/typed-array-of.tq +++ b/src/builtins/typed-array-of.tq @@ -10,8 +10,8 @@ namespace typed_array { // %TypedArray%.of ( ...items ) // https://tc39.github.io/ecma262/#sec-%typedarray%.of transitioning javascript builtin - TypedArrayOf(js-implicit context: Context, receiver: JSAny)(...arguments): - JSTypedArray { + TypedArrayOf(js-implicit context: NativeContext, receiver: JSAny)( + ...arguments): JSTypedArray { try { // 1. Let len be the actual number of arguments passed to this function. const len: uintptr = Unsigned(arguments.length); diff --git a/src/builtins/typed-array-reduce.tq b/src/builtins/typed-array-reduce.tq index a0fad9f7e1..ef67d6ff1d 100644 --- a/src/builtins/typed-array-reduce.tq +++ b/src/builtins/typed-array-reduce.tq @@ -42,8 +42,9 @@ namespace typed_array { // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduce transitioning javascript builtin - TypedArrayPrototypeReduce(js-implicit context: Context, receiver: JSAny)( - ...arguments): JSAny { + TypedArrayPrototypeReduce( + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { // arguments[0] = callback // arguments[1] = initialValue. try { diff --git a/src/builtins/typed-array-reduceright.tq b/src/builtins/typed-array-reduceright.tq index c2a4e817fd..65197c24ea 100644 --- a/src/builtins/typed-array-reduceright.tq +++ b/src/builtins/typed-array-reduceright.tq @@ -43,8 +43,9 @@ namespace typed_array { // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.reduceright transitioning javascript builtin - TypedArrayPrototypeReduceRight(js-implicit context: Context, receiver: JSAny)( - ...arguments): JSAny { + TypedArrayPrototypeReduceRight( + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { // arguments[0] = callback // arguments[1] = initialValue. try { diff --git a/src/builtins/typed-array-set.tq b/src/builtins/typed-array-set.tq index ebcb340fe8..d65b62689d 100644 --- a/src/builtins/typed-array-set.tq +++ b/src/builtins/typed-array-set.tq @@ -30,7 +30,7 @@ namespace typed_array { // %TypedArray%.prototype.set ( overloaded [ , offset ] ) // https://tc39.es/ecma262/#sec-%typedarray%.prototype.set-overloaded-offset transitioning javascript builtin - TypedArrayPrototypeSet(js-implicit context: Context, receiver: JSAny)( + TypedArrayPrototypeSet(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): JSAny { // Steps 2-8 are the same for // %TypedArray%.prototype.set ( array [ , offset ] ) and diff --git a/src/builtins/typed-array-slice.tq b/src/builtins/typed-array-slice.tq index a3e992752b..2766522882 100644 --- a/src/builtins/typed-array-slice.tq +++ b/src/builtins/typed-array-slice.tq @@ -52,7 +52,8 @@ namespace typed_array { // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.slice transitioning javascript builtin TypedArrayPrototypeSlice( - js-implicit context: Context, receiver: JSAny)(...arguments): JSAny { + js-implicit context: NativeContext, + receiver: JSAny)(...arguments): JSAny { // arguments[0] = start // arguments[1] = end diff --git a/src/builtins/typed-array-some.tq b/src/builtins/typed-array-some.tq index 26a805e3a0..1dead9b937 100644 --- a/src/builtins/typed-array-some.tq +++ b/src/builtins/typed-array-some.tq @@ -30,7 +30,7 @@ namespace typed_array { // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some transitioning javascript builtin - TypedArrayPrototypeSome(js-implicit context: Context, receiver: JSAny)( + TypedArrayPrototypeSome(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): JSAny { // arguments[0] = callback // arguments[1] = thisArg. diff --git a/src/builtins/typed-array-sort.tq b/src/builtins/typed-array-sort.tq index 7b570f9977..7d9a680f75 100644 --- a/src/builtins/typed-array-sort.tq +++ b/src/builtins/typed-array-sort.tq @@ -87,7 +87,7 @@ namespace typed_array { // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.sort transitioning javascript builtin TypedArrayPrototypeSort( - js-implicit context: Context, + js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSTypedArray { // 1. If comparefn is not undefined and IsCallable(comparefn) is false, // throw a TypeError exception. diff --git a/src/builtins/typed-array-subarray.tq b/src/builtins/typed-array-subarray.tq index 03433f0136..6283319e59 100644 --- a/src/builtins/typed-array-subarray.tq +++ b/src/builtins/typed-array-subarray.tq @@ -5,7 +5,7 @@ namespace typed_array { // ES %TypedArray%.prototype.subarray transitioning javascript builtin TypedArrayPrototypeSubArray( - js-implicit context: Context, + js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSTypedArray { const methodName: constexpr string = '%TypedArray%.prototype.subarray'; diff --git a/src/torque/constants.h b/src/torque/constants.h index 9e73244d58..7b32d01373 100644 --- a/src/torque/constants.h +++ b/src/torque/constants.h @@ -24,6 +24,7 @@ static const char* const BOOL_TYPE_STRING = "bool"; static const char* const VOID_TYPE_STRING = "void"; static const char* const ARGUMENTS_TYPE_STRING = "Arguments"; static const char* const CONTEXT_TYPE_STRING = "Context"; +static const char* const NATIVE_CONTEXT_TYPE_STRING = "NativeContext"; static const char* const JS_FUNCTION_TYPE_STRING = "JSFunction"; static const char* const MAP_TYPE_STRING = "Map"; static const char* const OBJECT_TYPE_STRING = "Object"; diff --git a/src/torque/implementation-visitor.cc b/src/torque/implementation-visitor.cc index 61803108b3..b202f10f0c 100644 --- a/src/torque/implementation-visitor.cc +++ b/src/torque/implementation-visitor.cc @@ -455,11 +455,11 @@ void ImplementationVisitor::Visit(Builtin* builtin) { const Type* actual_type = signature.parameter_types.types[i]; const Type* expected_type; if (param_name == "context") { - source_out() << " TNode " << generated_name - << " = UncheckedCast(Parameter(" + source_out() << " TNode " << generated_name + << " = UncheckedCast(Parameter(" << "Descriptor::kContext));\n"; source_out() << " USE(" << generated_name << ");\n"; - expected_type = TypeOracle::GetContextType(); + expected_type = TypeOracle::GetNativeContextType(); } else if (param_name == "receiver") { source_out() << " TNode " << generated_name << " = " diff --git a/src/torque/type-oracle.h b/src/torque/type-oracle.h index 6740cc3adb..b186b0ef63 100644 --- a/src/torque/type-oracle.h +++ b/src/torque/type-oracle.h @@ -253,6 +253,10 @@ class TypeOracle : public ContextualClass { return Get().GetBuiltinType(CONTEXT_TYPE_STRING); } + static const Type* GetNativeContextType() { + return Get().GetBuiltinType(NATIVE_CONTEXT_TYPE_STRING); + } + static const Type* GetJSFunctionType() { return Get().GetBuiltinType(JS_FUNCTION_TYPE_STRING); } diff --git a/third_party/v8/builtins/array-sort.tq b/third_party/v8/builtins/array-sort.tq index e98bae7afc..2c3b1866a5 100644 --- a/third_party/v8/builtins/array-sort.tq +++ b/third_party/v8/builtins/array-sort.tq @@ -1388,7 +1388,7 @@ namespace array { // https://tc39.github.io/ecma262/#sec-array.prototype.sort transitioning javascript builtin - ArrayPrototypeSort(js-implicit context: Context, receiver: JSAny)( + ArrayPrototypeSort(js-implicit context: NativeContext, receiver: JSAny)( ...arguments): JSAny { // 1. If comparefn is not undefined and IsCallable(comparefn) is false, // throw a TypeError exception.