[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 <mvstanton@chromium.org> Commit-Queue: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#65068}
This commit is contained in:
parent
ec46cef0ee
commit
e34c42db27
@ -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);
|
||||
|
||||
|
@ -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');
|
||||
|
@ -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');
|
||||
|
||||
|
@ -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');
|
||||
|
@ -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');
|
||||
|
@ -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');
|
||||
|
||||
|
@ -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): {
|
||||
|
@ -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];
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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');
|
||||
|
||||
|
@ -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<Smi>(arguments.length);
|
||||
|
||||
|
@ -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');
|
||||
|
||||
|
@ -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');
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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<NativeContext>(context), o, k, count)
|
||||
return HandleFastSlice(context, o, k, count)
|
||||
otherwise Slow;
|
||||
}
|
||||
label Slow {}
|
||||
|
@ -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');
|
||||
|
@ -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);
|
||||
|
@ -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<FastJSArray>(receiver) otherwise Slow;
|
||||
array::EnsureWriteableFastElements(array);
|
||||
|
@ -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'
|
||||
|
@ -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');
|
||||
}
|
||||
|
@ -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<intptr>(arguments.length);
|
||||
let s: String;
|
||||
|
@ -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;
|
||||
|
@ -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 =
|
||||
|
@ -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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(y));
|
||||
const xValue = Convert<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<int32>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float32>(ToNumber_Inline(x));
|
||||
const x64 = Convert<float64>(x32);
|
||||
return Convert<Number>(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<int32>(ToNumber_Inline(x));
|
||||
const y = Convert<int32>(ToNumber_Inline(y));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<float64>(ToNumber_Inline(x));
|
||||
return Convert<Number>(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<Smi>(nativeContext[MATH_RANDOM_INDEX_INDEX])
|
||||
MathRandom(js-implicit context: NativeContext, receiver: JSAny)(): Number {
|
||||
let smiIndex: Smi = Cast<Smi>(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<FixedDoubleArray>(nativeContext[MATH_RANDOM_CACHE_INDEX])
|
||||
Cast<FixedDoubleArray>(context[MATH_RANDOM_CACHE_INDEX])
|
||||
otherwise unreachable;
|
||||
const random: float64 = array.floats[Convert<intptr>(newSmiIndex)];
|
||||
return AllocateHeapNumberWithValue(random);
|
||||
|
@ -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');
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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');
|
||||
|
||||
|
@ -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<JSPromise>(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<JSPromise>(context[kPromiseBuiltinsPromiseSlot]);
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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<JSReceiver>(target) otherwise ThrowProxyNonObject;
|
||||
|
@ -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];
|
||||
|
||||
|
@ -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<JSReceiver>(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<JSReceiver>(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<JSReceiver>(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<JSReceiver>(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<JSReceiver>(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<JSReceiver>(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<JSReceiver>(object)
|
||||
otherwise ThrowTypeError(kCalledOnNonObject, 'Reflect.has');
|
||||
return HasProperty(objectJSReceiver, key);
|
||||
|
@ -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<JSRegExp>(receiver) otherwise ThrowTypeError(
|
||||
kIncompatibleMethodReceiver, 'RegExp.prototype.exec', receiver);
|
||||
|
@ -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
|
||||
|
@ -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<JSReceiver>(receiver);
|
||||
|
@ -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:
|
||||
|
@ -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<JSReceiver>(receiver);
|
||||
|
@ -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;
|
||||
|
@ -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<JSReceiver>(receiver);
|
||||
|
@ -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<JSReceiver>(receiver)
|
||||
otherwise ThrowTypeError(kIncompatibleMethodReceiver, methodName);
|
||||
|
@ -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
|
||||
|
@ -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';
|
||||
|
@ -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);
|
||||
|
@ -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<JSStringIterator>(receiver) otherwise ThrowTypeError(
|
||||
kIncompatibleMethodReceiver, 'String Iterator.prototype.next',
|
||||
receiver);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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');
|
||||
|
@ -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');
|
||||
|
@ -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';
|
||||
|
@ -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).
|
||||
|
@ -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;
|
||||
|
@ -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');
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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];
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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";
|
||||
|
@ -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<Context> " << generated_name
|
||||
<< " = UncheckedCast<Context>(Parameter("
|
||||
source_out() << " TNode<NativeContext> " << generated_name
|
||||
<< " = UncheckedCast<NativeContext>(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<Object> " << generated_name << " = "
|
||||
|
@ -253,6 +253,10 @@ class TypeOracle : public ContextualClass<TypeOracle> {
|
||||
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);
|
||||
}
|
||||
|
2
third_party/v8/builtins/array-sort.tq
vendored
2
third_party/v8/builtins/array-sort.tq
vendored
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user