Commit 3d3dafee authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[builtins] Define interface descriptors for builtins with JSFunction linkage.

Second bulk of changes.

BUG=v8:6116

Change-Id: I6297c4e3e1c0230a96dc6197691a54c07cc61c88
Reviewed-on: https://chromium-review.googlesource.com/457320
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43995}
parent 9dfa4639
......@@ -171,6 +171,8 @@ class ArrayBuiltinCodeStubAssembler : public CodeStubAssembler {
protected:
Node* context() { return context_; }
Node* receiver() { return receiver_; }
Node* new_target() { return new_target_; }
Node* o() { return o_; }
Node* len() { return len_; }
Node* callbackfn() { return callbackfn_; }
......@@ -178,37 +180,39 @@ class ArrayBuiltinCodeStubAssembler : public CodeStubAssembler {
Node* k() { return k_.value(); }
Node* a() { return a_.value(); }
void GenerateIteratingArrayBuiltinBody(
const char* name, const BuiltinResultGenerator& generator,
const CallResultProcessor& processor, const PostLoopAction& action,
const Callable& slow_case_continuation) {
// TODO(ishell): use constants from Descriptor once the JSFunction linkage
// arguments are reordered.
Node* receiver = Parameter(IteratingArrayBuiltinDescriptor::kReceiver);
callbackfn_ = Parameter(IteratingArrayBuiltinDescriptor::kCallback);
this_arg_ = Parameter(IteratingArrayBuiltinDescriptor::kThisArg);
context_ = Parameter(IteratingArrayBuiltinDescriptor::kContext);
Node* new_target = Parameter(IteratingArrayBuiltinDescriptor::kNewTarget);
void InitIteratingArrayBuiltinBody(Node* context, Node* receiver,
Node* callbackfn, Node* this_arg,
Node* new_target) {
context_ = context;
receiver_ = receiver;
new_target_ = new_target;
callbackfn_ = callbackfn;
this_arg_ = this_arg;
k_.Bind(SmiConstant(0));
a_.Bind(UndefinedConstant());
}
void GenerateIteratingArrayBuiltinBody(
const char* name, const BuiltinResultGenerator& generator,
const CallResultProcessor& processor, const PostLoopAction& action,
const Callable& slow_case_continuation) {
Label non_array(this), slow(this, {&k_, &a_, &to_}),
array_changes(this, {&k_, &a_, &to_});
// TODO(danno): Seriously? Do we really need to throw the exact error
// message on null and undefined so that the webkit tests pass?
Label throw_null_undefined_exception(this, Label::kDeferred);
GotoIf(WordEqual(receiver, NullConstant()),
GotoIf(WordEqual(receiver(), NullConstant()),
&throw_null_undefined_exception);
GotoIf(WordEqual(receiver, UndefinedConstant()),
GotoIf(WordEqual(receiver(), UndefinedConstant()),
&throw_null_undefined_exception);
// By the book: taken directly from the ECMAScript 2015 specification
// 1. Let O be ToObject(this value).
// 2. ReturnIfAbrupt(O)
o_ = CallStub(CodeFactory::ToObject(isolate()), context(), receiver);
o_ = CallStub(CodeFactory::ToObject(isolate()), context(), receiver());
// 3. Let len be ToLength(Get(O, "length")).
// 4. ReturnIfAbrupt(len).
......@@ -266,28 +270,29 @@ class ArrayBuiltinCodeStubAssembler : public CodeStubAssembler {
Node* target = LoadFromFrame(StandardFrameConstants::kFunctionOffset,
MachineType::TaggedPointer());
TailCallStub(
slow_case_continuation, context(), target, new_target,
slow_case_continuation, context(), target, new_target(),
Int32Constant(IteratingArrayBuiltinLoopContinuationDescriptor::kArity),
receiver, callbackfn(), this_arg(), a_.value(), o(), k_.value(), len_);
receiver(), callbackfn(), this_arg(), a_.value(), o(), k_.value(),
len());
}
void InitIteratingArrayBuiltinLoopContinuation(Node* context, Node* receiver,
Node* callbackfn,
Node* this_arg, Node* a,
Node* o, Node* initial_k,
Node* len) {
context_ = context;
this_arg_ = this_arg;
callbackfn_ = callbackfn;
a_.Bind(a);
k_.Bind(initial_k);
o_ = o;
len_ = len;
}
void GenerateIteratingArrayBuiltinLoopContinuation(
const BuiltinResultIndexInitializer& index_initializer,
const CallResultProcessor& processor, const PostLoopAction& action) {
// TODO(ishell): use constants from Descriptor once the JSFunction linkage
// arguments are reordered.
this_arg_ =
Parameter(IteratingArrayBuiltinLoopContinuationDescriptor::kThisArg);
callbackfn_ =
Parameter(IteratingArrayBuiltinLoopContinuationDescriptor::kCallback);
a_.Bind(Parameter(IteratingArrayBuiltinLoopContinuationDescriptor::kArray));
k_.Bind(
Parameter(IteratingArrayBuiltinLoopContinuationDescriptor::kInitialK));
o_ = Parameter(IteratingArrayBuiltinLoopContinuationDescriptor::kObject);
len_ = Parameter(IteratingArrayBuiltinLoopContinuationDescriptor::kLength);
context_ =
Parameter(IteratingArrayBuiltinLoopContinuationDescriptor::kContext);
index_initializer(this);
// 8. Repeat, while k < len
......@@ -436,11 +441,13 @@ class ArrayBuiltinCodeStubAssembler : public CodeStubAssembler {
}
}
Node* callbackfn_;
Node* o_;
Node* this_arg_;
Node* len_;
Node* context_;
Node* callbackfn_ = nullptr;
Node* o_ = nullptr;
Node* this_arg_ = nullptr;
Node* len_ = nullptr;
Node* context_ = nullptr;
Node* receiver_ = nullptr;
Node* new_target_ = nullptr;
Variable k_;
Variable a_;
Variable to_;
......@@ -603,6 +610,18 @@ TF_BUILTIN(FastArrayPush, CodeStubAssembler) {
}
TF_BUILTIN(ArrayForEachLoopContinuation, ArrayBuiltinCodeStubAssembler) {
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* callbackfn = Parameter(Descriptor::kCallbackFn);
Node* this_arg = Parameter(Descriptor::kThisArg);
Node* array = Parameter(Descriptor::kArray);
Node* object = Parameter(Descriptor::kObject);
Node* initial_k = Parameter(Descriptor::kInitialK);
Node* len = Parameter(Descriptor::kLength);
InitIteratingArrayBuiltinLoopContinuation(
context, receiver, callbackfn, this_arg, array, object, initial_k, len);
GenerateIteratingArrayBuiltinLoopContinuation(
&ArrayBuiltinCodeStubAssembler::NullResultIndexReinitializer,
&ArrayBuiltinCodeStubAssembler::ForEachProcessor,
......@@ -610,6 +629,15 @@ TF_BUILTIN(ArrayForEachLoopContinuation, ArrayBuiltinCodeStubAssembler) {
}
TF_BUILTIN(ArrayForEach, ArrayBuiltinCodeStubAssembler) {
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* callbackfn = Parameter(Descriptor::kCallbackFn);
Node* this_arg = Parameter(Descriptor::kThisArg);
Node* new_target = Parameter(Descriptor::kNewTarget);
InitIteratingArrayBuiltinBody(context, receiver, callbackfn, this_arg,
new_target);
GenerateIteratingArrayBuiltinBody(
"Array.prototype.forEach",
&ArrayBuiltinCodeStubAssembler::ForEachResultGenerator,
......@@ -619,6 +647,18 @@ TF_BUILTIN(ArrayForEach, ArrayBuiltinCodeStubAssembler) {
}
TF_BUILTIN(ArraySomeLoopContinuation, ArrayBuiltinCodeStubAssembler) {
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* callbackfn = Parameter(Descriptor::kCallbackFn);
Node* this_arg = Parameter(Descriptor::kThisArg);
Node* array = Parameter(Descriptor::kArray);
Node* object = Parameter(Descriptor::kObject);
Node* initial_k = Parameter(Descriptor::kInitialK);
Node* len = Parameter(Descriptor::kLength);
InitIteratingArrayBuiltinLoopContinuation(
context, receiver, callbackfn, this_arg, array, object, initial_k, len);
GenerateIteratingArrayBuiltinLoopContinuation(
&ArrayBuiltinCodeStubAssembler::NullResultIndexReinitializer,
&ArrayBuiltinCodeStubAssembler::SomeProcessor,
......@@ -626,6 +666,15 @@ TF_BUILTIN(ArraySomeLoopContinuation, ArrayBuiltinCodeStubAssembler) {
}
TF_BUILTIN(ArraySome, ArrayBuiltinCodeStubAssembler) {
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* callbackfn = Parameter(Descriptor::kCallbackFn);
Node* this_arg = Parameter(Descriptor::kThisArg);
Node* new_target = Parameter(Descriptor::kNewTarget);
InitIteratingArrayBuiltinBody(context, receiver, callbackfn, this_arg,
new_target);
GenerateIteratingArrayBuiltinBody(
"Array.prototype.some",
&ArrayBuiltinCodeStubAssembler::SomeResultGenerator,
......@@ -635,6 +684,18 @@ TF_BUILTIN(ArraySome, ArrayBuiltinCodeStubAssembler) {
}
TF_BUILTIN(ArrayEveryLoopContinuation, ArrayBuiltinCodeStubAssembler) {
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* callbackfn = Parameter(Descriptor::kCallbackFn);
Node* this_arg = Parameter(Descriptor::kThisArg);
Node* array = Parameter(Descriptor::kArray);
Node* object = Parameter(Descriptor::kObject);
Node* initial_k = Parameter(Descriptor::kInitialK);
Node* len = Parameter(Descriptor::kLength);
InitIteratingArrayBuiltinLoopContinuation(
context, receiver, callbackfn, this_arg, array, object, initial_k, len);
GenerateIteratingArrayBuiltinLoopContinuation(
&ArrayBuiltinCodeStubAssembler::NullResultIndexReinitializer,
&ArrayBuiltinCodeStubAssembler::EveryProcessor,
......@@ -642,6 +703,15 @@ TF_BUILTIN(ArrayEveryLoopContinuation, ArrayBuiltinCodeStubAssembler) {
}
TF_BUILTIN(ArrayEvery, ArrayBuiltinCodeStubAssembler) {
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* callbackfn = Parameter(Descriptor::kCallbackFn);
Node* this_arg = Parameter(Descriptor::kThisArg);
Node* new_target = Parameter(Descriptor::kNewTarget);
InitIteratingArrayBuiltinBody(context, receiver, callbackfn, this_arg,
new_target);
GenerateIteratingArrayBuiltinBody(
"Array.prototype.every",
&ArrayBuiltinCodeStubAssembler::EveryResultGenerator,
......@@ -651,6 +721,19 @@ TF_BUILTIN(ArrayEvery, ArrayBuiltinCodeStubAssembler) {
}
TF_BUILTIN(ArrayReduceLoopContinuation, ArrayBuiltinCodeStubAssembler) {
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* callbackfn = Parameter(Descriptor::kCallbackFn);
Node* this_arg = Parameter(Descriptor::kThisArg);
Node* accumulator = Parameter(Descriptor::kAccumulator);
Node* object = Parameter(Descriptor::kObject);
Node* initial_k = Parameter(Descriptor::kInitialK);
Node* len = Parameter(Descriptor::kLength);
InitIteratingArrayBuiltinLoopContinuation(context, receiver, callbackfn,
this_arg, accumulator, object,
initial_k, len);
GenerateIteratingArrayBuiltinLoopContinuation(
&ArrayBuiltinCodeStubAssembler::NullResultIndexReinitializer,
&ArrayBuiltinCodeStubAssembler::ReduceProcessor,
......@@ -658,6 +741,15 @@ TF_BUILTIN(ArrayReduceLoopContinuation, ArrayBuiltinCodeStubAssembler) {
}
TF_BUILTIN(ArrayReduce, ArrayBuiltinCodeStubAssembler) {
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* callbackfn = Parameter(Descriptor::kCallbackFn);
Node* initial_value = Parameter(Descriptor::kInitialValue);
Node* new_target = Parameter(Descriptor::kNewTarget);
InitIteratingArrayBuiltinBody(context, receiver, callbackfn, initial_value,
new_target);
GenerateIteratingArrayBuiltinBody(
"Array.prototype.reduce",
&ArrayBuiltinCodeStubAssembler::ReduceResultGenerator,
......@@ -667,6 +759,18 @@ TF_BUILTIN(ArrayReduce, ArrayBuiltinCodeStubAssembler) {
}
TF_BUILTIN(ArrayFilterLoopContinuation, ArrayBuiltinCodeStubAssembler) {
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* callbackfn = Parameter(Descriptor::kCallbackFn);
Node* this_arg = Parameter(Descriptor::kThisArg);
Node* array = Parameter(Descriptor::kArray);
Node* object = Parameter(Descriptor::kObject);
Node* initial_k = Parameter(Descriptor::kInitialK);
Node* len = Parameter(Descriptor::kLength);
InitIteratingArrayBuiltinLoopContinuation(
context, receiver, callbackfn, this_arg, array, object, initial_k, len);
GenerateIteratingArrayBuiltinLoopContinuation(
&ArrayBuiltinCodeStubAssembler::FilterResultIndexReinitializer,
&ArrayBuiltinCodeStubAssembler::FilterProcessor,
......@@ -674,6 +778,15 @@ TF_BUILTIN(ArrayFilterLoopContinuation, ArrayBuiltinCodeStubAssembler) {
}
TF_BUILTIN(ArrayFilter, ArrayBuiltinCodeStubAssembler) {
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* callbackfn = Parameter(Descriptor::kCallbackFn);
Node* this_arg = Parameter(Descriptor::kThisArg);
Node* new_target = Parameter(Descriptor::kNewTarget);
InitIteratingArrayBuiltinBody(context, receiver, callbackfn, this_arg,
new_target);
GenerateIteratingArrayBuiltinBody(
"Array.prototype.reduce",
&ArrayBuiltinCodeStubAssembler::FilterResultGenerator,
......
......@@ -257,9 +257,9 @@ Node* AsyncFromSyncBuiltinsAssembler::AllocateAsyncIteratorValueUnwrapContext(
// https://tc39.github.io/proposal-async-iteration/
// Section #sec-%asyncfromsynciteratorprototype%.next
TF_BUILTIN(AsyncFromSyncIteratorPrototypeNext, AsyncFromSyncBuiltinsAssembler) {
Node* const iterator = Parameter(0);
Node* const value = Parameter(1);
Node* const context = Parameter(4);
Node* const iterator = Parameter(Descriptor::kReceiver);
Node* const value = Parameter(Descriptor::kValue);
Node* const context = Parameter(Descriptor::kContext);
Generate_AsyncFromSyncIteratorMethod(
context, iterator, value, factory()->next_string(),
......@@ -270,9 +270,9 @@ TF_BUILTIN(AsyncFromSyncIteratorPrototypeNext, AsyncFromSyncBuiltinsAssembler) {
// Section #sec-%asyncfromsynciteratorprototype%.return
TF_BUILTIN(AsyncFromSyncIteratorPrototypeReturn,
AsyncFromSyncBuiltinsAssembler) {
Node* const iterator = Parameter(0);
Node* const value = Parameter(1);
Node* const context = Parameter(4);
Node* const iterator = Parameter(Descriptor::kReceiver);
Node* const value = Parameter(Descriptor::kValue);
Node* const context = Parameter(Descriptor::kContext);
auto if_return_undefined = [=](Node* const native_context,
Node* const promise, Label* if_exception) {
......@@ -298,9 +298,9 @@ TF_BUILTIN(AsyncFromSyncIteratorPrototypeReturn,
// Section #sec-%asyncfromsynciteratorprototype%.throw
TF_BUILTIN(AsyncFromSyncIteratorPrototypeThrow,
AsyncFromSyncBuiltinsAssembler) {
Node* const iterator = Parameter(0);
Node* const reason = Parameter(1);
Node* const context = Parameter(4);
Node* const iterator = Parameter(Descriptor::kReceiver);
Node* const reason = Parameter(Descriptor::kReason);
Node* const context = Parameter(Descriptor::kContext);
auto if_throw_undefined = [=](Node* const native_context, Node* const promise,
Label* if_exception) { Goto(if_exception); };
......@@ -312,8 +312,8 @@ TF_BUILTIN(AsyncFromSyncIteratorPrototypeThrow,
}
TF_BUILTIN(AsyncIteratorValueUnwrap, AsyncFromSyncBuiltinsAssembler) {
Node* const value = Parameter(1);
Node* const context = Parameter(4);
Node* const value = Parameter(Descriptor::kValue);
Node* const context = Parameter(Descriptor::kContext);
Node* const done = LoadContextElement(context, ValueUnwrapContext::kDoneSlot);
CSA_ASSERT(this, IsBoolean(done));
......
......@@ -92,7 +92,7 @@ TF_BUILTIN(ObjectHasOwnProperty, ObjectBuiltinsAssembler) {
Return(CallRuntime(Runtime::kObjectHasOwnProperty, context, object, key));
}
// ES6 section 19.1.3.6 Object.prototype.toString
// ES6 #sec-object.prototype.tostring
TF_BUILTIN(ObjectProtoToString, ObjectBuiltinsAssembler) {
Label return_undefined(this, Label::kDeferred),
return_null(this, Label::kDeferred),
......@@ -107,8 +107,8 @@ TF_BUILTIN(ObjectProtoToString, ObjectBuiltinsAssembler) {
Label checkstringtag(this);
Label if_tostringtag(this), if_notostringtag(this);
Node* receiver = Parameter(0);
Node* context = Parameter(3);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* context = Parameter(Descriptor::kContext);
GotoIf(WordEqual(receiver, UndefinedConstant()), &return_undefined);
......@@ -255,10 +255,10 @@ TF_BUILTIN(ObjectProtoToString, ObjectBuiltinsAssembler) {
}
}
// ES6 19.3.7 Object.prototype.valueOf
// ES6 #sec-object.prototype.valueof
TF_BUILTIN(ObjectPrototypeValueOf, CodeStubAssembler) {
Node* receiver = Parameter(0);
Node* context = Parameter(3);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* context = Parameter(Descriptor::kContext);
Callable to_object = CodeFactory::ToObject(isolate());
receiver = CallStub(to_object, context, receiver);
......@@ -266,10 +266,11 @@ TF_BUILTIN(ObjectPrototypeValueOf, CodeStubAssembler) {
Return(receiver);
}
// ES #sec-object.create
TF_BUILTIN(ObjectCreate, ObjectBuiltinsAssembler) {
Node* prototype = Parameter(1);
Node* properties = Parameter(2);
Node* context = Parameter(3 + 2);
Node* prototype = Parameter(Descriptor::kPrototype);
Node* properties = Parameter(Descriptor::kProperties);
Node* context = Parameter(Descriptor::kContext);
Label call_runtime(this, Label::kDeferred), prototype_valid(this),
no_properties(this);
......
......@@ -975,8 +975,8 @@ void PromiseBuiltinsAssembler::InternalPromiseReject(Node* context,
// ES#sec-promise-reject-functions
// Promise Reject Functions
TF_BUILTIN(PromiseRejectClosure, PromiseBuiltinsAssembler) {
Node* const value = Parameter(1);
Node* const context = Parameter(4);
Node* const value = Parameter(Descriptor::kValue);
Node* const context = Parameter(Descriptor::kContext);
Label out(this);
......@@ -1006,10 +1006,11 @@ TF_BUILTIN(PromiseRejectClosure, PromiseBuiltinsAssembler) {
Return(UndefinedConstant());
}
// ES6 #sec-promise-executor
TF_BUILTIN(PromiseConstructor, PromiseBuiltinsAssembler) {
Node* const executor = Parameter(1);
Node* const new_target = Parameter(2);
Node* const context = Parameter(4);
Node* const executor = Parameter(Descriptor::kExecutor);
Node* const new_target = Parameter(Descriptor::kNewTarget);
Node* const context = Parameter(Descriptor::kContext);
Isolate* isolate = this->isolate();
Label if_targetisundefined(this, Label::kDeferred);
......@@ -1129,13 +1130,13 @@ TF_BUILTIN(PromiseConstructor, PromiseBuiltinsAssembler) {
}
TF_BUILTIN(PromiseInternalConstructor, PromiseBuiltinsAssembler) {
Node* const parent = Parameter(1);
Node* const context = Parameter(4);
Node* const parent = Parameter(Descriptor::kParent);
Node* const context = Parameter(Descriptor::kContext);
Return(AllocateAndInitJSPromise(context, parent));
}
TF_BUILTIN(IsPromise, PromiseBuiltinsAssembler) {
Node* const maybe_promise = Parameter(1);
Node* const maybe_promise = Parameter(Descriptor::kObject);
Label if_notpromise(this, Label::kDeferred);
GotoIf(TaggedIsSmi(maybe_promise), &if_notpromise);
......@@ -1152,10 +1153,10 @@ TF_BUILTIN(IsPromise, PromiseBuiltinsAssembler) {
// Promise.prototype.catch ( onFulfilled, onRejected )
TF_BUILTIN(PromiseThen, PromiseBuiltinsAssembler) {
// 1. Let promise be the this value.
Node* const promise = Parameter(0);
Node* const on_resolve = Parameter(1);
Node* const on_reject = Parameter(2);
Node* const context = Parameter(5);
Node* const promise = Parameter(Descriptor::kReceiver);
Node* const on_resolve = Parameter(Descriptor::kOnFullfilled);
Node* const on_reject = Parameter(Descriptor::kOnRejected);
Node* const context = Parameter(Descriptor::kContext);
Node* const result =
InternalPromiseThen(context, promise, on_resolve, on_reject);
......@@ -1165,8 +1166,8 @@ TF_BUILTIN(PromiseThen, PromiseBuiltinsAssembler) {
// ES#sec-promise-resolve-functions
// Promise Resolve Functions
TF_BUILTIN(PromiseResolveClosure, PromiseBuiltinsAssembler) {
Node* const value = Parameter(1);
Node* const context = Parameter(4);
Node* const value = Parameter(Descriptor::kValue);
Node* const context = Parameter(Descriptor::kContext);
Label out(this);
......@@ -1194,10 +1195,11 @@ TF_BUILTIN(PromiseResolveClosure, PromiseBuiltinsAssembler) {
Return(UndefinedConstant());
}
// ES #sec-fulfillpromise
TF_BUILTIN(ResolvePromise, PromiseBuiltinsAssembler) {
Node* const promise = Parameter(1);
Node* const result = Parameter(2);
Node* const context = Parameter(5);
Node* const promise = Parameter(Descriptor::kPromise);
Node* const result = Parameter(Descriptor::kValue);
Node* const context = Parameter(Descriptor::kContext);
InternalResolvePromise(context, promise, result);
Return(UndefinedConstant());
......@@ -1231,12 +1233,12 @@ TF_BUILTIN(PromiseHandleReject, PromiseBuiltinsAssembler) {
}
TF_BUILTIN(PromiseHandle, PromiseBuiltinsAssembler) {
Node* const value = Parameter(1);
Node* const handler = Parameter(2);
Node* const deferred_promise = Parameter(3);
Node* const deferred_on_resolve = Parameter(4);
Node* const deferred_on_reject = Parameter(5);
Node* const context = Parameter(8);
Node* const value = Parameter(Descriptor::kValue);
Node* const handler = Parameter(Descriptor::kHandler);
Node* const deferred_promise = Parameter(Descriptor::kDeferredPromise);
Node* const deferred_on_resolve = Parameter(Descriptor::kDeferredOnResolve);
Node* const deferred_on_reject = Parameter(Descriptor::kDeferredOnReject);
Node* const context = Parameter(Descriptor::kContext);
Isolate* isolate = this->isolate();
Variable var_reason(this, MachineRepresentation::kTagged);
......@@ -1344,10 +1346,10 @@ TF_BUILTIN(PromiseHandle, PromiseBuiltinsAssembler) {
// Promise.prototype.catch ( onRejected )
TF_BUILTIN(PromiseCatch, PromiseBuiltinsAssembler) {
// 1. Let promise be the this value.
Node* const promise = Parameter(0);
Node* const promise = Parameter(Descriptor::kReceiver);
Node* const on_resolve = UndefinedConstant();
Node* const on_reject = Parameter(1);
Node* const context = Parameter(4);
Node* const on_reject = Parameter(Descriptor::kOnRejected);
Node* const context = Parameter(Descriptor::kContext);
Label if_internalthen(this), if_customthen(this, Label::kDeferred);
GotoIf(TaggedIsSmi(promise), &if_customthen);
......@@ -1373,9 +1375,9 @@ TF_BUILTIN(PromiseCatch, PromiseBuiltinsAssembler) {
TF_BUILTIN(PromiseResolve, PromiseBuiltinsAssembler) {
// 1. Let C be the this value.
Node* receiver = Parameter(0);
Node* value = Parameter(1);
Node* context = Parameter(4);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* value = Parameter(Descriptor::kValue);
Node* context = Parameter(Descriptor::kContext);
Isolate* isolate = this->isolate();
// 2. If Type(C) is not Object, throw a TypeError exception.
......@@ -1455,10 +1457,11 @@ TF_BUILTIN(PromiseResolve, PromiseBuiltinsAssembler) {
}
}
// ES6 #sec-getcapabilitiesexecutor-functions
TF_BUILTIN(PromiseGetCapabilitiesExecutor, PromiseBuiltinsAssembler) {
Node* const resolve = Parameter(1);
Node* const reject = Parameter(2);
Node* const context = Parameter(5);
Node* const resolve = Parameter(Descriptor::kResolve);
Node* const reject = Parameter(Descriptor::kReject);
Node* const context = Parameter(Descriptor::kContext);
Node* const capability = LoadContextElement(context, kCapabilitySlot);
......@@ -1483,10 +1486,11 @@ TF_BUILTIN(PromiseGetCapabilitiesExecutor, PromiseBuiltinsAssembler) {
Unreachable();
}
// ES6 #sec-newpromisecapability
TF_BUILTIN(NewPromiseCapability, PromiseBuiltinsAssembler) {
Node* constructor = Parameter(1);
Node* debug_event = Parameter(2);
Node* context = Parameter(5);
Node* constructor = Parameter(Descriptor::kConstructor);
Node* debug_event = Parameter(Descriptor::kDebugEvent);
Node* context = Parameter(Descriptor::kContext);
CSA_ASSERT_JS_ARGC_EQ(this, 2);
......@@ -1495,9 +1499,9 @@ TF_BUILTIN(NewPromiseCapability, PromiseBuiltinsAssembler) {
TF_BUILTIN(PromiseReject, PromiseBuiltinsAssembler) {
// 1. Let C be the this value.
Node* const receiver = Parameter(0);
Node* const reason = Parameter(1);
Node* const context = Parameter(4);
Node* const receiver = Parameter(Descriptor::kReceiver);
Node* const reason = Parameter(Descriptor::kReason);
Node* const context = Parameter(Descriptor::kContext);
// 2. If Type(C) is not Object, throw a TypeError exception.
ThrowIfNotJSReceiver(context, receiver, MessageTemplate::kCalledOnNonObject,
......@@ -1538,10 +1542,10 @@ TF_BUILTIN(PromiseReject, PromiseBuiltinsAssembler) {
}
TF_BUILTIN(InternalPromiseReject, PromiseBuiltinsAssembler) {
Node* const promise = Parameter(1);
Node* const reason = Parameter(2);
Node* const debug_event = Parameter(3);
Node* const context = Parameter(6);
Node* const promise = Parameter(Descriptor::kPromise);
Node* const reason = Parameter(Descriptor::kReason);
Node* const debug_event = Parameter(Descriptor::kDebugEvent);
Node* const context = Parameter(Descriptor::kContext);
InternalPromiseReject(context, promise, reason, debug_event);
Return(UndefinedConstant());
......@@ -1573,7 +1577,7 @@ std::pair<Node*, Node*> PromiseBuiltinsAssembler::CreatePromiseFinallyFunctions(
}
TF_BUILTIN(PromiseValueThunkFinally, PromiseBuiltinsAssembler) {
Node* const context = Parameter(3);
Node* const context = Parameter(Descriptor::kContext);
Node* const value = LoadContextElement(context, kOnFinallySlot);
Return(value);
......@@ -1603,8 +1607,8 @@ Node* PromiseBuiltinsAssembler::CreateValueThunkFunction(Node* value,
TF_BUILTIN(PromiseThenFinally, PromiseBuiltinsAssembler) {
CSA_ASSERT_JS_ARGC_EQ(this, 1);
Node* const value = Parameter(1);
Node* const context = Parameter(4);
Node* const value = Parameter(Descriptor::kValue);
Node* const context = Parameter(Descriptor::kContext);
Node* const on_finally = LoadContextElement(context, kOnFinallySlot);
......@@ -1633,7 +1637,7 @@ TF_BUILTIN(PromiseThenFinally, PromiseBuiltinsAssembler) {
}
TF_BUILTIN(PromiseThrowerFinally, PromiseBuiltinsAssembler) {
Node* const context = Parameter(3);
Node* const context = Parameter(Descriptor::kContext);
Node* const reason = LoadContextElement(context, kOnFinallySlot);
CallRuntime(Runtime::kThrow, context, reason);
......@@ -1664,8 +1668,8 @@ Node* PromiseBuiltinsAssembler::CreateThrowerFunction(Node* reason,
TF_BUILTIN(PromiseCatchFinally, PromiseBuiltinsAssembler) {
CSA_ASSERT_JS_ARGC_EQ(this, 1);
Node* const reason = Parameter(1);
Node* const context = Parameter(4);
Node* const reason = Parameter(Descriptor::kReason);
Node* const context = Parameter(Descriptor::kContext);
Node* const on_finally = LoadContextElement(context, kOnFinallySlot);
......@@ -1697,9 +1701,9 @@ TF_BUILTIN(PromiseFinally, PromiseBuiltinsAssembler) {
CSA_ASSERT_JS_ARGC_EQ(this, 1);
// 1. Let promise be the this value.
Node* const promise = Parameter(0);
Node* const on_finally = Parameter(1);
Node* const context = Parameter(4);
Node* const promise = Parameter(Descriptor::kReceiver);
Node* const on_finally = Parameter(Descriptor::kOnFinally);
Node* const context = Parameter(Descriptor::kContext);
// 2. If IsPromise(promise) is false, throw a TypeError exception.
ThrowIfNotInstanceType(context, promise, JS_PROMISE_TYPE,
......
......@@ -742,9 +742,9 @@ TF_BUILTIN(RegExpPrototypeExecSlow, RegExpBuiltinsAssembler) {
// ES#sec-regexp.prototype.exec
// RegExp.prototype.exec ( string )
TF_BUILTIN(RegExpPrototypeExec, RegExpBuiltinsAssembler) {
Node* const maybe_receiver = Parameter(0);
Node* const maybe_string = Parameter(1);
Node* const context = Parameter(4);
Node* const maybe_receiver = Parameter(Descriptor::kReceiver);
Node* const maybe_string = Parameter(Descriptor::kString);
Node* const context = Parameter(Descriptor::kContext);
// Ensure {maybe_receiver} is a JSRegExp.
Node* const regexp_map = ThrowIfNotInstanceType(
......@@ -928,9 +928,10 @@ Node* RegExpBuiltinsAssembler::RegExpInitialize(Node* const context,
pattern, flags);
}
// ES #sec-get-regexp.prototype.flags
TF_BUILTIN(RegExpPrototypeFlagsGetter, RegExpBuiltinsAssembler) {
Node* const maybe_receiver = Parameter(0);
Node* const context = Parameter(3);
Node* const maybe_receiver = Parameter(Descriptor::kReceiver);
Node* const context = Parameter(Descriptor::kContext);
Node* const map = ThrowIfNotJSReceiver(context, maybe_receiver,
MessageTemplate::kRegExpNonObject,
......@@ -950,10 +951,10 @@ TF_BUILTIN(RegExpPrototypeFlagsGetter, RegExpBuiltinsAssembler) {
// ES#sec-regexp-pattern-flags
// RegExp ( pattern, flags )
TF_BUILTIN(RegExpConstructor, RegExpBuiltinsAssembler) {
Node* const pattern = Parameter(1);
Node* const flags = Parameter(2);
Node* const new_target = Parameter(3);
Node* const context = Parameter(5);
Node* const pattern = Parameter(Descriptor::kPattern);
Node* const flags = Parameter(Descriptor::kFlags);
Node* const new_target = Parameter(Descriptor::kNewTarget);
Node* const context = Parameter(Descriptor::kContext);
Isolate* isolate = this->isolate();
......@@ -1077,10 +1078,10 @@ TF_BUILTIN(RegExpConstructor, RegExpBuiltinsAssembler) {
// ES#sec-regexp.prototype.compile
// RegExp.prototype.compile ( pattern, flags )
TF_BUILTIN(RegExpPrototypeCompile, RegExpBuiltinsAssembler) {
Node* const maybe_receiver = Parameter(0);
Node* const maybe_pattern = Parameter(1);
Node* const maybe_flags = Parameter(2);
Node* const context = Parameter(5);
Node* const maybe_receiver = Parameter(Descriptor::kReceiver);
Node* const maybe_pattern = Parameter(Descriptor::kPattern);
Node* const maybe_flags = Parameter(Descriptor::kFlags);
Node* const context = Parameter(Descriptor::kContext);
ThrowIfNotInstanceType(context, maybe_receiver, JS_REGEXP_TYPE,
"RegExp.prototype.compile");
......@@ -1125,9 +1126,10 @@ TF_BUILTIN(RegExpPrototypeCompile, RegExpBuiltinsAssembler) {
}
// ES6 21.2.5.10.
// ES #sec-get-regexp.prototype.source
TF_BUILTIN(RegExpPrototypeSourceGetter, RegExpBuiltinsAssembler) {
Node* const receiver = Parameter(0);
Node* const context = Parameter(3);
Node* const receiver = Parameter(Descriptor::kReceiver);
Node* const context = Parameter(Descriptor::kContext);
// Check whether we have an unmodified regexp instance.
Label if_isjsregexp(this), if_isnotjsregexp(this, Label::kDeferred);
......@@ -1250,12 +1252,10 @@ Node* RegExpBuiltinsAssembler::FlagGetter(Node* const context,
: SlowFlagGetter(context, regexp, flag);
}
void RegExpBuiltinsAssembler::FlagGetter(JSRegExp::Flag flag,
void RegExpBuiltinsAssembler::FlagGetter(Node* context, Node* receiver,
JSRegExp::Flag flag,
v8::Isolate::UseCounterFeature counter,
const char* method_name) {
Node* const receiver = Parameter(0);
Node* const context = Parameter(3);
Isolate* isolate = this->isolate();
// Check whether we have an unmodified regexp instance.
......@@ -1311,32 +1311,52 @@ void RegExpBuiltinsAssembler::FlagGetter(JSRegExp::Flag flag,
}
// ES6 21.2.5.4.
// ES #sec-get-regexp.prototype.global
TF_BUILTIN(RegExpPrototypeGlobalGetter, RegExpBuiltinsAssembler) {
FlagGetter(JSRegExp::kGlobal, v8::Isolate::kRegExpPrototypeOldFlagGetter,
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
FlagGetter(context, receiver, JSRegExp::kGlobal,
v8::Isolate::kRegExpPrototypeOldFlagGetter,
"RegExp.prototype.global");
}
// ES6 21.2.5.5.
// ES #sec-get-regexp.prototype.ignorecase
TF_BUILTIN(RegExpPrototypeIgnoreCaseGetter, RegExpBuiltinsAssembler) {
FlagGetter(JSRegExp::kIgnoreCase, v8::Isolate::kRegExpPrototypeOldFlagGetter,
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
FlagGetter(context, receiver, JSRegExp::kIgnoreCase,
v8::Isolate::kRegExpPrototypeOldFlagGetter,
"RegExp.prototype.ignoreCase");
}
// ES6 21.2.5.7.
// ES #sec-get-regexp.prototype.multiline
TF_BUILTIN(RegExpPrototypeMultilineGetter, RegExpBuiltinsAssembler) {
FlagGetter(JSRegExp::kMultiline, v8::Isolate::kRegExpPrototypeOldFlagGetter,
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
FlagGetter(context, receiver, JSRegExp::kMultiline,
v8::Isolate::kRegExpPrototypeOldFlagGetter,
"RegExp.prototype.multiline");
}
// ES6 21.2.5.12.
// ES #sec-get-regexp.prototype.sticky
TF_BUILTIN(RegExpPrototypeStickyGetter, RegExpBuiltinsAssembler) {
FlagGetter(JSRegExp::kSticky, v8::Isolate::kRegExpPrototypeStickyGetter,
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
FlagGetter(context, receiver, JSRegExp::kSticky,
v8::Isolate::kRegExpPrototypeStickyGetter,
"RegExp.prototype.sticky");
}
// ES6 21.2.5.15.
// ES #sec-get-regexp.prototype.unicode
TF_BUILTIN(RegExpPrototypeUnicodeGetter, RegExpBuiltinsAssembler) {
FlagGetter(JSRegExp::kUnicode, v8::Isolate::kRegExpPrototypeUnicodeGetter,
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
FlagGetter(context, receiver, JSRegExp::kUnicode,
v8::Isolate::kRegExpPrototypeUnicodeGetter,
"RegExp.prototype.unicode");
}
......@@ -1395,9 +1415,9 @@ Node* RegExpBuiltinsAssembler::RegExpExec(Node* context, Node* regexp,
// ES#sec-regexp.prototype.test
// RegExp.prototype.test ( S )
TF_BUILTIN(RegExpPrototypeTest, RegExpBuiltinsAssembler) {
Node* const maybe_receiver = Parameter(0);
Node* const maybe_string = Parameter(1);
Node* const context = Parameter(4);
Node* const maybe_receiver = Parameter(Descriptor::kReceiver);
Node* const maybe_string = Parameter(Descriptor::kString);
Node* const context = Parameter(Descriptor::kContext);
// Ensure {maybe_receiver} is a JSReceiver.
Node* const map = ThrowIfNotJSReceiver(
......@@ -1763,9 +1783,9 @@ void RegExpBuiltinsAssembler::RegExpPrototypeMatchBody(Node* const context,
// ES#sec-regexp.prototype-@@match
// RegExp.prototype [ @@match ] ( string )
TF_BUILTIN(RegExpPrototypeMatch, RegExpBuiltinsAssembler) {
Node* const maybe_receiver = Parameter(0);
Node* const maybe_string = Parameter(1);
Node* const context = Parameter(4);
Node* const maybe_receiver = Parameter(Descriptor::kReceiver);
Node* const maybe_string = Parameter(Descriptor::kString);
Node* const context = Parameter(Descriptor::kContext);
// Ensure {maybe_receiver} is a JSReceiver.
Node* const map = ThrowIfNotJSReceiver(
......@@ -1885,9 +1905,9 @@ void RegExpBuiltinsAssembler::RegExpPrototypeSearchBodySlow(
// ES#sec-regexp.prototype-@@search
// RegExp.prototype [ @@search ] ( string )
TF_BUILTIN(RegExpPrototypeSearch, RegExpBuiltinsAssembler) {
Node* const maybe_receiver = Parameter(0);
Node* const maybe_string = Parameter(1);
Node* const context = Parameter(4);
Node* const maybe_receiver = Parameter(Descriptor::kReceiver);
Node* const maybe_string = Parameter(Descriptor::kString);
Node* const context = Parameter(Descriptor::kContext);
// Ensure {maybe_receiver} is a JSReceiver.
Node* const map = ThrowIfNotJSReceiver(
......@@ -2198,10 +2218,10 @@ TF_BUILTIN(RegExpSplit, RegExpBuiltinsAssembler) {
// ES#sec-regexp.prototype-@@split
// RegExp.prototype [ @@split ] ( string, limit )
TF_BUILTIN(RegExpPrototypeSplit, RegExpBuiltinsAssembler) {
Node* const maybe_receiver = Parameter(0);
Node* const maybe_string = Parameter(1);
Node* const maybe_limit = Parameter(2);
Node* const context = Parameter(5);
Node* const maybe_receiver = Parameter(Descriptor::kReceiver);
Node* const maybe_string = Parameter(Descriptor::kString);
Node* const maybe_limit = Parameter(Descriptor::kLimit);
Node* const context = Parameter(Descriptor::kContext);
// Ensure {maybe_receiver} is a JSReceiver.
Node* const map = ThrowIfNotJSReceiver(
......@@ -2596,10 +2616,10 @@ TF_BUILTIN(RegExpReplace, RegExpBuiltinsAssembler) {
// ES#sec-regexp.prototype-@@replace
// RegExp.prototype [ @@replace ] ( string, replaceValue )
TF_BUILTIN(RegExpPrototypeReplace, RegExpBuiltinsAssembler) {
Node* const maybe_receiver = Parameter(0);
Node* const maybe_string = Parameter(1);
Node* const replace_value = Parameter(2);
Node* const context = Parameter(5);
Node* const maybe_receiver = Parameter(Descriptor::kReceiver);
Node* const maybe_string = Parameter(Descriptor::kString);
Node* const replace_value = Parameter(Descriptor::kReplaceValue);
Node* const context = Parameter(Descriptor::kContext);
// RegExpPrototypeReplace is a bit of a beast - a summary of dispatch logic:
//
......@@ -2644,9 +2664,9 @@ TF_BUILTIN(RegExpPrototypeReplace, RegExpBuiltinsAssembler) {
// Simple string matching functionality for internal use which does not modify
// the last match info.
TF_BUILTIN(RegExpInternalMatch, RegExpBuiltinsAssembler) {
Node* const regexp = Parameter(1);
Node* const string = Parameter(2);
Node* const context = Parameter(5);
Node* const regexp = Parameter(Descriptor::kRegExp);
Node* const string = Parameter(Descriptor::kString);
Node* const context = Parameter(Descriptor::kContext);
Node* const null = NullConstant();
Node* const smi_zero = SmiConstant(Smi::FromInt(0));
......
......@@ -71,7 +71,8 @@ class RegExpBuiltinsAssembler : public CodeStubAssembler {
JSRegExp::Flag flag);
Node* FlagGetter(Node* const context, Node* const regexp, JSRegExp::Flag flag,
bool is_fastpath);
void FlagGetter(JSRegExp::Flag flag, v8::Isolate::UseCounterFeature counter,
void FlagGetter(Node* context, Node* receiver, JSRegExp::Flag flag,
v8::Isolate::UseCounterFeature counter,
const char* method_name);
Node* IsRegExp(Node* const context, Node* const maybe_receiver);
......
......@@ -140,9 +140,9 @@ void SharedArrayBufferBuiltinsAssembler::ValidateAtomicIndex(
}
TF_BUILTIN(AtomicsLoad, SharedArrayBufferBuiltinsAssembler) {
Node* array = Parameter(1);
Node* index = Parameter(2);
Node* context = Parameter(3 + 2);
Node* array = Parameter(Descriptor::kArray);
Node* index = Parameter(Descriptor::kIndex);
Node* context = Parameter(Descriptor::kContext);
Node* instance_type;
Node* backing_store;
......@@ -198,10 +198,10 @@ TF_BUILTIN(AtomicsLoad, SharedArrayBufferBuiltinsAssembler) {
}
TF_BUILTIN(AtomicsStore, SharedArrayBufferBuiltinsAssembler) {
Node* array = Parameter(1);
Node* index = Parameter(2);
Node* value = Parameter(3);
Node* context = Parameter(4 + 2);
Node* array = Parameter(Descriptor::kArray);
Node* index = Parameter(Descriptor::kIndex);
Node* value = Parameter(Descriptor::kValue);
Node* context = Parameter(Descriptor::kContext);
Node* instance_type;
Node* backing_store;
......@@ -250,10 +250,10 @@ TF_BUILTIN(AtomicsStore, SharedArrayBufferBuiltinsAssembler) {
}
TF_BUILTIN(AtomicsExchange, SharedArrayBufferBuiltinsAssembler) {
Node* array = Parameter(1);
Node* index = Parameter(2);
Node* value = Parameter(3);
Node* context = Parameter(4 + 2);
Node* array = Parameter(Descriptor::kArray);
Node* index = Parameter(Descriptor::kIndex);
Node* value = Parameter(Descriptor::kValue);
Node* context = Parameter(Descriptor::kContext);
Node* instance_type;
Node* backing_store;
......@@ -323,11 +323,11 @@ TF_BUILTIN(AtomicsExchange, SharedArrayBufferBuiltinsAssembler) {
}
TF_BUILTIN(AtomicsCompareExchange, SharedArrayBufferBuiltinsAssembler) {
Node* array = Parameter(1);
Node* index = Parameter(2);
Node* old_value = Parameter(3);
Node* new_value = Parameter(4);
Node* context = Parameter(5 + 2);
Node* array = Parameter(Descriptor::kArray);
Node* index = Parameter(Descriptor::kIndex);
Node* old_value = Parameter(Descriptor::kOldValue);
Node* new_value = Parameter(Descriptor::kNewValue);
Node* context = Parameter(Descriptor::kContext);
Node* instance_type;
Node* backing_store;
......
......@@ -475,7 +475,7 @@ TF_BUILTIN(StringCharCodeAt, CodeStubAssembler) {
// -----------------------------------------------------------------------------
// ES6 section 21.1 String Objects
// ES6 section 21.1.2.1 String.fromCharCode ( ...codeUnits )
// ES6 #sec-string.fromcharcode
TF_BUILTIN(StringFromCharCode, CodeStubAssembler) {
// TODO(ishell): use constants from Descriptor once the JSFunction linkage
// arguments are reordered.
......@@ -586,11 +586,11 @@ TF_BUILTIN(StringFromCharCode, CodeStubAssembler) {
}
}
// ES6 section 21.1.3.1 String.prototype.charAt ( pos )
// ES6 #sec-string.prototype.charat
TF_BUILTIN(StringPrototypeCharAt, CodeStubAssembler) {
Node* receiver = Parameter(0);
Node* position = Parameter(1);
Node* context = Parameter(4);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* position = Parameter(Descriptor::kPosition);
Node* context = Parameter(Descriptor::kContext);
// Check that {receiver} is coercible to Object and convert it to a String.
receiver = ToThisString(context, receiver, "String.prototype.charAt");
......@@ -625,11 +625,11 @@ TF_BUILTIN(StringPrototypeCharAt, CodeStubAssembler) {
Return(result);
}
// ES6 section 21.1.3.2 String.prototype.charCodeAt ( pos )
// ES6 #sec-string.prototype.charcodeat
TF_BUILTIN(StringPrototypeCharCodeAt, CodeStubAssembler) {
Node* receiver = Parameter(0);
Node* position = Parameter(1);
Node* context = Parameter(4);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* position = Parameter(Descriptor::kPosition);
Node* context = Parameter(Descriptor::kContext);
// Check that {receiver} is coercible to Object and convert it to a String.
receiver = ToThisString(context, receiver, "String.prototype.charCodeAt");
......@@ -663,8 +663,10 @@ TF_BUILTIN(StringPrototypeCharCodeAt, CodeStubAssembler) {
}
// ES6 String.prototype.concat(...args)
// #sec-string.prototype.concat
// ES6 #sec-string.prototype.concat
TF_BUILTIN(StringPrototypeConcat, CodeStubAssembler) {
// TODO(ishell): use constants from Descriptor once the JSFunction linkage
// arguments are reordered.
CodeStubArguments arguments(
this, ChangeInt32ToIntPtr(Parameter(BuiltinDescriptor::kArgumentsCount)));
Node* receiver = arguments.GetReceiver();
......@@ -975,14 +977,14 @@ void StringBuiltinsAssembler::MaybeCallFunctionAtSymbol(
Bind(&out);
}
// ES6 section 21.1.3.16 String.prototype.replace ( search, replace )
// ES6 #sec-string.prototype.replace
TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
Label out(this);
Node* const receiver = Parameter(0);
Node* const search = Parameter(1);
Node* const replace = Parameter(2);
Node* const context = Parameter(5);
Node* const receiver = Parameter(Descriptor::kReceiver);
Node* const search = Parameter(Descriptor::kSearch);
Node* const replace = Parameter(Descriptor::kReplace);
Node* const context = Parameter(Descriptor::kContext);
Node* const smi_zero = SmiConstant(0);
......@@ -1147,10 +1149,10 @@ TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
TF_BUILTIN(StringPrototypeSplit, StringBuiltinsAssembler) {
Label out(this);
Node* const receiver = Parameter(0);
Node* const separator = Parameter(1);
Node* const limit = Parameter(2);
Node* const context = Parameter(5);
Node* const receiver = Parameter(Descriptor::kReceiver);
Node* const separator = Parameter(Descriptor::kSeparator);
Node* const limit = Parameter(Descriptor::kLimit);
Node* const context = Parameter(Descriptor::kContext);
Node* const smi_zero = SmiConstant(0);
......@@ -1246,17 +1248,17 @@ TF_BUILTIN(StringPrototypeSplit, StringBuiltinsAssembler) {
Return(result);
}
// ES6 section B.2.3.1 String.prototype.substr ( start, length )
// ES6 #sec-string.prototype.substr
TF_BUILTIN(StringPrototypeSubstr, CodeStubAssembler) {
Label out(this), handle_length(this);
Variable var_start(this, MachineRepresentation::kTagged);
Variable var_length(this, MachineRepresentation::kTagged);
Node* const receiver = Parameter(0);
Node* const start = Parameter(1);
Node* const length = Parameter(2);
Node* const context = Parameter(5);
Node* const receiver = Parameter(Descriptor::kReceiver);
Node* const start = Parameter(Descriptor::kStart);
Node* const length = Parameter(Descriptor::kLength);
Node* const context = Parameter(Descriptor::kContext);
Node* const zero = SmiConstant(Smi::kZero);
......@@ -1415,17 +1417,17 @@ compiler::Node* StringBuiltinsAssembler::ToSmiBetweenZeroAnd(Node* context,
return var_result.value();
}
// ES6 section 21.1.3.19 String.prototype.substring ( start, end )
// ES6 #sec-string.prototype.substring
TF_BUILTIN(StringPrototypeSubstring, StringBuiltinsAssembler) {
Label out(this);
Variable var_start(this, MachineRepresentation::kTagged);
Variable var_end(this, MachineRepresentation::kTagged);
Node* const receiver = Parameter(0);
Node* const start = Parameter(1);
Node* const end = Parameter(2);
Node* const context = Parameter(5);
Node* const receiver = Parameter(Descriptor::kReceiver);
Node* const start = Parameter(Descriptor::kStart);
Node* const end = Parameter(Descriptor::kEnd);
Node* const context = Parameter(Descriptor::kContext);
// Check that {receiver} is coercible to Object and convert it to a String.
Node* const string =
......@@ -1464,20 +1466,20 @@ TF_BUILTIN(StringPrototypeSubstring, StringBuiltinsAssembler) {
}
}
// ES6 section 21.1.3.25 String.prototype.toString ()
// ES6 #sec-string.prototype.tostring
TF_BUILTIN(StringPrototypeToString, CodeStubAssembler) {
Node* receiver = Parameter(0);
Node* context = Parameter(3);
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* result = ToThisValue(context, receiver, PrimitiveType::kString,
"String.prototype.toString");
Return(result);
}
// ES6 section 21.1.3.28 String.prototype.valueOf ( )
// ES6 #sec-string.prototype.valueof
TF_BUILTIN(StringPrototypeValueOf, CodeStubAssembler) {
Node* receiver = Parameter(0);
Node* context = Parameter(3);
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* result = ToThisValue(context, receiver, PrimitiveType::kString,
"String.prototype.valueOf");
......@@ -1485,8 +1487,8 @@ TF_BUILTIN(StringPrototypeValueOf, CodeStubAssembler) {
}
TF_BUILTIN(StringPrototypeIterator, CodeStubAssembler) {
Node* receiver = Parameter(0);
Node* context = Parameter(3);
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* string =
ToThisString(context, receiver, "String.prototype[Symbol.iterator]");
......@@ -1573,6 +1575,7 @@ compiler::Node* StringBuiltinsAssembler::LoadSurrogatePairAt(
return var_result.value();
}
// ES6 #sec-%stringiteratorprototype%.next
TF_BUILTIN(StringIteratorPrototypeNext, StringBuiltinsAssembler) {
Variable var_value(this, MachineRepresentation::kTagged);
Variable var_done(this, MachineRepresentation::kTagged);
......@@ -1582,8 +1585,8 @@ TF_BUILTIN(StringIteratorPrototypeNext, StringBuiltinsAssembler) {
Label throw_bad_receiver(this), next_codepoint(this), return_result(this);
Node* iterator = Parameter(0);
Node* context = Parameter(3);
Node* context = Parameter(Descriptor::kContext);
Node* iterator = Parameter(Descriptor::kReceiver);
GotoIf(TaggedIsSmi(iterator), &throw_bad_receiver);
GotoIfNot(Word32Equal(LoadInstanceType(iterator),
......
......@@ -10,22 +10,22 @@ namespace v8 {
namespace internal {
// -----------------------------------------------------------------------------
// ES6 section 19.4 Symbol Objects
// ES6 #sec-symbol-objects
// ES6 section 19.4.3.4 Symbol.prototype [ @@toPrimitive ] ( hint )
// ES6 #sec-symbol.prototype-@@toprimitive
TF_BUILTIN(SymbolPrototypeToPrimitive, CodeStubAssembler) {
Node* receiver = Parameter(0);
Node* context = Parameter(4);
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* result = ToThisValue(context, receiver, PrimitiveType::kSymbol,
"Symbol.prototype [ @@toPrimitive ]");
Return(result);
}
// ES6 section 19.4.3.2 Symbol.prototype.toString ( )
// ES6 #sec-symbol.prototype.tostring
TF_BUILTIN(SymbolPrototypeToString, CodeStubAssembler) {
Node* receiver = Parameter(0);
Node* context = Parameter(3);
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* value = ToThisValue(context, receiver, PrimitiveType::kSymbol,
"Symbol.prototype.toString");
......@@ -33,10 +33,10 @@ TF_BUILTIN(SymbolPrototypeToString, CodeStubAssembler) {
Return(result);
}
// ES6 section 19.4.3.3 Symbol.prototype.valueOf ( )
// ES6 #sec-symbol.prototype.valueof
TF_BUILTIN(SymbolPrototypeValueOf, CodeStubAssembler) {
Node* receiver = Parameter(0);
Node* context = Parameter(3);
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
Node* result = ToThisValue(context, receiver, PrimitiveType::kSymbol,
"Symbol.prototype.valueOf");
......
......@@ -18,10 +18,12 @@ class TypedArrayBuiltinsAssembler : public CodeStubAssembler {
: CodeStubAssembler(state) {}
protected:
void GenerateTypedArrayPrototypeGetter(const char* method_name,
void GenerateTypedArrayPrototypeGetter(Node* context, Node* receiver,
const char* method_name,
int object_offset);
template <IterationKind kIterationKind>
void GenerateTypedArrayPrototypeIterationMethod(const char* method_name);
void GenerateTypedArrayPrototypeIterationMethod(Node* context, Node* receiver,
const char* method_name,
IterationKind iteration_kind);
void LoadMapAndElementsSize(Node* const array, Variable* typed_map,
Variable* size);
......@@ -280,25 +282,25 @@ void TypedArrayBuiltinsAssembler::DoInitialize(Node* const holder, Node* length,
}
TF_BUILTIN(TypedArrayInitialize, TypedArrayBuiltinsAssembler) {
Node* const holder = Parameter(1);
Node* length = Parameter(2);
Node* const maybe_buffer = Parameter(3);
Node* const byte_offset = Parameter(4);
Node* byte_length = Parameter(5);
Node* const initialize = Parameter(6);
Node* const context = Parameter(9);
Node* const holder = Parameter(Descriptor::kHolder);
Node* length = Parameter(Descriptor::kLength);
Node* const maybe_buffer = Parameter(Descriptor::kBuffer);
Node* const byte_offset = Parameter(Descriptor::kByteOffset);
Node* byte_length = Parameter(Descriptor::kByteLength);
Node* const initialize = Parameter(Descriptor::kInitialize);
Node* const context = Parameter(Descriptor::kContext);
DoInitialize(holder, length, maybe_buffer, byte_offset, byte_length,
initialize, context);
}
// ES6 section 22.2.4.2 TypedArray ( length )
// ES6 #sec-typedarray-length
TF_BUILTIN(TypedArrayConstructByLength, TypedArrayBuiltinsAssembler) {
// We know that holder cannot be an object if this builtin was called.
Node* holder = Parameter(1);
Node* length = Parameter(2);
Node* element_size = Parameter(3);
Node* context = Parameter(6);
Node* holder = Parameter(Descriptor::kHolder);
Node* length = Parameter(Descriptor::kLength);
Node* element_size = Parameter(Descriptor::kElementSize);
Node* context = Parameter(Descriptor::kContext);
Variable maybe_buffer(this, MachineRepresentation::kTagged);
maybe_buffer.Bind(NullConstant());
......@@ -345,15 +347,15 @@ TF_BUILTIN(TypedArrayConstructByLength, TypedArrayBuiltinsAssembler) {
}
}
// ES6 section 22.2.4.5 TypedArray ( buffer [ , byteOffset [ , length ] ] )
// ES6 #sec-typedarray-buffer-byteoffset-length
TF_BUILTIN(TypedArrayConstructByArrayBuffer, TypedArrayBuiltinsAssembler) {
Node* const holder = Parameter(1);
Node* const buffer = Parameter(2);
Node* const byte_offset = Parameter(3);
Node* const length = Parameter(4);
Node* const element_size = Parameter(5);
Node* const holder = Parameter(Descriptor::kHolder);
Node* const buffer = Parameter(Descriptor::kBuffer);
Node* const byte_offset = Parameter(Descriptor::kByteOffset);
Node* const length = Parameter(Descriptor::kLength);
Node* const element_size = Parameter(Descriptor::kElementSize);
CSA_ASSERT(this, TaggedIsSmi(element_size));
Node* const context = Parameter(8);
Node* const context = Parameter(Descriptor::kContext);
Node* const initialize = BooleanConstant(true);
Variable new_byte_length(this, MachineRepresentation::kTagged,
......@@ -486,10 +488,7 @@ TF_BUILTIN(TypedArrayConstructByArrayBuffer, TypedArrayBuiltinsAssembler) {
}
void TypedArrayBuiltinsAssembler::GenerateTypedArrayPrototypeGetter(
const char* method_name, int object_offset) {
Node* receiver = Parameter(0);
Node* context = Parameter(3);
Node* context, Node* receiver, const char* method_name, int object_offset) {
// Check if the {receiver} is actually a JSTypedArray.
Label receiver_is_incompatible(this, Label::kDeferred);
GotoIf(TaggedIsSmi(receiver), &receiver_is_incompatible);
......@@ -520,30 +519,36 @@ void TypedArrayBuiltinsAssembler::GenerateTypedArrayPrototypeGetter(
}
}
// ES6 section 22.2.3.2 get %TypedArray%.prototype.byteLength
// ES6 #sec-get-%typedarray%.prototype.bytelength
TF_BUILTIN(TypedArrayPrototypeByteLength, TypedArrayBuiltinsAssembler) {
GenerateTypedArrayPrototypeGetter("get TypedArray.prototype.byteLength",
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
GenerateTypedArrayPrototypeGetter(context, receiver,
"get TypedArray.prototype.byteLength",
JSTypedArray::kByteLengthOffset);
}
// ES6 section 22.2.3.3 get %TypedArray%.prototype.byteOffset
// ES6 #sec-get-%typedarray%.prototype.byteoffset
TF_BUILTIN(TypedArrayPrototypeByteOffset, TypedArrayBuiltinsAssembler) {
GenerateTypedArrayPrototypeGetter("get TypedArray.prototype.byteOffset",
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
GenerateTypedArrayPrototypeGetter(context, receiver,
"get TypedArray.prototype.byteOffset",
JSTypedArray::kByteOffsetOffset);
}
// ES6 section 22.2.3.18 get %TypedArray%.prototype.length
// ES6 #sec-get-%typedarray%.prototype.length
TF_BUILTIN(TypedArrayPrototypeLength, TypedArrayBuiltinsAssembler) {
GenerateTypedArrayPrototypeGetter("get TypedArray.prototype.length",
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
GenerateTypedArrayPrototypeGetter(context, receiver,
"get TypedArray.prototype.length",
JSTypedArray::kLengthOffset);
}
template <IterationKind kIterationKind>
void TypedArrayBuiltinsAssembler::GenerateTypedArrayPrototypeIterationMethod(
const char* method_name) {
Node* receiver = Parameter(0);
Node* context = Parameter(3);
Node* context, Node* receiver, const char* method_name,
IterationKind iteration_kind) {
Label throw_bad_receiver(this, Label::kDeferred);
Label throw_typeerror(this, Label::kDeferred);
......@@ -561,7 +566,7 @@ void TypedArrayBuiltinsAssembler::GenerateTypedArrayPrototypeIterationMethod(
GotoIf(IsDetachedBuffer(receiver_buffer), &if_receiverisneutered);
Return(CreateArrayIterator(receiver, map, instance_type, context,
kIterationKind));
iteration_kind));
Variable var_message(this, MachineRepresentation::kTagged);
Bind(&throw_bad_receiver);
......@@ -583,19 +588,30 @@ void TypedArrayBuiltinsAssembler::GenerateTypedArrayPrototypeIterationMethod(
}
}
// ES6 #sec-%typedarray%.prototype.values
TF_BUILTIN(TypedArrayPrototypeValues, TypedArrayBuiltinsAssembler) {
GenerateTypedArrayPrototypeIterationMethod<IterationKind::kValues>(
"%TypedArray%.prototype.values()");
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
GenerateTypedArrayPrototypeIterationMethod(context, receiver,
"%TypedArray%.prototype.values()",
IterationKind::kValues);
}
// ES6 #sec-%typedarray%.prototype.entries
TF_BUILTIN(TypedArrayPrototypeEntries, TypedArrayBuiltinsAssembler) {
GenerateTypedArrayPrototypeIterationMethod<IterationKind::kEntries>(
"%TypedArray%.prototype.entries()");
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
GenerateTypedArrayPrototypeIterationMethod(context, receiver,
"%TypedArray%.prototype.entries()",
IterationKind::kEntries);
}
// ES6 #sec-%typedarray%.prototype.keys
TF_BUILTIN(TypedArrayPrototypeKeys, TypedArrayBuiltinsAssembler) {
GenerateTypedArrayPrototypeIterationMethod<IterationKind::kKeys>(
"%TypedArray%.prototype.keys()");
Node* context = Parameter(Descriptor::kContext);
Node* receiver = Parameter(Descriptor::kReceiver);
GenerateTypedArrayPrototypeIterationMethod(
context, receiver, "%TypedArray%.prototype.keys()", IterationKind::kKeys);
}
} // namespace internal
......
......@@ -285,19 +285,24 @@ class Isolate;
/* ES6 #sec-array.prototype.unshift */ \
CPP(ArrayUnshift) \
/* ES6 #sec-array.prototype.foreach */ \
TFJ(ArrayForEachLoopContinuation, 6) \
TFJ(ArrayForEachLoopContinuation, 6, kCallbackFn, kThisArg, kArray, kObject, \
kInitialK, kLength) \
TFJ(ArrayForEach, 2, kCallbackFn, kThisArg) \
/* ES6 #sec-array.prototype.every */ \
TFJ(ArrayEveryLoopContinuation, 6) \
TFJ(ArrayEveryLoopContinuation, 6, kCallbackFn, kThisArg, kArray, kObject, \
kInitialK, kLength) \
TFJ(ArrayEvery, 2, kCallbackFn, kThisArg) \
/* ES6 #sec-array.prototype.some */ \
TFJ(ArraySomeLoopContinuation, 6) \
TFJ(ArraySomeLoopContinuation, 6, kCallbackFn, kThisArg, kArray, kObject, \
kInitialK, kLength) \
TFJ(ArraySome, 2, kCallbackFn, kThisArg) \
/* ES6 #sec-array.prototype.filter */ \
TFJ(ArrayFilterLoopContinuation, 6) \
TFJ(ArrayFilterLoopContinuation, 6, kCallbackFn, kThisArg, kArray, kObject, \
kInitialK, kLength) \
TFJ(ArrayFilter, 2, kCallbackFn, kThisArg) \
/* ES6 #sec-array.prototype.reduce */ \
TFJ(ArrayReduceLoopContinuation, 6) \
TFJ(ArrayReduceLoopContinuation, 6, kCallbackFn, kThisArg, kAccumulator, \
kObject, kInitialK, kLength) \
TFJ(ArrayReduce, 2, kCallbackFn, kInitialValue) \
/* ES6 #sec-array.prototype.entries */ \
TFJ(ArrayPrototypeEntries, 0) \
......@@ -633,7 +638,8 @@ class Isolate;
\
/* Object */ \
CPP(ObjectAssign) \
TFJ(ObjectCreate, 2) \
/* ES #sec-object.create */ \
TFJ(ObjectCreate, 2, kPrototype, kProperties) \
CPP(ObjectDefineGetter) \
CPP(ObjectDefineProperties) \
CPP(ObjectDefineProperty) \
......@@ -646,7 +652,7 @@ class Isolate;
CPP(ObjectGetOwnPropertySymbols) \
CPP(ObjectGetPrototypeOf) \
CPP(ObjectSetPrototypeOf) \
/* ES6 section 19.1.3.2 Object.prototype.hasOwnProperty */ \
/* ES6 #sec-object.prototype.hasownproperty */ \
TFJ(ObjectHasOwnProperty, 1) \
CPP(ObjectIs) \
CPP(ObjectIsExtensible) \
......@@ -656,8 +662,9 @@ class Isolate;
CPP(ObjectLookupGetter) \
CPP(ObjectLookupSetter) \
CPP(ObjectPreventExtensions) \
/* ES6 section 19.1.3.6 Object.prototype.toString () */ \
/* ES6 #sec-object.prototype.tostring */ \
TFJ(ObjectProtoToString, 0) \
/* ES6 #sec-object.prototype.valueof */ \
TFJ(ObjectPrototypeValueOf, 0) \
CPP(ObjectPrototypePropertyIsEnumerable) \
CPP(ObjectPrototypeGetProto) \
......@@ -675,24 +682,35 @@ class Isolate;
TFS(ForInPrepare, BUILTIN, kNoExtraICState, ForInPrepare, 3) \
\
/* Promise */ \
TFJ(PromiseGetCapabilitiesExecutor, 2) \
TFJ(NewPromiseCapability, 2) \
TFJ(PromiseConstructor, 1) \
TFJ(PromiseInternalConstructor, 1) \
TFJ(IsPromise, 1) \
TFJ(PromiseResolveClosure, 1) \
TFJ(PromiseRejectClosure, 1) \
TFJ(PromiseThen, 2) \
TFJ(PromiseCatch, 1) \
TFJ(ResolvePromise, 2) \
/* ES6 #sec-getcapabilitiesexecutor-functions */ \
TFJ(PromiseGetCapabilitiesExecutor, 2, kResolve, kReject) \
/* ES6 #sec-newpromisecapability */ \
TFJ(NewPromiseCapability, 2, kConstructor, kDebugEvent) \
/* ES6 #sec-promise-executor */ \
TFJ(PromiseConstructor, 1, kExecutor) \
TFJ(PromiseInternalConstructor, 1, kParent) \
TFJ(IsPromise, 1, kObject) \
/* ES #sec-promise-resolve-functions */ \
TFJ(PromiseResolveClosure, 1, kValue) \
/* ES #sec-promise-reject-functions */ \
TFJ(PromiseRejectClosure, 1, kValue) \
/* ES #sec-promise.prototype.then */ \
TFJ(PromiseThen, 2, kOnFullfilled, kOnRejected) \
/* ES #sec-promise.prototype.catch */ \
TFJ(PromiseCatch, 1, kOnRejected) \
/* ES #sec-fulfillpromise */ \
TFJ(ResolvePromise, 2, kPromise, kValue) \
TFS(PromiseHandleReject, BUILTIN, kNoExtraICState, PromiseHandleReject, 1) \
TFJ(PromiseHandle, 5) \
TFJ(PromiseResolve, 1) \
TFJ(PromiseReject, 1) \
TFJ(InternalPromiseReject, 3) \
TFJ(PromiseFinally, 1) \
TFJ(PromiseThenFinally, 1) \
TFJ(PromiseCatchFinally, 1) \
TFJ(PromiseHandle, 5, kValue, kHandler, kDeferredPromise, \
kDeferredOnResolve, kDeferredOnReject) \
/* ES #sec-promise.resolve */ \
TFJ(PromiseResolve, 1, kValue) \
/* ES #sec-promise.reject */ \
TFJ(PromiseReject, 1, kReason) \
TFJ(InternalPromiseReject, 3, kPromise, kReason, kDebugEvent) \
TFJ(PromiseFinally, 1, kOnFinally) \
TFJ(PromiseThenFinally, 1, kValue) \
TFJ(PromiseCatchFinally, 1, kReason) \
TFJ(PromiseValueThunkFinally, 0) \
TFJ(PromiseThrowerFinally, 0) \
\
......@@ -727,40 +745,55 @@ class Isolate;
CPP(RegExpCapture7Getter) \
CPP(RegExpCapture8Getter) \
CPP(RegExpCapture9Getter) \
TFJ(RegExpConstructor, 2) \
TFJ(RegExpInternalMatch, 2) \
/* ES #sec-regexp-pattern-flags */ \
TFJ(RegExpConstructor, 2, kPattern, kFlags) \
TFJ(RegExpInternalMatch, 2, kRegExp, kString) \
CPP(RegExpInputGetter) \
CPP(RegExpInputSetter) \
CPP(RegExpLastMatchGetter) \
CPP(RegExpLastParenGetter) \
CPP(RegExpLeftContextGetter) \
TFJ(RegExpPrototypeCompile, 2) \
TFJ(RegExpPrototypeExec, 1) \
/* ES #sec-regexp.prototype.compile */ \
TFJ(RegExpPrototypeCompile, 2, kPattern, kFlags) \
/* ES #sec-regexp.prototype.exec */ \
TFJ(RegExpPrototypeExec, 1, kString) \
/* ES #sec-get-regexp.prototype.flags */ \
TFJ(RegExpPrototypeFlagsGetter, 0) \
/* ES #sec-get-regexp.prototype.global */ \
TFJ(RegExpPrototypeGlobalGetter, 0) \
/* ES #sec-get-regexp.prototype.ignorecase */ \
TFJ(RegExpPrototypeIgnoreCaseGetter, 0) \
TFJ(RegExpPrototypeMatch, 1) \
/* ES #sec-regexp.prototype-@@match */ \
TFJ(RegExpPrototypeMatch, 1, kString) \
/* ES #sec-get-regexp.prototype.multiline */ \
TFJ(RegExpPrototypeMultilineGetter, 0) \
TFJ(RegExpPrototypeSearch, 1) \
/* ES #sec-regexp.prototype-@@search */ \
TFJ(RegExpPrototypeSearch, 1, kString) \
/* ES #sec-get-regexp.prototype.source */ \
TFJ(RegExpPrototypeSourceGetter, 0) \
/* ES #sec-get-regexp.prototype.sticky */ \
TFJ(RegExpPrototypeStickyGetter, 0) \
TFJ(RegExpPrototypeTest, 1) \
/* ES #sec-regexp.prototype.test */ \
TFJ(RegExpPrototypeTest, 1, kString) \
CPP(RegExpPrototypeToString) \
/* ES #sec-get-regexp.prototype.unicode */ \
TFJ(RegExpPrototypeUnicodeGetter, 0) \
CPP(RegExpRightContextGetter) \
\
TFS(RegExpReplace, BUILTIN, kNoExtraICState, RegExpReplace, 1) \
TFJ(RegExpPrototypeReplace, 2) \
/* ES #sec-regexp.prototype-@@replace */ \
TFJ(RegExpPrototypeReplace, 2, kString, kReplaceValue) \
\
TFS(RegExpSplit, BUILTIN, kNoExtraICState, RegExpSplit, 1) \
TFJ(RegExpPrototypeSplit, 2) \
/* ES #sec-regexp.prototype-@@split */ \
TFJ(RegExpPrototypeSplit, 2, kString, kLimit) \
\
/* SharedArrayBuffer */ \
CPP(SharedArrayBufferPrototypeGetByteLength) \
TFJ(AtomicsLoad, 2) \
TFJ(AtomicsStore, 3) \
TFJ(AtomicsExchange, 3) \
TFJ(AtomicsCompareExchange, 4) \
TFJ(AtomicsLoad, 2, kArray, kIndex) \
TFJ(AtomicsStore, 3, kArray, kIndex, kValue) \
TFJ(AtomicsExchange, 3, kArray, kIndex, kValue) \
TFJ(AtomicsCompareExchange, 4, kArray, kIndex, kOldValue, kNewValue) \
CPP(AtomicsAdd) \
CPP(AtomicsSub) \
CPP(AtomicsAnd) \
......@@ -774,42 +807,37 @@ class Isolate;
ASM(StringConstructor) \
ASM(StringConstructor_ConstructStub) \
CPP(StringFromCodePoint) \
/* ES6 section 21.1.2.1 String.fromCharCode ( ...codeUnits ) */ \
/* ES6 #sec-string.fromcharcode */ \
TFJ(StringFromCharCode, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
/* ES6 section 21.1.3.1 String.prototype.charAt ( pos ) */ \
TFJ(StringPrototypeCharAt, 1) \
/* ES6 section 21.1.3.2 String.prototype.charCodeAt ( pos ) */ \
TFJ(StringPrototypeCharCodeAt, 1) \
/* ES6 #sec-string.prototype.charat */ \
TFJ(StringPrototypeCharAt, 1, kPosition) \
/* ES6 #sec-string.prototype.charcodeat */ \
TFJ(StringPrototypeCharCodeAt, 1, kPosition) \
/* ES6 #sec-string.prototype.concat */ \
TFJ(StringPrototypeConcat, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
/* ES6 section 21.1.3.6 */ \
/* String.prototype.endsWith ( searchString [ , endPosition ] ) */ \
/* ES6 #sec-string.prototype.endswith */ \
CPP(StringPrototypeEndsWith) \
/* ES6 section 21.1.3.7 */ \
/* String.prototype.includes ( searchString [ , position ] ) */ \
/* ES6 #sec-string.prototype.includes */ \
CPP(StringPrototypeIncludes) \
/* ES6 section #sec-string.prototype.indexof */ \
/* String.prototype.indexOf ( searchString [ , position ] ) */ \
/* ES6 #sec-string.prototype.indexof */ \
TFJ(StringPrototypeIndexOf, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
/* ES6 section 21.1.3.9 */ \
/* String.prototype.lastIndexOf ( searchString [ , position ] ) */ \
/* ES6 #sec-string.prototype.lastindexof */ \
CPP(StringPrototypeLastIndexOf) \
/* ES6 section 21.1.3.10 String.prototype.localeCompare ( that ) */ \
/* ES6 #sec-string.prototype.localecompare */ \
CPP(StringPrototypeLocaleCompare) \
/* ES6 section 21.1.3.12 String.prototype.normalize ( [form] ) */ \
/* ES6 #sec-string.prototype.normalize */ \
CPP(StringPrototypeNormalize) \
/* ES6 section 21.1.3.16 String.prototype.replace ( search, replace ) */ \
TFJ(StringPrototypeReplace, 2) \
/* ES6 section 21.1.3.19 String.prototype.split ( separator, limit ) */ \
TFJ(StringPrototypeSplit, 2) \
/* ES6 section B.2.3.1 String.prototype.substr ( start, length ) */ \
TFJ(StringPrototypeSubstr, 2) \
/* ES6 section 21.1.3.19 String.prototype.substring ( start, end ) */ \
TFJ(StringPrototypeSubstring, 2) \
/* ES6 section 21.1.3.20 */ \
/* String.prototype.startsWith ( searchString [ , position ] ) */ \
/* ES6 #sec-string.prototype.replace */ \
TFJ(StringPrototypeReplace, 2, kSearch, kReplace) \
/* ES6 #sec-string.prototype.split */ \
TFJ(StringPrototypeSplit, 2, kSeparator, kLimit) \
/* ES6 #sec-string.prototype.substr */ \
TFJ(StringPrototypeSubstr, 2, kStart, kLength) \
/* ES6 #sec-string.prototype.substring */ \
TFJ(StringPrototypeSubstring, 2, kStart, kEnd) \
/* ES6 #sec-string.prototype.startswith */ \
CPP(StringPrototypeStartsWith) \
/* ES6 section 21.1.3.25 String.prototype.toString () */ \
/* ES6 #sec-string.prototype.tostring */ \
TFJ(StringPrototypeToString, 0) \
/* ES #sec-string.prototype.tolocalelowercase */ \
CPP(StringPrototypeToLocaleLowerCase) \
......@@ -822,38 +850,43 @@ class Isolate;
CPP(StringPrototypeTrim) \
CPP(StringPrototypeTrimLeft) \
CPP(StringPrototypeTrimRight) \
/* ES6 section 21.1.3.28 String.prototype.valueOf () */ \
/* ES6 #sec-string.prototype.valueof */ \
TFJ(StringPrototypeValueOf, 0) \
/* ES6 #sec-string.prototype-@@iterator */ \
TFJ(StringPrototypeIterator, 0) \
\
/* StringIterator */ \
/* ES6 #sec-%stringiteratorprototype%.next */ \
TFJ(StringIteratorPrototypeNext, 0) \
\
/* Symbol */ \
CPP(SymbolConstructor) \
CPP(SymbolConstructor_ConstructStub) \
/* ES6 section 19.4.2.1 Symbol.for */ \
/* ES6 #sec-symbol.for */ \
CPP(SymbolFor) \
/* ES6 section 19.4.2.5 Symbol.keyFor */ \
/* ES6 #sec-symbol.keyfor */ \
CPP(SymbolKeyFor) \
/* ES6 section 19.4.3.4 Symbol.prototype [ @@toPrimitive ] ( hint ) */ \
TFJ(SymbolPrototypeToPrimitive, 1) \
/* ES6 section 19.4.3.2 Symbol.prototype.toString ( ) */ \
/* ES6 #sec-symbol.prototype-@@toprimitive */ \
TFJ(SymbolPrototypeToPrimitive, 1, kHint) \
/* ES6 #sec-symbol.prototype.tostring */ \
TFJ(SymbolPrototypeToString, 0) \
/* ES6 section 19.4.3.3 Symbol.prototype.valueOf ( ) */ \
/* ES6 #sec-symbol.prototype.valueof */ \
TFJ(SymbolPrototypeValueOf, 0) \
\
/* TypedArray */ \
TFJ(TypedArrayConstructByArrayBuffer, 5) \
TFJ(TypedArrayConstructByLength, 3) \
TFJ(TypedArrayInitialize, 6) \
/* ES6 #sec-typedarray-buffer-byteoffset-length */ \
TFJ(TypedArrayConstructByArrayBuffer, 5, kHolder, kBuffer, kByteOffset, \
kLength, kElementSize) \
/* ES6 #sec-typedarray-length */ \
TFJ(TypedArrayConstructByLength, 3, kHolder, kLength, kElementSize) \
TFJ(TypedArrayInitialize, 6, kHolder, kLength, kBuffer, kByteOffset, \
kByteLength, kInitialize) \
CPP(TypedArrayPrototypeBuffer) \
/* ES6 section 22.2.3.2 get %TypedArray%.prototype.byteLength */ \
/* ES6 #sec-get-%typedarray%.prototype.bytelength */ \
TFJ(TypedArrayPrototypeByteLength, 0) \
/* ES6 section 22.2.3.3 get %TypedArray%.prototype.byteOffset */ \
/* ES6 #sec-get-%typedarray%.prototype.byteoffset */ \
TFJ(TypedArrayPrototypeByteOffset, 0) \
/* ES6 section 22.2.3.18 get %TypedArray%.prototype.length */ \
/* ES6 #sec-get-%typedarray%.prototype.length */ \
TFJ(TypedArrayPrototypeLength, 0) \
/* ES6 #sec-%typedarray%.prototype.entries */ \
TFJ(TypedArrayPrototypeEntries, 0) \
......@@ -891,13 +924,15 @@ class Isolate;
/* Async-from-Sync Iterator */ \
\
/* %AsyncFromSyncIteratorPrototype% */ \
/* (proposal-async-iteration/#sec-%asyncfromsynciteratorprototype%-object)*/ \
TFJ(AsyncFromSyncIteratorPrototypeNext, 1) \
TFJ(AsyncFromSyncIteratorPrototypeThrow, 1) \
TFJ(AsyncFromSyncIteratorPrototypeReturn, 1) \
\
/* proposal-async-iteration/#sec-async-iterator-value-unwrap-functions */ \
TFJ(AsyncIteratorValueUnwrap, 1)
/* See tc39.github.io/proposal-async-iteration/ */ \
/* #sec-%asyncfromsynciteratorprototype%-object) */ \
TFJ(AsyncFromSyncIteratorPrototypeNext, 1, kValue) \
/* #sec-%asyncfromsynciteratorprototype%.throw */ \
TFJ(AsyncFromSyncIteratorPrototypeThrow, 1, kReason) \
/* #sec-%asyncfromsynciteratorprototype%.return */ \
TFJ(AsyncFromSyncIteratorPrototypeReturn, 1, kValue) \
/* #sec-async-iterator-value-unwrap-functions */ \
TFJ(AsyncIteratorValueUnwrap, 1, kValue)
#define BUILTIN_PROMISE_REJECTION_PREDICTION_LIST(V) \
V(AsyncFromSyncIteratorPrototypeNext) \
......
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