[cleanup] Refactor usages of builtin callables

This completes refactoring started in 0a355777c3.

Bug: v8:6474
Change-Id: Ia2ea66e10e4f1d55551fe145f67f4021ae254b23
Reviewed-on: https://chromium-review.googlesource.com/532997
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45934}
This commit is contained in:
jgruber 2017-06-14 07:58:32 +02:00 committed by Commit Bot
parent 84ed74f420
commit 68699c4733
24 changed files with 154 additions and 248 deletions

View File

@ -226,9 +226,8 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
__ SmiTag(r6);
__ EnterBuiltinFrame(cp, r1, r6);
__ Push(r2); // first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(r2);
__ LeaveBuiltinFrame(cp, r1, r6);
__ SmiUntag(r6);
@ -375,9 +374,8 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
__ SmiTag(r6);
__ EnterBuiltinFrame(cp, r1, r6);
__ Push(r2); // first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(r2);
__ LeaveBuiltinFrame(cp, r1, r6);
__ SmiUntag(r6);
@ -552,9 +550,8 @@ void Generate_JSConstructStubGeneric(MacroAssembler* masm,
// If not derived class constructor: Allocate the new receiver object.
__ IncrementCounter(masm->isolate()->counters()->constructed_objects(), 1,
r4, r5);
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ b(&post_instantiation_deopt_entry);
// Else: use TheHoleValue as receiver for constructor call

View File

@ -227,9 +227,8 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
__ SmiTag(x6);
__ EnterBuiltinFrame(cp, x1, x6);
__ Push(x2); // first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(x2);
__ LeaveBuiltinFrame(cp, x1, x6);
__ SmiUntag(x6);
@ -380,9 +379,8 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
__ SmiTag(x6);
__ EnterBuiltinFrame(cp, x1, x6);
__ Push(x2); // first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(x2);
__ LeaveBuiltinFrame(cp, x1, x6);
__ SmiUntag(x6);
@ -564,9 +562,8 @@ void Generate_JSConstructStubGeneric(MacroAssembler* masm,
// If not derived class constructor: Allocate the new receiver object.
__ IncrementCounter(masm->isolate()->counters()->constructed_objects(), 1,
x4, x5);
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ B(&post_instantiation_deopt_entry);
// Else: use TheHoleValue as receiver for constructor call

View File

@ -127,9 +127,8 @@ TF_BUILTIN(AsyncIteratorValueUnwrap, AsyncBuiltinsAssembler) {
Node* const done = LoadContextElement(context, ValueUnwrapContext::kDoneSlot);
CSA_ASSERT(this, IsBoolean(done));
Node* const unwrapped_value = CallStub(
Builtins::CallableFor(isolate(), Builtins::kCreateIterResultObject),
context, value, done);
Node* const unwrapped_value =
CallBuiltin(Builtins::kCreateIterResultObject, context, value, done);
Return(unwrapped_value);
}

View File

@ -237,9 +237,8 @@ TF_BUILTIN(AsyncFromSyncIteratorPrototypeReturn,
Node* const promise, Label* if_exception) {
// If return is undefined, then
// Let iterResult be ! CreateIterResultObject(value, true)
Node* const iter_result = CallStub(
Builtins::CallableFor(isolate(), Builtins::kCreateIterResultObject),
context, value, TrueConstant());
Node* const iter_result = CallBuiltin(Builtins::kCreateIterResultObject,
context, value, TrueConstant());
// Perform ! Call(promiseCapability.[[Resolve]], undefined, « iterResult »).
// IfAbruptRejectPromise(nextDone, promiseCapability).

View File

@ -311,9 +311,7 @@ TF_BUILTIN(ToLength, CodeStubAssembler) {
BIND(&if_lenisnotheapnumber);
{
// Need to convert {len} to a Number first.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_len.Bind(CallStub(callable, context, len));
var_len.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, len));
Goto(&loop);
}

View File

@ -69,16 +69,14 @@ void GeneratorBuiltinsAssembler::GeneratorPrototypeResume(
Return(result);
Callable create_iter_result_object =
Builtins::CallableFor(isolate(), Builtins::kCreateIterResultObject);
BIND(&if_final_return);
{
// Close the generator.
StoreObjectFieldNoWriteBarrier(
receiver, JSGeneratorObject::kContinuationOffset, closed);
// Return the wrapped result.
Return(
CallStub(create_iter_result_object, context, result, TrueConstant()));
Return(CallBuiltin(Builtins::kCreateIterResultObject, context, result,
TrueConstant()));
}
BIND(&if_receiverisincompatible);
@ -97,12 +95,12 @@ void GeneratorBuiltinsAssembler::GeneratorPrototypeResume(
Node* result = nullptr;
switch (resume_mode) {
case JSGeneratorObject::kNext:
result = CallStub(create_iter_result_object, context,
UndefinedConstant(), TrueConstant());
result = CallBuiltin(Builtins::kCreateIterResultObject, context,
UndefinedConstant(), TrueConstant());
break;
case JSGeneratorObject::kReturn:
result =
CallStub(create_iter_result_object, context, value, TrueConstant());
result = CallBuiltin(Builtins::kCreateIterResultObject, context, value,
TrueConstant());
break;
case JSGeneratorObject::kThrow:
result = CallRuntime(Runtime::kThrow, context, value);

View File

@ -44,18 +44,16 @@ TF_BUILTIN(GlobalIsFinite, CodeStubAssembler) {
BIND(&if_numisnotheapnumber);
{
// Need to convert {num} to a Number first.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_num.Bind(CallStub(callable, context, num));
var_num.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, num));
Goto(&loop);
}
}
BIND(&return_true);
Return(BooleanConstant(true));
Return(TrueConstant());
BIND(&return_false);
Return(BooleanConstant(false));
Return(FalseConstant());
}
// ES6 #sec-isnan-number
@ -92,18 +90,16 @@ TF_BUILTIN(GlobalIsNaN, CodeStubAssembler) {
BIND(&if_numisnotheapnumber);
{
// Need to convert {num} to a Number first.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_num.Bind(CallStub(callable, context, num));
var_num.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, num));
Goto(&loop);
}
}
BIND(&return_true);
Return(BooleanConstant(true));
Return(TrueConstant());
BIND(&return_false);
Return(BooleanConstant(false));
Return(FalseConstant());
}
} // namespace internal

View File

@ -107,9 +107,7 @@ TF_BUILTIN(MathAbs, CodeStubAssembler) {
BIND(&if_xisnotheapnumber);
{
// Need to convert {x} to a Number first.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_x.Bind(CallStub(callable, context, x));
var_x.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, x));
Goto(&loop);
}
}
@ -155,9 +153,7 @@ void MathBuiltinsAssembler::MathRoundingOperation(
BIND(&if_xisnotheapnumber);
{
// Need to convert {x} to a Number first.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_x.Bind(CallStub(callable, context, x));
var_x.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, x));
Goto(&loop);
}
}
@ -303,9 +299,7 @@ TF_BUILTIN(MathClz32, CodeStubAssembler) {
BIND(&if_xisnotheapnumber);
{
// Need to convert {x} to a Number first.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_x.Bind(CallStub(callable, context, x));
var_x.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, x));
Goto(&loop);
}
}

View File

@ -462,9 +462,8 @@ TF_BUILTIN(Add, CodeStubAssembler) {
BIND(&if_rhsisnotreceiver);
{
// Convert {rhs} to a Number first.
Callable callable = Builtins::CallableFor(
isolate(), Builtins::kNonNumberToNumber);
var_rhs.Bind(CallStub(callable, context, rhs));
var_rhs.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, rhs));
Goto(&loop);
}
}
@ -532,9 +531,8 @@ TF_BUILTIN(Add, CodeStubAssembler) {
BIND(&if_lhsisnotreceiver);
{
// Convert {lhs} to a Number first.
Callable callable = Builtins::CallableFor(
isolate(), Builtins::kNonNumberToNumber);
var_lhs.Bind(CallStub(callable, context, lhs));
var_lhs.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, lhs));
Goto(&loop);
}
}
@ -602,9 +600,8 @@ TF_BUILTIN(Add, CodeStubAssembler) {
BIND(&if_rhsisnotreceiver);
{
// Convert {rhs} to a Number first.
Callable callable = Builtins::CallableFor(
isolate(), Builtins::kNonNumberToNumber);
var_rhs.Bind(CallStub(callable, context, rhs));
var_rhs.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, rhs));
Goto(&loop);
}
}
@ -647,9 +644,8 @@ TF_BUILTIN(Add, CodeStubAssembler) {
BIND(&if_rhsisnotreceiver);
{
// Convert {lhs} to a Number first.
Callable callable = Builtins::CallableFor(
isolate(), Builtins::kNonNumberToNumber);
var_lhs.Bind(CallStub(callable, context, lhs));
var_lhs.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, lhs));
Goto(&loop);
}
}
@ -774,9 +770,7 @@ TF_BUILTIN(Subtract, CodeStubAssembler) {
BIND(&if_rhsisnotnumber);
{
// Convert the {rhs} to a Number first.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_rhs.Bind(CallStub(callable, context, rhs));
var_rhs.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, rhs));
Goto(&loop);
}
}
@ -825,9 +819,8 @@ TF_BUILTIN(Subtract, CodeStubAssembler) {
BIND(&if_rhsisnotnumber);
{
// Convert the {rhs} to a Number first.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_rhs.Bind(CallStub(callable, context, rhs));
var_rhs.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, rhs));
Goto(&loop);
}
}
@ -836,9 +829,7 @@ TF_BUILTIN(Subtract, CodeStubAssembler) {
BIND(&if_lhsisnotnumber);
{
// Convert the {lhs} to a Number first.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_lhs.Bind(CallStub(callable, context, lhs));
var_lhs.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, lhs));
Goto(&loop);
}
}
@ -974,9 +965,7 @@ TF_BUILTIN(Multiply, CodeStubAssembler) {
BIND(&lhs_is_not_number);
{
// Convert {lhs} to a Number and loop.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_lhs.Bind(CallStub(callable, context, lhs));
var_lhs.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, lhs));
Goto(&loop);
}
}
@ -1107,9 +1096,8 @@ TF_BUILTIN(Divide, CodeStubAssembler) {
BIND(&divisor_is_not_number);
{
// Convert {divisor} to a number and loop.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_divisor.Bind(CallStub(callable, context, divisor));
var_divisor.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, divisor));
Goto(&loop);
}
}
@ -1162,9 +1150,8 @@ TF_BUILTIN(Divide, CodeStubAssembler) {
BIND(&divisor_is_not_number);
{
// Convert {divisor} to a number and loop.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_divisor.Bind(CallStub(callable, context, divisor));
var_divisor.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, divisor));
Goto(&loop);
}
}
@ -1173,9 +1160,8 @@ TF_BUILTIN(Divide, CodeStubAssembler) {
BIND(&dividend_is_not_number);
{
// Convert {dividend} to a Number and loop.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_dividend.Bind(CallStub(callable, context, dividend));
var_dividend.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, dividend));
Goto(&loop);
}
}
@ -1256,9 +1242,8 @@ TF_BUILTIN(Modulus, CodeStubAssembler) {
BIND(&divisor_is_not_number);
{
// Convert {divisor} to a number and loop.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_divisor.Bind(CallStub(callable, context, divisor));
var_divisor.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, divisor));
Goto(&loop);
}
}
@ -1311,9 +1296,8 @@ TF_BUILTIN(Modulus, CodeStubAssembler) {
BIND(&divisor_is_not_number);
{
// Convert {divisor} to a number and loop.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_divisor.Bind(CallStub(callable, context, divisor));
var_divisor.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, divisor));
Goto(&loop);
}
}
@ -1322,9 +1306,8 @@ TF_BUILTIN(Modulus, CodeStubAssembler) {
BIND(&dividend_is_not_number);
{
// Convert {dividend} to a Number and loop.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_dividend.Bind(CallStub(callable, context, dividend));
var_dividend.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, dividend));
Goto(&loop);
}
}

View File

@ -1164,9 +1164,6 @@ TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
// Convert {receiver} and {search} to strings.
Callable indexof_callable =
Builtins::CallableFor(isolate(), Builtins::kStringIndexOf);
Node* const subject_string = ToString_Inline(context, receiver);
Node* const search_string = ToString_Inline(context, search);
@ -1203,8 +1200,9 @@ TF_BUILTIN(StringPrototypeReplace, StringBuiltinsAssembler) {
// longer substrings - we can handle up to 8 chars (one-byte) / 4 chars
// (2-byte).
Node* const match_start_index = CallStub(
indexof_callable, context, subject_string, search_string, smi_zero);
Node* const match_start_index =
CallBuiltin(Builtins::kStringIndexOf, context, subject_string,
search_string, smi_zero);
CSA_ASSERT(this, TaggedIsSmi(match_start_index));
// Early exit if no match found.

View File

@ -397,15 +397,6 @@ TF_BUILTIN(TypedArrayConstructByArrayBuffer, TypedArrayBuiltinsAssembler) {
check_length(this), call_init(this), invalid_length(this),
length_undefined(this), length_defined(this);
Callable add = Builtins::CallableFor(isolate(), Builtins::kAdd);
Callable div = Builtins::CallableFor(isolate(), Builtins::kDivide);
Callable equal = Builtins::CallableFor(isolate(), Builtins::kEqual);
Callable greater_than =
Builtins::CallableFor(isolate(), Builtins::kGreaterThan);
Callable less_than = Builtins::CallableFor(isolate(), Builtins::kLessThan);
Callable mod = Builtins::CallableFor(isolate(), Builtins::kModulus);
Callable sub = Builtins::CallableFor(isolate(), Builtins::kSubtract);
GotoIf(IsUndefined(byte_offset), &check_length);
offset.Bind(
@ -423,11 +414,14 @@ TF_BUILTIN(TypedArrayConstructByArrayBuffer, TypedArrayBuiltinsAssembler) {
}
BIND(&offset_not_smi);
{
GotoIf(IsTrue(CallStub(less_than, context, offset.value(), SmiConstant(0))),
GotoIf(IsTrue(CallBuiltin(Builtins::kLessThan, context, offset.value(),
SmiConstant(0))),
&invalid_length);
Node* remainder = CallStub(mod, context, offset.value(), element_size);
Node* remainder =
CallBuiltin(Builtins::kModulus, context, offset.value(), element_size);
// Remainder can be a heap number.
Branch(IsTrue(CallStub(equal, context, remainder, SmiConstant(0))),
Branch(IsTrue(CallBuiltin(Builtins::kEqual, context, remainder,
SmiConstant(0))),
&check_length, &start_offset_error);
}
@ -440,16 +434,18 @@ TF_BUILTIN(TypedArrayConstructByArrayBuffer, TypedArrayBuiltinsAssembler) {
Node* buffer_byte_length =
LoadObjectField(buffer, JSArrayBuffer::kByteLengthOffset);
Node* remainder = CallStub(mod, context, buffer_byte_length, element_size);
Node* remainder = CallBuiltin(Builtins::kModulus, context,
buffer_byte_length, element_size);
// Remainder can be a heap number.
GotoIf(IsFalse(CallStub(equal, context, remainder, SmiConstant(0))),
GotoIf(IsFalse(CallBuiltin(Builtins::kEqual, context, remainder,
SmiConstant(0))),
&byte_length_error);
new_byte_length.Bind(
CallStub(sub, context, buffer_byte_length, offset.value()));
new_byte_length.Bind(CallBuiltin(Builtins::kSubtract, context,
buffer_byte_length, offset.value()));
Branch(IsTrue(CallStub(less_than, context, new_byte_length.value(),
SmiConstant(0))),
Branch(IsTrue(CallBuiltin(Builtins::kLessThan, context,
new_byte_length.value(), SmiConstant(0))),
&invalid_offset_error, &call_init);
}
@ -462,16 +458,18 @@ TF_BUILTIN(TypedArrayConstructByArrayBuffer, TypedArrayBuiltinsAssembler) {
Node* buffer_byte_length =
LoadObjectField(buffer, JSArrayBuffer::kByteLengthOffset);
Node* end = CallStub(add, context, offset.value(), new_byte_length.value());
Node* end = CallBuiltin(Builtins::kAdd, context, offset.value(),
new_byte_length.value());
Branch(IsTrue(CallStub(greater_than, context, end, buffer_byte_length)),
Branch(IsTrue(CallBuiltin(Builtins::kGreaterThan, context, end,
buffer_byte_length)),
&invalid_length, &call_init);
}
BIND(&call_init);
{
Node* new_length =
CallStub(div, context, new_byte_length.value(), element_size);
Node* new_length = CallBuiltin(Builtins::kDivide, context,
new_byte_length.value(), element_size);
// Force the result into a Smi, or throw a range error if it doesn't fit.
new_length = ToSmiIndex(new_length, context, &invalid_length);

View File

@ -217,9 +217,8 @@ void Generate_JSConstructStubGeneric(MacroAssembler* masm,
// If not derived class constructor: Allocate the new receiver object.
__ IncrementCounter(masm->isolate()->counters()->constructed_objects(), 1);
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ jmp(&post_instantiation_deopt_entry, Label::kNear);
// Else: use TheHoleValue as receiver for constructor call
@ -2007,9 +2006,8 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
FrameScope scope(masm, StackFrame::MANUAL);
__ EnterBuiltinFrame(esi, edi, ecx);
__ Push(ebx); // the first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(FieldOperand(eax, JSValue::kValueOffset));
__ LeaveBuiltinFrame(esi, edi, ecx);
}
@ -2171,9 +2169,8 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
__ SmiTag(ebx);
__ EnterBuiltinFrame(esi, edi, ebx);
__ Push(eax); // the first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(FieldOperand(eax, JSValue::kValueOffset));
__ LeaveBuiltinFrame(esi, edi, ebx);
__ SmiUntag(ebx);

View File

@ -227,9 +227,8 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
__ SmiTag(t0);
__ EnterBuiltinFrame(cp, a1, t0);
__ Push(a0); // first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(a0);
__ LeaveBuiltinFrame(cp, a1, t0);
__ SmiUntag(t0);
@ -379,9 +378,8 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
__ SmiTag(t0);
__ EnterBuiltinFrame(cp, a1, t0);
__ Push(a0); // first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(a0);
__ LeaveBuiltinFrame(cp, a1, t0);
__ SmiUntag(t0);
@ -546,9 +544,8 @@ void Generate_JSConstructStubGeneric(MacroAssembler* masm,
// If not derived class constructor: Allocate the new receiver object.
__ IncrementCounter(masm->isolate()->counters()->constructed_objects(), 1,
t2, t3);
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Branch(&post_instantiation_deopt_entry);
// Else: use TheHoleValue as receiver for constructor call

View File

@ -228,9 +228,8 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
__ SmiTag(t0);
__ EnterBuiltinFrame(cp, a1, t0);
__ Push(a0);
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(a0);
__ LeaveBuiltinFrame(cp, a1, t0);
__ SmiUntag(t0);
@ -381,9 +380,8 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
__ SmiTag(t0);
__ EnterBuiltinFrame(cp, a1, t0);
__ Push(a0);
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(a0);
__ LeaveBuiltinFrame(cp, a1, t0);
__ SmiUntag(t0);
@ -550,9 +548,8 @@ void Generate_JSConstructStubGeneric(MacroAssembler* masm,
// If not derived class constructor: Allocate the new receiver object.
__ IncrementCounter(masm->isolate()->counters()->constructed_objects(), 1,
t2, t3);
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Branch(&post_instantiation_deopt_entry);
// Else: use TheHoleValue as receiver for constructor call

View File

@ -227,9 +227,8 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
__ SmiTag(r9);
__ EnterBuiltinFrame(cp, r4, r9);
__ Push(r5); // first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(r5);
__ LeaveBuiltinFrame(cp, r4, r9);
__ SmiUntag(r9);
@ -380,9 +379,8 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
__ SmiTag(r9);
__ EnterBuiltinFrame(cp, r4, r9);
__ Push(r5); // first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(r5);
__ LeaveBuiltinFrame(cp, r4, r9);
__ SmiUntag(r9);
@ -560,9 +558,8 @@ void Generate_JSConstructStubGeneric(MacroAssembler* masm,
// If not derived class constructor: Allocate the new receiver object.
__ IncrementCounter(masm->isolate()->counters()->constructed_objects(), 1,
r7, r8);
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ b(&post_instantiation_deopt_entry);
// Else: use TheHoleValue as receiver for constructor call

View File

@ -226,9 +226,8 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
__ SmiTag(r8);
__ EnterBuiltinFrame(cp, r3, r8);
__ Push(r4); // first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(r4);
__ LeaveBuiltinFrame(cp, r3, r8);
__ SmiUntag(r8);
@ -377,9 +376,8 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
__ SmiTag(r8);
__ EnterBuiltinFrame(cp, r3, r8);
__ Push(r4); // first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(r4);
__ LeaveBuiltinFrame(cp, r3, r8);
__ SmiUntag(r8);
@ -551,9 +549,8 @@ void Generate_JSConstructStubGeneric(MacroAssembler* masm,
// If not derived class constructor: Allocate the new receiver object.
__ IncrementCounter(masm->isolate()->counters()->constructed_objects(), 1,
r6, r7);
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ b(&post_instantiation_deopt_entry);
// Else: use TheHoleValue as receiver for constructor call

View File

@ -221,9 +221,8 @@ void Generate_JSConstructStubGeneric(MacroAssembler* masm,
// If not derived class constructor: Allocate the new receiver object.
__ IncrementCounter(masm->isolate()->counters()->constructed_objects(), 1);
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ jmp(&post_instantiation_deopt_entry, Label::kNear);
// Else: use TheHoleValue as receiver for constructor call
@ -1986,9 +1985,8 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
FrameScope scope(masm, StackFrame::MANUAL);
__ EnterBuiltinFrame(rsi, rdi, r8);
__ Push(rbx); // the first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(FieldOperand(rax, JSValue::kValueOffset));
__ LeaveBuiltinFrame(rsi, rdi, r8);
}
@ -2142,9 +2140,8 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
FrameScope scope(masm, StackFrame::MANUAL);
__ EnterBuiltinFrame(rsi, rdi, r8);
__ Push(rbx); // the first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(FieldOperand(rax, JSValue::kValueOffset));
__ LeaveBuiltinFrame(rsi, rdi, r8);
}

View File

@ -1796,9 +1796,8 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
FrameScope scope(masm, StackFrame::MANUAL);
__ EnterBuiltinFrame(esi, edi, ecx);
__ Push(ebx); // the first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(FieldOperand(eax, JSValue::kValueOffset));
__ LeaveBuiltinFrame(esi, edi, ecx);
}
@ -1960,9 +1959,8 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
__ SmiTag(ebx);
__ EnterBuiltinFrame(esi, edi, ebx);
__ Push(eax); // the first argument
__ Call(
Builtins::CallableFor(masm->isolate(), Builtins::kFastNewObject).code(),
RelocInfo::CODE_TARGET);
__ Call(masm->isolate()->builtins()->FastNewObject(),
RelocInfo::CODE_TARGET);
__ Pop(FieldOperand(eax, JSValue::kValueOffset));
__ LeaveBuiltinFrame(esi, edi, ebx);
__ SmiUntag(ebx);

View File

@ -2747,9 +2747,7 @@ Node* CodeStubAssembler::TruncateTaggedToFloat64(Node* context, Node* value) {
BIND(&if_valueisnotnumber);
{
// Convert the {value} to a Number first.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_value.Bind(CallStub(callable, context, value));
var_value.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, value));
Goto(&loop);
}
}
@ -2797,9 +2795,8 @@ Node* CodeStubAssembler::TruncateTaggedToWord32(Node* context, Node* value) {
BIND(&if_valueisnotheapnumber);
{
// Convert the {value} to a Number first.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_value.Bind(CallStub(callable, context, value));
var_value.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, value));
Goto(&loop);
}
}
@ -4764,9 +4761,7 @@ Node* CodeStubAssembler::ToInteger(Node* context, Node* input,
BIND(&if_argisnotheapnumber);
{
// Need to convert {arg} to a Number first.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_arg.Bind(CallStub(callable, context, arg));
var_arg.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, arg));
Goto(&loop);
}
@ -7222,9 +7217,7 @@ Node* CodeStubAssembler::RelationalComparison(RelationalComparisonMode mode,
// dedicated ToPrimitive(rhs, hint Number) operation, as the
// ToNumber(rhs) will by itself already invoke ToPrimitive with
// a Number hint.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_rhs.Bind(CallStub(callable, context, rhs));
var_rhs.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, rhs));
Goto(&loop);
}
}
@ -7269,9 +7262,7 @@ Node* CodeStubAssembler::RelationalComparison(RelationalComparisonMode mode,
// dedicated ToPrimitive(lhs, hint Number) operation, as the
// ToNumber(lhs) will by itself already invoke ToPrimitive with
// a Number hint.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_lhs.Bind(CallStub(callable, context, lhs));
var_lhs.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, lhs));
Goto(&loop);
}
}
@ -7316,9 +7307,8 @@ Node* CodeStubAssembler::RelationalComparison(RelationalComparisonMode mode,
// dedicated ToPrimitive(rhs, hint Number) operation, as the
// ToNumber(rhs) will by itself already invoke ToPrimitive with
// a Number hint.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_rhs.Bind(CallStub(callable, context, rhs));
var_rhs.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, rhs));
Goto(&loop);
}
}
@ -7404,10 +7394,8 @@ Node* CodeStubAssembler::RelationalComparison(RelationalComparisonMode mode,
BIND(&if_rhsisnotreceiver);
{
// Convert both {lhs} and {rhs} to Number.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kToNumber);
var_lhs.Bind(CallStub(callable, context, lhs));
var_rhs.Bind(CallStub(callable, context, rhs));
var_lhs.Bind(CallBuiltin(Builtins::kToNumber, context, lhs));
var_rhs.Bind(CallBuiltin(Builtins::kToNumber, context, rhs));
Goto(&loop);
}
}
@ -7471,10 +7459,8 @@ Node* CodeStubAssembler::RelationalComparison(RelationalComparisonMode mode,
BIND(&if_lhsisnotreceiver);
{
// Convert both {lhs} and {rhs} to Number.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kToNumber);
var_lhs.Bind(CallStub(callable, context, lhs));
var_rhs.Bind(CallStub(callable, context, rhs));
var_lhs.Bind(CallBuiltin(Builtins::kToNumber, context, lhs));
var_rhs.Bind(CallBuiltin(Builtins::kToNumber, context, rhs));
Goto(&loop);
}
}
@ -8120,9 +8106,7 @@ Node* CodeStubAssembler::Equal(Node* lhs, Node* rhs, Node* context,
BIND(&do_rhsstringtonumber);
{
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kStringToNumber);
var_rhs.Bind(CallStub(callable, context, rhs));
var_rhs.Bind(CallBuiltin(Builtins::kStringToNumber, context, rhs));
Goto(&loop);
}
}
@ -8792,9 +8776,8 @@ Node* CodeStubAssembler::InstanceOf(Node* object, Node* callable,
GotoIfNot(IsCallable(callable), &if_notcallable);
// Use the OrdinaryHasInstance algorithm.
Node* result = CallStub(
Builtins::CallableFor(isolate(), Builtins::kOrdinaryHasInstance),
context, callable, object);
Node* result =
CallBuiltin(Builtins::kOrdinaryHasInstance, context, callable, object);
var_result.Bind(result);
Goto(&return_result);
}

View File

@ -210,8 +210,7 @@ void FullCodeGenerator::CallLoadIC(FeedbackSlot slot, Handle<Object> name) {
EmitLoadSlot(LoadDescriptor::SlotRegister(), slot);
Handle<Code> code =
Builtins::CallableFor(isolate(), Builtins::kLoadICTrampoline).code();
Handle<Code> code = isolate()->builtins()->LoadICTrampoline();
__ Call(code, RelocInfo::CODE_TARGET);
RestoreContext();
}
@ -1071,8 +1070,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
EmitLoadSlot(LoadDescriptor::SlotRegister(), prop->PropertyFeedbackSlot());
Handle<Code> code =
Builtins::CallableFor(isolate(), Builtins::kKeyedLoadICTrampoline).code();
Handle<Code> code = isolate()->builtins()->KeyedLoadICTrampoline();
__ Call(code, RelocInfo::CODE_TARGET);
RestoreContext();
}

View File

@ -2328,8 +2328,7 @@ void AccessorAssembler::GenerateLoadICTrampoline() {
Node* context = Parameter(Descriptor::kContext);
Node* vector = LoadFeedbackVectorForStub();
Callable callable = Builtins::CallableFor(isolate(), Builtins::kLoadIC);
TailCallStub(callable, context, receiver, name, slot, vector);
TailCallBuiltin(Builtins::kLoadIC, context, receiver, name, slot, vector);
}
void AccessorAssembler::GenerateLoadICProtoArray(
@ -2418,8 +2417,8 @@ void AccessorAssembler::GenerateKeyedLoadICTrampoline() {
Node* context = Parameter(Descriptor::kContext);
Node* vector = LoadFeedbackVectorForStub();
Callable callable = Builtins::CallableFor(isolate(), Builtins::kKeyedLoadIC);
TailCallStub(callable, context, receiver, name, slot, vector);
TailCallBuiltin(Builtins::kKeyedLoadIC, context, receiver, name, slot,
vector);
}
void AccessorAssembler::GenerateKeyedLoadIC_Megamorphic() {

View File

@ -189,8 +189,7 @@ Node* BinaryOpAssembler::Generate_AddWithFeedback(Node* context, Node* lhs,
BIND(&call_add_stub);
{
Callable callable = Builtins::CallableFor(isolate(), Builtins::kAdd);
var_result.Bind(CallStub(callable, context, lhs, rhs));
var_result.Bind(CallBuiltin(Builtins::kAdd, context, lhs, rhs));
Goto(&end);
}
@ -364,8 +363,7 @@ Node* BinaryOpAssembler::Generate_SubtractWithFeedback(Node* context, Node* lhs,
BIND(&call_subtract_stub);
{
Callable callable = Builtins::CallableFor(isolate(), Builtins::kSubtract);
var_result.Bind(CallStub(callable, context, lhs, rhs));
var_result.Bind(CallBuiltin(Builtins::kSubtract, context, lhs, rhs));
Goto(&end);
}
@ -509,8 +507,7 @@ Node* BinaryOpAssembler::Generate_MultiplyWithFeedback(Node* context, Node* lhs,
BIND(&call_multiply_stub);
{
Callable callable = Builtins::CallableFor(isolate(), Builtins::kMultiply);
var_result.Bind(CallStub(callable, context, lhs, rhs));
var_result.Bind(CallBuiltin(Builtins::kMultiply, context, lhs, rhs));
Goto(&end);
}
@ -666,8 +663,7 @@ Node* BinaryOpAssembler::Generate_DivideWithFeedback(Node* context,
BIND(&call_divide_stub);
{
Callable callable = Builtins::CallableFor(isolate(), Builtins::kDivide);
var_result.Bind(CallStub(callable, context, dividend, divisor));
var_result.Bind(CallBuiltin(Builtins::kDivide, context, dividend, divisor));
Goto(&end);
}
@ -813,8 +809,8 @@ Node* BinaryOpAssembler::Generate_ModulusWithFeedback(Node* context,
BIND(&call_modulus_stub);
{
Callable callable = Builtins::CallableFor(isolate(), Builtins::kModulus);
var_result.Bind(CallStub(callable, context, dividend, divisor));
var_result.Bind(
CallBuiltin(Builtins::kModulus, context, dividend, divisor));
Goto(&end);
}

View File

@ -1254,9 +1254,8 @@ Node* InterpreterAssembler::TruncateTaggedToWord32WithFeedback(
BIND(&if_valueisnotoddball);
{
// Convert the {value} to a Number first.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_value.Bind(CallStub(callable, context, value));
var_value.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, value));
var_type_feedback->Bind(SmiConstant(BinaryOperationFeedback::kAny));
Goto(&loop);
}

View File

@ -1441,9 +1441,7 @@ IGNITION_HANDLER(ToNumber, InterpreterAssembler) {
BIND(&if_objectisother);
{
// Convert the {object} to a Number.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_result.Bind(CallStub(callable, context, object));
var_result.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, object));
var_type_feedback.Bind(SmiConstant(BinaryOperationFeedback::kAny));
Goto(&if_done);
}
@ -1612,10 +1610,9 @@ IGNITION_HANDLER(Inc, InterpreterAssembler) {
BIND(&if_valuenotoddball);
{
// Convert to a Number first and try again.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_type_feedback.Bind(SmiConstant(BinaryOperationFeedback::kAny));
value_var.Bind(CallStub(callable, context, value));
value_var.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, value));
Goto(&start);
}
}
@ -1736,10 +1733,9 @@ IGNITION_HANDLER(Dec, InterpreterAssembler) {
BIND(&if_valuenotoddball);
{
// Convert to a Number first and try again.
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kNonNumberToNumber);
var_type_feedback.Bind(SmiConstant(BinaryOperationFeedback::kAny));
value_var.Bind(CallStub(callable, context, value));
value_var.Bind(
CallBuiltin(Builtins::kNonNumberToNumber, context, value));
Goto(&start);
}
}
@ -3338,9 +3334,7 @@ IGNITION_HANDLER(ForInNext, InterpreterAssembler) {
// Need to filter the {key} for the {receiver}.
Node* context = GetContext();
Callable callable =
Builtins::CallableFor(isolate(), Builtins::kForInFilter);
Node* result = CallStub(callable, context, key, receiver);
Node* result = CallBuiltin(Builtins::kForInFilter, context, key, receiver);
SetAccumulator(result);
Dispatch();
}