Commit e34c42db authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[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/+/1926150Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65068}
parent ec46cef0
......@@ -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);
......
// 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;
......
This diff is collapsed.
This diff is collapsed.
......@@ -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);
}
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment