[builtins] move builtin files to src/builtins/.

R=bmeurer@chromium.org
BUG=v8:5197

Review-Url: https://codereview.chromium.org/2145023002
Cr-Commit-Position: refs/heads/master@{#37740}
This commit is contained in:
yangguo 2016-07-13 23:26:03 -07:00 committed by Commit bot
parent d23c8a17d6
commit c8a0c0bdad
29 changed files with 258 additions and 765 deletions

View File

@ -835,8 +835,8 @@ v8_source_set("v8_base") {
"src/bit-vector.h",
"src/bootstrapper.cc",
"src/bootstrapper.h",
"src/builtins.cc",
"src/builtins.h",
"src/builtins/builtins.cc",
"src/builtins/builtins.h",
"src/cached-powers.cc",
"src/cached-powers.h",
"src/cancelable-task.cc",
@ -1571,6 +1571,7 @@ v8_source_set("v8_base") {
if (v8_target_cpu == "x86") {
sources += [
"src/builtins/ia32/builtins-ia32.cc",
"src/compiler/ia32/code-generator-ia32.cc",
"src/compiler/ia32/instruction-codes-ia32.h",
"src/compiler/ia32/instruction-scheduler-ia32.cc",
@ -1586,7 +1587,6 @@ v8_source_set("v8_base") {
"src/ia32/assembler-ia32-inl.h",
"src/ia32/assembler-ia32.cc",
"src/ia32/assembler-ia32.h",
"src/ia32/builtins-ia32.cc",
"src/ia32/code-stubs-ia32.cc",
"src/ia32/code-stubs-ia32.h",
"src/ia32/codegen-ia32.cc",
@ -1609,6 +1609,7 @@ v8_source_set("v8_base") {
]
} else if (v8_target_cpu == "x64") {
sources += [
"src/builtins/x64/builtins-x64.cc",
"src/compiler/x64/code-generator-x64.cc",
"src/compiler/x64/instruction-codes-x64.h",
"src/compiler/x64/instruction-scheduler-x64.cc",
@ -1631,7 +1632,6 @@ v8_source_set("v8_base") {
"src/x64/assembler-x64-inl.h",
"src/x64/assembler-x64.cc",
"src/x64/assembler-x64.h",
"src/x64/builtins-x64.cc",
"src/x64/code-stubs-x64.cc",
"src/x64/code-stubs-x64.h",
"src/x64/codegen-x64.cc",
@ -1650,7 +1650,6 @@ v8_source_set("v8_base") {
"src/arm/assembler-arm-inl.h",
"src/arm/assembler-arm.cc",
"src/arm/assembler-arm.h",
"src/arm/builtins-arm.cc",
"src/arm/code-stubs-arm.cc",
"src/arm/code-stubs-arm.h",
"src/arm/codegen-arm.cc",
@ -1668,6 +1667,7 @@ v8_source_set("v8_base") {
"src/arm/macro-assembler-arm.h",
"src/arm/simulator-arm.cc",
"src/arm/simulator-arm.h",
"src/builtins/arm/builtins-arm.cc",
"src/compiler/arm/code-generator-arm.cc",
"src/compiler/arm/instruction-codes-arm.h",
"src/compiler/arm/instruction-scheduler-arm.cc",
@ -1693,7 +1693,6 @@ v8_source_set("v8_base") {
"src/arm64/assembler-arm64-inl.h",
"src/arm64/assembler-arm64.cc",
"src/arm64/assembler-arm64.h",
"src/arm64/builtins-arm64.cc",
"src/arm64/code-stubs-arm64.cc",
"src/arm64/code-stubs-arm64.h",
"src/arm64/codegen-arm64.cc",
@ -1721,6 +1720,7 @@ v8_source_set("v8_base") {
"src/arm64/simulator-arm64.h",
"src/arm64/utils-arm64.cc",
"src/arm64/utils-arm64.h",
"src/builtins/arm64/builtins-arm64.cc",
"src/compiler/arm64/code-generator-arm64.cc",
"src/compiler/arm64/instruction-codes-arm64.h",
"src/compiler/arm64/instruction-scheduler-arm64.cc",
@ -1746,6 +1746,7 @@ v8_source_set("v8_base") {
]
} else if (v8_target_cpu == "mipsel") {
sources += [
"src/builtins/mips/builtins-mips.cc",
"src/compiler/mips/code-generator-mips.cc",
"src/compiler/mips/instruction-codes-mips.h",
"src/compiler/mips/instruction-scheduler-mips.cc",
@ -1766,7 +1767,6 @@ v8_source_set("v8_base") {
"src/mips/assembler-mips-inl.h",
"src/mips/assembler-mips.cc",
"src/mips/assembler-mips.h",
"src/mips/builtins-mips.cc",
"src/mips/code-stubs-mips.cc",
"src/mips/code-stubs-mips.h",
"src/mips/codegen-mips.cc",
@ -1788,6 +1788,7 @@ v8_source_set("v8_base") {
]
} else if (v8_target_cpu == "mips64el") {
sources += [
"src/builtins/mips64/builtins-mips64.cc",
"src/compiler/mips64/code-generator-mips64.cc",
"src/compiler/mips64/instruction-codes-mips64.h",
"src/compiler/mips64/instruction-scheduler-mips64.cc",
@ -1808,7 +1809,6 @@ v8_source_set("v8_base") {
"src/mips64/assembler-mips64-inl.h",
"src/mips64/assembler-mips64.cc",
"src/mips64/assembler-mips64.h",
"src/mips64/builtins-mips64.cc",
"src/mips64/code-stubs-mips64.cc",
"src/mips64/code-stubs-mips64.h",
"src/mips64/codegen-mips64.cc",
@ -1830,6 +1830,7 @@ v8_source_set("v8_base") {
]
} else if (v8_target_cpu == "s390" || v8_target_cpu == "s390x") {
sources += [
"src/builtins/s390/builtins-s390.cc",
"src/compiler/s390/code-generator-s390.cc",
"src/compiler/s390/instruction-codes-s390.h",
"src/compiler/s390/instruction-scheduler-s390.cc",
@ -1852,7 +1853,6 @@ v8_source_set("v8_base") {
"src/s390/assembler-s390-inl.h",
"src/s390/assembler-s390.cc",
"src/s390/assembler-s390.h",
"src/s390/builtins-s390.cc",
"src/s390/code-stubs-s390.cc",
"src/s390/code-stubs-s390.h",
"src/s390/codegen-s390.cc",

View File

@ -43,7 +43,6 @@
#include "src/base/lazy-instance.h"
#include "src/base/platform/platform.h"
#include "src/base/utils/random-number-generator.h"
#include "src/builtins.h"
#include "src/codegen.h"
#include "src/counters.h"
#include "src/debug/debug.h"

View File

@ -36,7 +36,7 @@
#define V8_ASSEMBLER_H_
#include "src/allocation.h"
#include "src/builtins.h"
#include "src/builtins/builtins.h"
#include "src/isolate.h"
#include "src/log.h"
#include "src/register-configuration.h"

View File

@ -9,7 +9,7 @@
#include "src/ast/prettyprinter.h"
#include "src/ast/scopes.h"
#include "src/base/hashmap.h"
#include "src/builtins.h"
#include "src/builtins/builtins.h"
#include "src/code-stubs.h"
#include "src/contexts.h"
#include "src/conversions.h"

View File

@ -13,7 +13,6 @@
namespace v8 {
namespace internal {
#define __ ACCESS_MASM(masm)
void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
@ -49,7 +48,6 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
exit_frame_type == BUILTIN_EXIT);
}
// Load the built-in InternalArray function from the current context.
static void GenerateLoadInternalArrayFunction(MacroAssembler* masm,
Register result) {
@ -57,14 +55,12 @@ static void GenerateLoadInternalArrayFunction(MacroAssembler* masm,
__ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result);
}
// Load the built-in Array function from the current context.
static void GenerateLoadArrayFunction(MacroAssembler* masm, Register result) {
// Load the Array function from the current native context.
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, result);
}
void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r0 : number of arguments
@ -92,7 +88,6 @@ void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r0 : number of arguments
@ -121,7 +116,6 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
// static
void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
// ----------- S t a t e -------------
@ -270,7 +264,6 @@ void Builtins::Generate_NumberConstructor(MacroAssembler* masm) {
__ Ret(1);
}
// static
void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -351,7 +344,6 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -420,7 +412,6 @@ void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -503,7 +494,6 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
}
}
static void GenerateTailCallToSharedCode(MacroAssembler* masm) {
__ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
__ ldr(r2, FieldMemOperand(r2, SharedFunctionInfo::kCodeOffset));
@ -542,7 +532,6 @@ static void GenerateTailCallToReturnedCode(MacroAssembler* masm,
__ Jump(r2);
}
void Builtins::Generate_InOptimizationQueue(MacroAssembler* masm) {
// Checking whether the queued function is ready for install is optional,
// since we come across interrupts and stack checks elsewhere. However,
@ -560,7 +549,6 @@ void Builtins::Generate_InOptimizationQueue(MacroAssembler* masm) {
GenerateTailCallToSharedCode(masm);
}
static void Generate_JSConstructStubHelper(MacroAssembler* masm,
bool is_api_function,
bool create_implicit_receiver,
@ -715,22 +703,18 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ Jump(lr);
}
void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, true, false);
}
void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, true, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStubForDerived(
MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, true);
@ -818,8 +802,8 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
// New-style (ignition/turbofan) generator object
{
__ ldr(r0, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
__ ldr(r0,
FieldMemOperand(r0, SharedFunctionInfo::kFormalParameterCountOffset));
__ ldr(r0, FieldMemOperand(
r0, SharedFunctionInfo::kFormalParameterCountOffset));
__ SmiUntag(r0);
// We abuse new.target both to indicate that this is a resume call and to
// pass in the generator object. In ordinary calls, new.target is always
@ -900,10 +884,8 @@ void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) {
__ CallRuntime(Runtime::kThrowConstructedNonConstructable);
}
enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt };
// Clobbers r2; preserves all other registers.
static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
IsTagged argc_is_tagged) {
@ -930,7 +912,6 @@ static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
__ bind(&okay);
}
static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
bool is_construct) {
// Called from Generate_JS_Entry
@ -974,8 +955,8 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
__ b(&entry);
__ bind(&loop);
__ ldr(r0, MemOperand(r4, kPointerSize, PostIndex)); // read next parameter
__ ldr(r0, MemOperand(r0)); // dereference handle
__ push(r0); // push parameter
__ ldr(r0, MemOperand(r0)); // dereference handle
__ push(r0); // push parameter
__ bind(&entry);
__ cmp(r4, r2);
__ b(ne, &loop);
@ -1011,12 +992,10 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
// r0: result
}
void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, false);
}
void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, true);
}
@ -1473,7 +1452,6 @@ void Builtins::Generate_CompileOptimized(MacroAssembler* masm) {
Runtime::kCompileOptimized_NotConcurrent);
}
void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) {
GenerateTailCallToReturnedCode(masm, Runtime::kCompileOptimized_Concurrent);
}
@ -1543,19 +1521,18 @@ static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
__ mov(pc, r0);
}
#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \
void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
} \
void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
}
#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \
void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
} \
void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
}
CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR)
#undef DEFINE_CODE_AGE_BUILTIN_GENERATOR
void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
// For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact
// that make_code_young doesn't do any garbage collection which allows us to
@ -1571,8 +1548,9 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
__ stm(db_w, sp, r0.bit() | r1.bit() | r3.bit() | fp.bit() | lr.bit());
__ PrepareCallCFunction(2, 0, r2);
__ mov(r1, Operand(ExternalReference::isolate_address(masm->isolate())));
__ CallCFunction(ExternalReference::get_mark_code_as_executed_function(
masm->isolate()), 2);
__ CallCFunction(
ExternalReference::get_mark_code_as_executed_function(masm->isolate()),
2);
__ ldm(ia_w, sp, r0.bit() | r1.bit() | r3.bit() | fp.bit() | lr.bit());
// Perform prologue operations usually performed by the young code stub.
@ -1583,17 +1561,14 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
__ mov(pc, r0);
}
void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) {
GenerateMakeCodeYoungAgainCommon(masm);
}
void Builtins::Generate_MarkCodeAsToBeExecutedOnce(MacroAssembler* masm) {
Generate_MarkCodeAsExecutedOnce(masm);
}
static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
SaveFPRegsMode save_doubles) {
{
@ -1609,20 +1584,17 @@ static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
}
__ add(sp, sp, Operand(kPointerSize)); // Ignore state
__ mov(pc, lr); // Jump to miss handler
__ mov(pc, lr); // Jump to miss handler
}
void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs);
}
void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kSaveFPRegs);
}
static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
Deoptimizer::BailoutType type) {
{
@ -1657,22 +1629,18 @@ static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
__ stop("no cases left");
}
void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
}
void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::SOFT);
}
void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
}
static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
Register function_template_info,
Register scratch0, Register scratch1,
@ -1736,7 +1704,6 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
__ bind(&receiver_check_passed);
}
void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r0 : number of arguments excluding receiver
@ -1772,7 +1739,6 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kThrowIllegalInvocation);
}
void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ ldr(r0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
@ -1795,7 +1761,8 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// <deopt_data> = <code>[#deoptimization_data_offset]
__ ldr(r1, FieldMemOperand(r0, Code::kDeoptimizationDataOffset));
{ ConstantPoolUnavailableScope constant_pool_unavailable(masm);
{
ConstantPoolUnavailableScope constant_pool_unavailable(masm);
__ add(r0, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); // Code start
if (FLAG_enable_embedded_constant_pool) {
@ -1804,8 +1771,9 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// Load the OSR entrypoint offset from the deoptimization data.
// <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset]
__ ldr(r1, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(
DeoptimizationInputData::kOsrPcOffsetIndex)));
__ ldr(r1, FieldMemOperand(
r1, FixedArray::OffsetOfElementAt(
DeoptimizationInputData::kOsrPcOffsetIndex)));
// Compute the target address = code start + osr_offset
__ add(lr, r0, Operand::SmiUntag(r1));
@ -1815,7 +1783,6 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
int field_index) {
@ -1936,7 +1903,6 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
// 1. Make sure we have at least one argument.
@ -1980,7 +1946,6 @@ void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
__ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
}
void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r0 : argc
@ -2035,7 +2000,6 @@ void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
}
}
void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r0 : argc
@ -2105,7 +2069,6 @@ void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
}
}
static void ArgumentAdaptorStackCheck(MacroAssembler* masm,
Label* stack_overflow) {
// ----------- S t a t e -------------
@ -2126,7 +2089,6 @@ static void ArgumentAdaptorStackCheck(MacroAssembler* masm,
__ b(le, stack_overflow); // Signed comparison.
}
static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
__ SmiTag(r0);
__ mov(r4, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
@ -2137,7 +2099,6 @@ static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
Operand(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize));
}
static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r0 : result being passed through
@ -2152,7 +2113,6 @@ static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
__ add(sp, sp, Operand(kPointerSize)); // adjust for receiver
}
// static
void Builtins::Generate_Apply(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2476,7 +2436,6 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
}
}
namespace {
void Generate_PushBoundArguments(MacroAssembler* masm) {
@ -2555,7 +2514,6 @@ void Generate_PushBoundArguments(MacroAssembler* masm) {
} // namespace
// static
void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
TailCallMode tail_call_mode) {
@ -2584,7 +2542,6 @@ void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
__ add(pc, ip, Operand(Code::kHeaderSize - kHeapObjectTag));
}
// static
void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
TailCallMode tail_call_mode) {
@ -2645,7 +2602,6 @@ void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
}
}
// static
void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2666,7 +2622,6 @@ void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
__ add(pc, r4, Operand(Code::kHeaderSize - kHeapObjectTag));
}
// static
void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2691,7 +2646,6 @@ void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
__ add(pc, ip, Operand(Code::kHeaderSize - kHeapObjectTag));
}
// static
void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2711,7 +2665,6 @@ void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
ExternalReference(Runtime::kJSProxyConstruct, masm->isolate()));
}
// static
void Builtins::Generate_Construct(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2963,7 +2916,6 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
LeaveArgumentsAdaptorFrame(masm);
__ Jump(lr);
// -------------------------------------------
// Dont adapt arguments.
// -------------------------------------------
@ -2979,7 +2931,6 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
}
}
#undef __
} // namespace internal

View File

@ -14,17 +14,14 @@
namespace v8 {
namespace internal {
#define __ ACCESS_MASM(masm)
// Load the built-in Array function from the current context.
static void GenerateLoadArrayFunction(MacroAssembler* masm, Register result) {
// Load the InternalArray function from the native context.
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, result);
}
// Load the built-in InternalArray function from the current context.
static void GenerateLoadInternalArrayFunction(MacroAssembler* masm,
Register result) {
@ -65,7 +62,6 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
exit_frame_type == BUILTIN_EXIT);
}
void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- x0 : number of arguments
@ -93,7 +89,6 @@ void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- x0 : number of arguments
@ -122,7 +117,6 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
// static
void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
// ----------- S t a t e -------------
@ -259,7 +253,6 @@ void Builtins::Generate_NumberConstructor(MacroAssembler* masm) {
__ Ret();
}
// static
void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -341,7 +334,6 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -413,7 +405,6 @@ void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -530,7 +521,6 @@ static void GenerateTailCallToReturnedCode(MacroAssembler* masm,
__ Br(x2);
}
void Builtins::Generate_InOptimizationQueue(MacroAssembler* masm) {
// Checking whether the queued function is ready for install is optional,
// since we come across interrupts and stack checks elsewhere. However, not
@ -547,7 +537,6 @@ void Builtins::Generate_InOptimizationQueue(MacroAssembler* masm) {
GenerateTailCallToSharedCode(masm);
}
static void Generate_JSConstructStubHelper(MacroAssembler* masm,
bool is_api_function,
bool create_implicit_receiver,
@ -716,28 +705,23 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ Ret();
}
void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, true, false);
}
void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, true, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStubForDerived(
MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, true);
}
void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) {
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(x1);
@ -818,8 +802,8 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
// New-style (ignition/turbofan) generator object
{
__ Ldr(x0, FieldMemOperand(x4, JSFunction::kSharedFunctionInfoOffset));
__ Ldr(w0,
FieldMemOperand(x0, SharedFunctionInfo::kFormalParameterCountOffset));
__ Ldr(w0, FieldMemOperand(
x0, SharedFunctionInfo::kFormalParameterCountOffset));
// We abuse new.target both to indicate that this is a resume call and to
// pass in the generator object. In ordinary calls, new.target is always
// undefined because generator functions are non-constructable.
@ -863,8 +847,8 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
__ Ldr(x10, FieldMemOperand(x4, JSFunction::kSharedFunctionInfoOffset));
__ Ldr(x10, FieldMemOperand(x10, SharedFunctionInfo::kCodeOffset));
__ Add(x10, x10, Code::kHeaderSize - kHeapObjectTag);
__ Ldrsw(x11,
UntagSmiFieldMemOperand(x1, JSGeneratorObject::kContinuationOffset));
__ Ldrsw(x11, UntagSmiFieldMemOperand(
x1, JSGeneratorObject::kContinuationOffset));
__ Add(x10, x10, x11);
__ Mov(x12, Smi::FromInt(JSGeneratorObject::kGeneratorExecuting));
__ Str(x12, FieldMemOperand(x1, JSGeneratorObject::kContinuationOffset));
@ -895,7 +879,6 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt };
// Clobbers x10, x15; preserves all other registers.
static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
IsTagged argc_is_tagged) {
@ -925,7 +908,6 @@ static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
__ Bind(&enough_stack_space);
}
// Input:
// x0: new.target.
// x1: function.
@ -975,7 +957,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
__ Bind(&loop);
__ Ldr(x11, MemOperand(argv, kPointerSize, PostIndex));
__ Ldr(x12, MemOperand(x11)); // Dereference the handle.
__ Push(x12); // Push the argument.
__ Push(x12); // Push the argument.
__ Bind(&entry);
__ Cmp(scratch, argv);
__ B(ne, &loop);
@ -1015,12 +997,10 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
__ Ret();
}
void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, false);
}
void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, true);
}
@ -1471,7 +1451,6 @@ void Builtins::Generate_CompileOptimized(MacroAssembler* masm) {
Runtime::kCompileOptimized_NotConcurrent);
}
void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) {
GenerateTailCallToReturnedCode(masm, Runtime::kCompileOptimized_Concurrent);
}
@ -1542,19 +1521,18 @@ static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
__ Br(x0);
}
#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \
void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
} \
void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
}
#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \
void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
} \
void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
}
CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR)
#undef DEFINE_CODE_AGE_BUILTIN_GENERATOR
void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
// For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact
// that make_code_young doesn't do any garbage collection which allows us to
@ -1574,8 +1552,8 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
__ Push(x0, x1, x3, fp, lr);
__ Mov(x1, ExternalReference::isolate_address(masm->isolate()));
__ CallCFunction(
ExternalReference::get_mark_code_as_executed_function(
masm->isolate()), 2);
ExternalReference::get_mark_code_as_executed_function(masm->isolate()),
2);
__ Pop(lr, fp, x3, x1, x0);
// Perform prologue operations usually performed by the young code stub.
@ -1587,17 +1565,14 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
__ Br(x0);
}
void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) {
GenerateMakeCodeYoungAgainCommon(masm);
}
void Builtins::Generate_MarkCodeAsToBeExecutedOnce(MacroAssembler* masm) {
Generate_MarkCodeAsExecutedOnce(masm);
}
static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
SaveFPRegsMode save_doubles) {
{
@ -1623,17 +1598,14 @@ static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
__ Br(lr);
}
void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs);
}
void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kSaveFPRegs);
}
static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
Deoptimizer::BailoutType type) {
{
@ -1671,22 +1643,18 @@ static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
__ Abort(kInvalidFullCodegenState);
}
void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
}
void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
}
void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::SOFT);
}
static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
Register function_template_info,
Register scratch0, Register scratch1,
@ -1750,7 +1718,6 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
__ Bind(&receiver_check_passed);
}
void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- x0 : number of arguments excluding receiver
@ -1786,7 +1753,6 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kThrowIllegalInvocation);
}
void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ Ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
@ -1810,8 +1776,9 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// Load the OSR entrypoint offset from the deoptimization data.
// <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset]
__ Ldrsw(w1, UntagSmiFieldMemOperand(x1, FixedArray::OffsetOfElementAt(
DeoptimizationInputData::kOsrPcOffsetIndex)));
__ Ldrsw(w1, UntagSmiFieldMemOperand(
x1, FixedArray::OffsetOfElementAt(
DeoptimizationInputData::kOsrPcOffsetIndex)));
// Compute the target address = code_obj + header_size + osr_offset
// <entry_addr> = <code_obj> + #header_size + <osr_offset>
@ -1822,7 +1789,6 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
__ Ret();
}
// static
void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
int field_index) {
@ -1964,7 +1930,6 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
Register argc = x0;
@ -2011,7 +1976,6 @@ void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
__ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
}
void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- x0 : argc
@ -2082,7 +2046,6 @@ void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
}
}
void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- x0 : argc
@ -2169,7 +2132,6 @@ void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
}
}
static void ArgumentAdaptorStackCheck(MacroAssembler* masm,
Label* stack_overflow) {
// ----------- S t a t e -------------
@ -2191,7 +2153,6 @@ static void ArgumentAdaptorStackCheck(MacroAssembler* masm,
__ B(le, stack_overflow);
}
static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
__ SmiTag(x10, x0);
__ Mov(x11, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
@ -2201,7 +2162,6 @@ static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize);
}
static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- x0 : result being passed through
@ -2216,7 +2176,6 @@ static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
__ Drop(1);
}
// static
void Builtins::Generate_Apply(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2557,7 +2516,6 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
}
}
namespace {
void Generate_PushBoundArguments(MacroAssembler* masm) {
@ -2635,7 +2593,6 @@ void Generate_PushBoundArguments(MacroAssembler* masm) {
} // namespace
// static
void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
TailCallMode tail_call_mode) {
@ -2665,7 +2622,6 @@ void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
__ Br(x12);
}
// static
void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
TailCallMode tail_call_mode) {
@ -2725,7 +2681,6 @@ void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
}
}
// static
void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2747,7 +2702,6 @@ void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
__ Br(x4);
}
// static
void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2778,7 +2732,6 @@ void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
__ Br(x12);
}
// static
void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2798,7 +2751,6 @@ void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
ExternalReference(Runtime::kJSProxyConstruct, masm->isolate()));
}
// static
void Builtins::Generate_Construct(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2961,7 +2913,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
// -- x3 : new target (passed through to callee)
// -----------------------------------
Register argc_actual = x0; // Excluding the receiver.
Register argc_actual = x0; // Excluding the receiver.
Register argc_expected = x2; // Excluding the receiver.
Register function = x1;
Register code_entry = x10;
@ -3002,9 +2954,9 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
Label copy_2_by_2;
__ Bind(&copy_2_by_2);
__ Ldp(scratch1, scratch2,
MemOperand(copy_start, - 2 * kPointerSize, PreIndex));
MemOperand(copy_start, -2 * kPointerSize, PreIndex));
__ Stp(scratch1, scratch2,
MemOperand(copy_to, - 2 * kPointerSize, PreIndex));
MemOperand(copy_to, -2 * kPointerSize, PreIndex));
__ Cmp(copy_start, copy_end);
__ B(hi, &copy_2_by_2);
@ -3032,7 +2984,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
__ Add(copy_from, fp, 3 * kPointerSize);
__ Add(copy_from, copy_from, argc_actual);
__ Mov(copy_to, jssp);
__ Sub(copy_end, copy_to, 1 * kPointerSize); // Adjust for the receiver.
__ Sub(copy_end, copy_to, 1 * kPointerSize); // Adjust for the receiver.
__ Sub(copy_end, copy_end, argc_actual);
// Claim space for the arguments, the receiver, and one extra slot.
@ -3045,9 +2997,9 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
Label copy_2_by_2;
__ Bind(&copy_2_by_2);
__ Ldp(scratch1, scratch2,
MemOperand(copy_from, - 2 * kPointerSize, PreIndex));
MemOperand(copy_from, -2 * kPointerSize, PreIndex));
__ Stp(scratch1, scratch2,
MemOperand(copy_to, - 2 * kPointerSize, PreIndex));
MemOperand(copy_to, -2 * kPointerSize, PreIndex));
__ Cmp(copy_to, copy_end);
__ B(hi, &copy_2_by_2);
@ -3060,7 +3012,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
Label fill;
__ Bind(&fill);
__ Stp(scratch1, scratch1,
MemOperand(copy_to, - 2 * kPointerSize, PreIndex));
MemOperand(copy_to, -2 * kPointerSize, PreIndex));
__ Cmp(copy_to, copy_end);
__ B(hi, &fill);
@ -3097,7 +3049,6 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
}
}
#undef __
} // namespace internal

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/builtins.h"
#include "src/builtins/builtins.h"
#include "src/api-arguments.h"
#include "src/api-natives.h"
@ -43,12 +43,13 @@ class BuiltinArguments : public Arguments {
DCHECK_LE(1, this->length());
}
Object*& operator[] (int index) {
Object*& operator[](int index) {
DCHECK_LT(index, length());
return Arguments::operator[](index);
}
template <class S> Handle<S> at(int index) {
template <class S>
Handle<S> at(int index) {
DCHECK_LT(index, length());
return Arguments::at<S>(index);
}
@ -60,9 +61,7 @@ class BuiltinArguments : public Arguments {
return at<Object>(index);
}
Handle<Object> receiver() {
return Arguments::at<Object>(0);
}
Handle<Object> receiver() { return Arguments::at<Object>(0); }
static const int kNewTargetOffset = 0;
static const int kTargetOffset = 1;
@ -84,7 +83,6 @@ class BuiltinArguments : public Arguments {
int length() const { return Arguments::length() - kNumExtraArgs; }
};
// ----------------------------------------------------------------------------
// Support macro for defining builtins in C++.
// ----------------------------------------------------------------------------
@ -179,7 +177,6 @@ inline bool ClampedToInteger(Isolate* isolate, Object* object, int* out) {
return false;
}
inline bool GetSloppyArgumentsLength(Isolate* isolate, Handle<JSObject> object,
int* out) {
Context* context = *isolate->native_context();
@ -294,7 +291,7 @@ MUST_USE_RESULT static Object* CallJsIntrinsic(Isolate* isolate,
BuiltinArguments args) {
HandleScope handleScope(isolate);
int argc = args.length() - 1;
ScopedVector<Handle<Object> > argv(argc);
ScopedVector<Handle<Object>> argv(argc);
for (int i = 0; i < argc; ++i) {
argv[i] = args.at<Object>(i + 1);
}
@ -303,16 +300,13 @@ MUST_USE_RESULT static Object* CallJsIntrinsic(Isolate* isolate,
Execution::Call(isolate, function, args.receiver(), argc, argv.start()));
}
} // namespace
BUILTIN(Illegal) {
UNREACHABLE();
return isolate->heap()->undefined_value(); // Make compiler happy.
}
BUILTIN(EmptyFunction) { return isolate->heap()->undefined_value(); }
void Builtins::Generate_ArrayIsArray(CodeStubAssembler* assembler) {
@ -465,7 +459,6 @@ BUILTIN(ArrayPop) {
return *result;
}
BUILTIN(ArrayShift) {
HandleScope scope(isolate);
Heap* heap = isolate->heap();
@ -487,7 +480,6 @@ BUILTIN(ArrayShift) {
return *first;
}
BUILTIN(ArrayUnshift) {
HandleScope scope(isolate);
Handle<Object> receiver = args.receiver();
@ -510,7 +502,6 @@ BUILTIN(ArrayUnshift) {
return Smi::FromInt(new_length);
}
BUILTIN(ArraySlice) {
HandleScope scope(isolate);
Handle<Object> receiver = args.receiver();
@ -580,7 +571,6 @@ BUILTIN(ArraySlice) {
return *accessor->Slice(object, actual_start, actual_end);
}
BUILTIN(ArraySplice) {
HandleScope scope(isolate);
Handle<Object> receiver = args.receiver();
@ -641,7 +631,6 @@ BUILTIN(ArraySplice) {
return *result_array;
}
// Array Concat -------------------------------------------------------------
namespace {
@ -817,7 +806,6 @@ class ArrayConcatVisitor {
uint32_t bit_field_;
};
uint32_t EstimateElementCount(Handle<JSArray> array) {
DisallowHeapAllocation no_gc;
uint32_t length = static_cast<uint32_t>(array->length()->Number());
@ -887,7 +875,6 @@ uint32_t EstimateElementCount(Handle<JSArray> array) {
return element_count;
}
// Used for sorting indices in a List<uint32_t>.
int compareUInt32(const uint32_t* ap, const uint32_t* bp) {
uint32_t a = *ap;
@ -895,7 +882,6 @@ int compareUInt32(const uint32_t* ap, const uint32_t* bp) {
return (a == b) ? 0 : (a < b) ? -1 : 1;
}
void CollectElementIndices(Handle<JSObject> object, uint32_t range,
List<uint32_t>* indices) {
Isolate* isolate = object->GetIsolate();
@ -1011,7 +997,6 @@ void CollectElementIndices(Handle<JSObject> object, uint32_t range,
}
}
bool IterateElementsSlow(Isolate* isolate, Handle<JSReceiver> receiver,
uint32_t length, ArrayConcatVisitor* visitor) {
FOR_WITH_HANDLE_SCOPE(isolate, uint32_t, i = 0, i, i < length, ++i, {
@ -1029,7 +1014,6 @@ bool IterateElementsSlow(Isolate* isolate, Handle<JSReceiver> receiver,
return true;
}
/**
* A helper function that visits "array" elements of a JSReceiver in numerical
* order.
@ -1442,7 +1426,6 @@ MaybeHandle<JSArray> Fast_ArrayConcat(Isolate* isolate,
} // namespace
// ES6 22.1.3.1 Array.prototype.concat
BUILTIN(ArrayConcat) {
HandleScope scope(isolate);
@ -1484,7 +1467,6 @@ BUILTIN(ArrayConcat) {
return Slow_ArrayConcat(&args, species, isolate);
}
namespace {
MUST_USE_RESULT Maybe<bool> FastAssign(Handle<JSReceiver> to,
@ -1624,7 +1606,6 @@ BUILTIN(ObjectAssign) {
return *to;
}
// ES6 section 19.1.2.2 Object.create ( O [ , Properties ] )
// TODO(verwaest): Support the common cases with precached map directly in
// an Object.create stub.
@ -1841,21 +1822,19 @@ BUILTIN(ObjectFreeze) {
return *object;
}
// ES section 19.1.2.9 Object.getPrototypeOf ( O )
BUILTIN(ObjectGetPrototypeOf) {
HandleScope scope(isolate);
Handle<Object> object = args.atOrUndefined(isolate, 1);
Handle<JSReceiver> receiver;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, receiver, Object::ToObject(isolate, object));
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver,
Object::ToObject(isolate, object));
RETURN_RESULT_OR_FAILURE(isolate,
JSReceiver::GetPrototype(isolate, receiver));
}
// ES6 section 19.1.2.6 Object.getOwnPropertyDescriptor ( O, P )
BUILTIN(ObjectGetOwnPropertyDescriptor) {
HandleScope scope(isolate);
@ -1879,7 +1858,6 @@ BUILTIN(ObjectGetOwnPropertyDescriptor) {
return *desc.ToObject(isolate);
}
namespace {
Object* GetOwnPropertyKeys(Isolate* isolate, BuiltinArguments args,
@ -1899,19 +1877,16 @@ Object* GetOwnPropertyKeys(Isolate* isolate, BuiltinArguments args,
} // namespace
// ES6 section 19.1.2.7 Object.getOwnPropertyNames ( O )
BUILTIN(ObjectGetOwnPropertyNames) {
return GetOwnPropertyKeys(isolate, args, SKIP_SYMBOLS);
}
// ES6 section 19.1.2.8 Object.getOwnPropertySymbols ( O )
BUILTIN(ObjectGetOwnPropertySymbols) {
return GetOwnPropertyKeys(isolate, args, SKIP_STRINGS);
}
// ES#sec-object.is Object.is ( value1, value2 )
BUILTIN(ObjectIs) {
SealHandleScope shs(isolate);
@ -1921,7 +1896,6 @@ BUILTIN(ObjectIs) {
return isolate->heap()->ToBoolean(value1->SameValue(*value2));
}
// ES6 section 19.1.2.11 Object.isExtensible ( O )
BUILTIN(ObjectIsExtensible) {
HandleScope scope(isolate);
@ -1934,7 +1908,6 @@ BUILTIN(ObjectIsExtensible) {
return isolate->heap()->ToBoolean(result.FromJust());
}
// ES6 section 19.1.2.12 Object.isFrozen ( O )
BUILTIN(ObjectIsFrozen) {
HandleScope scope(isolate);
@ -1947,7 +1920,6 @@ BUILTIN(ObjectIsFrozen) {
return isolate->heap()->ToBoolean(result.FromJust());
}
// ES6 section 19.1.2.13 Object.isSealed ( O )
BUILTIN(ObjectIsSealed) {
HandleScope scope(isolate);
@ -1960,7 +1932,6 @@ BUILTIN(ObjectIsSealed) {
return isolate->heap()->ToBoolean(result.FromJust());
}
// ES6 section 19.1.2.14 Object.keys ( O )
BUILTIN(ObjectKeys) {
HandleScope scope(isolate);
@ -2008,7 +1979,6 @@ BUILTIN(ObjectValues) {
return *isolate->factory()->NewJSArrayWithElements(values);
}
BUILTIN(ObjectEntries) {
HandleScope scope(isolate);
Handle<Object> object = args.atOrUndefined(isolate, 1);
@ -2071,7 +2041,6 @@ BUILTIN(ObjectPreventExtensions) {
return *object;
}
// ES6 section 19.1.2.17 Object.seal ( O )
BUILTIN(ObjectSeal) {
HandleScope scope(isolate);
@ -2169,7 +2138,6 @@ bool CodeGenerationFromStringsAllowed(Isolate* isolate,
}
}
MaybeHandle<JSFunction> CompileString(Handle<Context> context,
Handle<String> source,
ParseRestriction restriction) {
@ -2198,7 +2166,6 @@ MaybeHandle<JSFunction> CompileString(Handle<Context> context,
} // namespace
// ES6 section 18.2.1 eval (x)
BUILTIN(GlobalEval) {
HandleScope scope(isolate);
@ -3033,8 +3000,8 @@ void Generate_GeneratorPrototypeResume(
Node* receiver = assembler->Parameter(0);
Node* value = assembler->Parameter(1);
Node* context = assembler->Parameter(4);
Node* closed = assembler->SmiConstant(
Smi::FromInt(JSGeneratorObject::kGeneratorClosed));
Node* closed =
assembler->SmiConstant(Smi::FromInt(JSGeneratorObject::kGeneratorClosed));
// Check if the {receiver} is actually a JSGeneratorObject.
Label if_receiverisincompatible(assembler, Label::kDeferred);
@ -3158,7 +3125,6 @@ BUILTIN(ReflectDefineProperty) {
return *isolate->factory()->ToBoolean(result.FromJust());
}
// ES6 section 26.1.4 Reflect.deleteProperty
BUILTIN(ReflectDeleteProperty) {
HandleScope scope(isolate);
@ -3183,7 +3149,6 @@ BUILTIN(ReflectDeleteProperty) {
return *isolate->factory()->ToBoolean(result.FromJust());
}
// ES6 section 26.1.6 Reflect.get
BUILTIN(ReflectGet) {
HandleScope scope(isolate);
@ -3207,7 +3172,6 @@ BUILTIN(ReflectGet) {
Handle<JSReceiver>::cast(target)));
}
// ES6 section 26.1.7 Reflect.getOwnPropertyDescriptor
BUILTIN(ReflectGetOwnPropertyDescriptor) {
HandleScope scope(isolate);
@ -3234,7 +3198,6 @@ BUILTIN(ReflectGetOwnPropertyDescriptor) {
return *desc.ToObject(isolate);
}
// ES6 section 26.1.8 Reflect.getPrototypeOf
BUILTIN(ReflectGetPrototypeOf) {
HandleScope scope(isolate);
@ -3252,7 +3215,6 @@ BUILTIN(ReflectGetPrototypeOf) {
JSReceiver::GetPrototype(isolate, receiver));
}
// ES6 section 26.1.9 Reflect.has
BUILTIN(ReflectHas) {
HandleScope scope(isolate);
@ -3277,7 +3239,6 @@ BUILTIN(ReflectHas) {
: isolate->heap()->exception();
}
// ES6 section 26.1.10 Reflect.isExtensible
BUILTIN(ReflectIsExtensible) {
HandleScope scope(isolate);
@ -3297,7 +3258,6 @@ BUILTIN(ReflectIsExtensible) {
return *isolate->factory()->ToBoolean(result.FromJust());
}
// ES6 section 26.1.11 Reflect.ownKeys
BUILTIN(ReflectOwnKeys) {
HandleScope scope(isolate);
@ -3320,7 +3280,6 @@ BUILTIN(ReflectOwnKeys) {
return *isolate->factory()->NewJSArrayWithElements(keys);
}
// ES6 section 26.1.12 Reflect.preventExtensions
BUILTIN(ReflectPreventExtensions) {
HandleScope scope(isolate);
@ -3340,7 +3299,6 @@ BUILTIN(ReflectPreventExtensions) {
return *isolate->factory()->ToBoolean(result.FromJust());
}
// ES6 section 26.1.13 Reflect.set
BUILTIN(ReflectSet) {
HandleScope scope(isolate);
@ -3368,7 +3326,6 @@ BUILTIN(ReflectSet) {
return *isolate->factory()->ToBoolean(result.FromJust());
}
// ES6 section 26.1.14 Reflect.setPrototypeOf
BUILTIN(ReflectSetPrototypeOf) {
HandleScope scope(isolate);
@ -3394,11 +3351,9 @@ BUILTIN(ReflectSetPrototypeOf) {
return *isolate->factory()->ToBoolean(result.FromJust());
}
// -----------------------------------------------------------------------------
// ES6 section 19.3 Boolean Objects
// ES6 section 19.3.1.1 Boolean ( value ) for the [[Call]] case.
BUILTIN(BooleanConstructor) {
HandleScope scope(isolate);
@ -3406,7 +3361,6 @@ BUILTIN(BooleanConstructor) {
return isolate->heap()->ToBoolean(value->BooleanValue());
}
// ES6 section 19.3.1.1 Boolean ( value ) for the [[Construct]] case.
BUILTIN(BooleanConstructor_ConstructStub) {
HandleScope scope(isolate);
@ -3422,7 +3376,6 @@ BUILTIN(BooleanConstructor_ConstructStub) {
return *result;
}
// ES6 section 19.3.3.2 Boolean.prototype.toString ( )
void Builtins::Generate_BooleanPrototypeToString(CodeStubAssembler* assembler) {
typedef compiler::Node Node;
@ -3451,7 +3404,6 @@ void Builtins::Generate_BooleanPrototypeValueOf(CodeStubAssembler* assembler) {
// -----------------------------------------------------------------------------
// ES6 section 24.2 DataView Objects
// ES6 section 24.2.2 The DataView Constructor for the [[Call]] case.
BUILTIN(DataViewConstructor) {
HandleScope scope(isolate);
@ -3461,7 +3413,6 @@ BUILTIN(DataViewConstructor) {
isolate->factory()->NewStringFromAsciiChecked("DataView")));
}
// ES6 section 24.2.2 The DataView Constructor for the [[Construct]] case.
BUILTIN(DataViewConstructor_ConstructStub) {
HandleScope scope(isolate);
@ -3527,8 +3478,8 @@ BUILTIN(DataViewConstructor_ConstructStub) {
// a. Let viewByteLength be ? ToLength(byteLength).
// b. If offset+viewByteLength > bufferByteLength, throw a RangeError
// exception
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, view_byte_length, Object::ToLength(isolate, byte_length));
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, view_byte_length,
Object::ToLength(isolate, byte_length));
if (offset->Number() + view_byte_length->Number() > buffer_byte_length) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewRangeError(MessageTemplate::kInvalidDataViewLength));
@ -3676,7 +3627,6 @@ void Builtins::Generate_TypedArrayPrototypeLength(
// -----------------------------------------------------------------------------
// ES6 section 20.3 Date Objects
namespace {
// ES6 section 20.3.1.1 Time Values and Time Range
@ -3685,17 +3635,14 @@ const double kMaxYear = -kMinYear;
const double kMinMonth = -10000000.0;
const double kMaxMonth = -kMinMonth;
// 20.3.1.2 Day Number and Time within Day
const double kMsPerDay = 86400000.0;
// ES6 section 20.3.1.11 Hours, Minutes, Second, and Milliseconds
const double kMsPerSecond = 1000.0;
const double kMsPerMinute = 60000.0;
const double kMsPerHour = 3600000.0;
// ES6 section 20.3.1.14 MakeDate (day, time)
double MakeDate(double day, double time) {
if (std::isfinite(day) && std::isfinite(time)) {
@ -3704,7 +3651,6 @@ double MakeDate(double day, double time) {
return std::numeric_limits<double>::quiet_NaN();
}
// ES6 section 20.3.1.13 MakeDay (year, month, date)
double MakeDay(double year, double month, double date) {
if ((kMinYear <= year && year <= kMaxYear) &&
@ -3749,7 +3695,6 @@ double MakeDay(double year, double month, double date) {
return std::numeric_limits<double>::quiet_NaN();
}
// ES6 section 20.3.1.12 MakeTime (hour, min, sec, ms)
double MakeTime(double hour, double min, double sec, double ms) {
if (std::isfinite(hour) && std::isfinite(min) && std::isfinite(sec) &&
@ -3763,7 +3708,6 @@ double MakeTime(double hour, double min, double sec, double ms) {
return std::numeric_limits<double>::quiet_NaN();
}
// ES6 section 20.3.1.15 TimeClip (time)
double TimeClip(double time) {
if (-DateCache::kMaxTimeInMs <= time && time <= DateCache::kMaxTimeInMs) {
@ -3772,13 +3716,11 @@ double TimeClip(double time) {
return std::numeric_limits<double>::quiet_NaN();
}
const char* kShortWeekDays[] = {"Sun", "Mon", "Tue", "Wed",
"Thu", "Fri", "Sat"};
const char* kShortMonths[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
// ES6 section 20.3.1.16 Date Time String Format
double ParseDateTimeString(Handle<String> str) {
Isolate* const isolate = str->GetIsolate();
@ -3810,10 +3752,8 @@ double ParseDateTimeString(Handle<String> str) {
return date;
}
enum ToDateStringMode { kDateOnly, kTimeOnly, kDateAndTime };
// ES6 section 20.3.4.41.1 ToDateString(tv)
void ToDateString(double time_val, Vector<char> str, DateCache* date_cache,
ToDateStringMode mode = kDateAndTime) {
@ -3850,7 +3790,6 @@ void ToDateString(double time_val, Vector<char> str, DateCache* date_cache,
UNREACHABLE();
}
Object* SetLocalDateValue(Handle<JSDate> date, double time_val) {
if (time_val >= -DateCache::kMaxTimeBeforeUTCInMs &&
time_val <= DateCache::kMaxTimeBeforeUTCInMs) {
@ -3864,7 +3803,6 @@ Object* SetLocalDateValue(Handle<JSDate> date, double time_val) {
} // namespace
// ES6 section 20.3.2 The Date Constructor for the [[Call]] case.
BUILTIN(DateConstructor) {
HandleScope scope(isolate);
@ -3875,7 +3813,6 @@ BUILTIN(DateConstructor) {
isolate, isolate->factory()->NewStringFromUtf8(CStrVector(buffer)));
}
// ES6 section 20.3.2 The Date Constructor for the [[Construct]] case.
BUILTIN(DateConstructor_ConstructStub) {
HandleScope scope(isolate);
@ -3957,14 +3894,12 @@ BUILTIN(DateConstructor_ConstructStub) {
RETURN_RESULT_OR_FAILURE(isolate, JSDate::New(target, new_target, time_val));
}
// ES6 section 20.3.3.1 Date.now ( )
BUILTIN(DateNow) {
HandleScope scope(isolate);
return *isolate->factory()->NewNumber(JSDate::CurrentTimeValue(isolate));
}
// ES6 section 20.3.3.2 Date.parse ( string )
BUILTIN(DateParse) {
HandleScope scope(isolate);
@ -3975,7 +3910,6 @@ BUILTIN(DateParse) {
return *isolate->factory()->NewNumber(ParseDateTimeString(string));
}
// ES6 section 20.3.3.4 Date.UTC (year,month,date,hours,minutes,seconds,ms)
BUILTIN(DateUTC) {
HandleScope scope(isolate);
@ -4035,7 +3969,6 @@ BUILTIN(DateUTC) {
return *isolate->factory()->NewNumber(TimeClip(MakeDate(day, time)));
}
// ES6 section 20.3.4.20 Date.prototype.setDate ( date )
BUILTIN(DatePrototypeSetDate) {
HandleScope scope(isolate);
@ -4055,7 +3988,6 @@ BUILTIN(DatePrototypeSetDate) {
return SetLocalDateValue(date, time_val);
}
// ES6 section 20.3.4.21 Date.prototype.setFullYear (year, month, date)
BUILTIN(DatePrototypeSetFullYear) {
HandleScope scope(isolate);
@ -4089,7 +4021,6 @@ BUILTIN(DatePrototypeSetFullYear) {
return SetLocalDateValue(date, time_val);
}
// ES6 section 20.3.4.22 Date.prototype.setHours(hour, min, sec, ms)
BUILTIN(DatePrototypeSetHours) {
HandleScope scope(isolate);
@ -4127,7 +4058,6 @@ BUILTIN(DatePrototypeSetHours) {
return SetLocalDateValue(date, time_val);
}
// ES6 section 20.3.4.23 Date.prototype.setMilliseconds(ms)
BUILTIN(DatePrototypeSetMilliseconds) {
HandleScope scope(isolate);
@ -4148,7 +4078,6 @@ BUILTIN(DatePrototypeSetMilliseconds) {
return SetLocalDateValue(date, time_val);
}
// ES6 section 20.3.4.24 Date.prototype.setMinutes ( min, sec, ms )
BUILTIN(DatePrototypeSetMinutes) {
HandleScope scope(isolate);
@ -4181,7 +4110,6 @@ BUILTIN(DatePrototypeSetMinutes) {
return SetLocalDateValue(date, time_val);
}
// ES6 section 20.3.4.25 Date.prototype.setMonth ( month, date )
BUILTIN(DatePrototypeSetMonth) {
HandleScope scope(isolate);
@ -4209,7 +4137,6 @@ BUILTIN(DatePrototypeSetMonth) {
return SetLocalDateValue(date, time_val);
}
// ES6 section 20.3.4.26 Date.prototype.setSeconds ( sec, ms )
BUILTIN(DatePrototypeSetSeconds) {
HandleScope scope(isolate);
@ -4237,7 +4164,6 @@ BUILTIN(DatePrototypeSetSeconds) {
return SetLocalDateValue(date, time_val);
}
// ES6 section 20.3.4.27 Date.prototype.setTime ( time )
BUILTIN(DatePrototypeSetTime) {
HandleScope scope(isolate);
@ -4247,7 +4173,6 @@ BUILTIN(DatePrototypeSetTime) {
return *JSDate::SetValue(date, TimeClip(value->Number()));
}
// ES6 section 20.3.4.28 Date.prototype.setUTCDate ( date )
BUILTIN(DatePrototypeSetUTCDate) {
HandleScope scope(isolate);
@ -4265,7 +4190,6 @@ BUILTIN(DatePrototypeSetUTCDate) {
return *JSDate::SetValue(date, TimeClip(time_val));
}
// ES6 section 20.3.4.29 Date.prototype.setUTCFullYear (year, month, date)
BUILTIN(DatePrototypeSetUTCFullYear) {
HandleScope scope(isolate);
@ -4298,7 +4222,6 @@ BUILTIN(DatePrototypeSetUTCFullYear) {
return *JSDate::SetValue(date, TimeClip(time_val));
}
// ES6 section 20.3.4.30 Date.prototype.setUTCHours(hour, min, sec, ms)
BUILTIN(DatePrototypeSetUTCHours) {
HandleScope scope(isolate);
@ -4335,7 +4258,6 @@ BUILTIN(DatePrototypeSetUTCHours) {
return *JSDate::SetValue(date, TimeClip(time_val));
}
// ES6 section 20.3.4.31 Date.prototype.setUTCMilliseconds(ms)
BUILTIN(DatePrototypeSetUTCMilliseconds) {
HandleScope scope(isolate);
@ -4355,7 +4277,6 @@ BUILTIN(DatePrototypeSetUTCMilliseconds) {
return *JSDate::SetValue(date, TimeClip(time_val));
}
// ES6 section 20.3.4.32 Date.prototype.setUTCMinutes ( min, sec, ms )
BUILTIN(DatePrototypeSetUTCMinutes) {
HandleScope scope(isolate);
@ -4387,7 +4308,6 @@ BUILTIN(DatePrototypeSetUTCMinutes) {
return *JSDate::SetValue(date, TimeClip(time_val));
}
// ES6 section 20.3.4.31 Date.prototype.setUTCMonth ( month, date )
BUILTIN(DatePrototypeSetUTCMonth) {
HandleScope scope(isolate);
@ -4414,7 +4334,6 @@ BUILTIN(DatePrototypeSetUTCMonth) {
return *JSDate::SetValue(date, TimeClip(time_val));
}
// ES6 section 20.3.4.34 Date.prototype.setUTCSeconds ( sec, ms )
BUILTIN(DatePrototypeSetUTCSeconds) {
HandleScope scope(isolate);
@ -4441,7 +4360,6 @@ BUILTIN(DatePrototypeSetUTCSeconds) {
return *JSDate::SetValue(date, TimeClip(time_val));
}
// ES6 section 20.3.4.35 Date.prototype.toDateString ( )
BUILTIN(DatePrototypeToDateString) {
HandleScope scope(isolate);
@ -4453,7 +4371,6 @@ BUILTIN(DatePrototypeToDateString) {
isolate, isolate->factory()->NewStringFromUtf8(CStrVector(buffer)));
}
// ES6 section 20.3.4.36 Date.prototype.toISOString ( )
BUILTIN(DatePrototypeToISOString) {
HandleScope scope(isolate);
@ -4481,7 +4398,6 @@ BUILTIN(DatePrototypeToISOString) {
return *isolate->factory()->NewStringFromAsciiChecked(buffer);
}
// ES6 section 20.3.4.41 Date.prototype.toString ( )
BUILTIN(DatePrototypeToString) {
HandleScope scope(isolate);
@ -4493,7 +4409,6 @@ BUILTIN(DatePrototypeToString) {
isolate, isolate->factory()->NewStringFromUtf8(CStrVector(buffer)));
}
// ES6 section 20.3.4.42 Date.prototype.toTimeString ( )
BUILTIN(DatePrototypeToTimeString) {
HandleScope scope(isolate);
@ -4505,7 +4420,6 @@ BUILTIN(DatePrototypeToTimeString) {
isolate, isolate->factory()->NewStringFromUtf8(CStrVector(buffer)));
}
// ES6 section 20.3.4.43 Date.prototype.toUTCString ( )
BUILTIN(DatePrototypeToUTCString) {
HandleScope scope(isolate);
@ -4525,7 +4439,6 @@ BUILTIN(DatePrototypeToUTCString) {
return *isolate->factory()->NewStringFromAsciiChecked(buffer);
}
// ES6 section 20.3.4.44 Date.prototype.valueOf ( )
BUILTIN(DatePrototypeValueOf) {
HandleScope scope(isolate);
@ -4533,7 +4446,6 @@ BUILTIN(DatePrototypeValueOf) {
return date->value();
}
// ES6 section 20.3.4.45 Date.prototype [ @@toPrimitive ] ( hint )
BUILTIN(DatePrototypeToPrimitive) {
HandleScope scope(isolate);
@ -4543,7 +4455,6 @@ BUILTIN(DatePrototypeToPrimitive) {
RETURN_RESULT_OR_FAILURE(isolate, JSDate::ToPrimitive(receiver, hint));
}
// ES6 section B.2.4.1 Date.prototype.getYear ( )
BUILTIN(DatePrototypeGetYear) {
HandleScope scope(isolate);
@ -4558,7 +4469,6 @@ BUILTIN(DatePrototypeGetYear) {
return Smi::FromInt(year - 1900);
}
// ES6 section B.2.4.2 Date.prototype.setYear ( year )
BUILTIN(DatePrototypeSetYear) {
HandleScope scope(isolate);
@ -4617,109 +4527,91 @@ void Builtins::Generate_DatePrototypeGetDate(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kDay);
}
// static
void Builtins::Generate_DatePrototypeGetDay(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kWeekday);
}
// static
void Builtins::Generate_DatePrototypeGetFullYear(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kYear);
}
// static
void Builtins::Generate_DatePrototypeGetHours(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kHour);
}
// static
void Builtins::Generate_DatePrototypeGetMilliseconds(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kMillisecond);
}
// static
void Builtins::Generate_DatePrototypeGetMinutes(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kMinute);
}
// static
void Builtins::Generate_DatePrototypeGetMonth(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kMonth);
}
// static
void Builtins::Generate_DatePrototypeGetSeconds(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kSecond);
}
// static
void Builtins::Generate_DatePrototypeGetTime(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kDateValue);
}
// static
void Builtins::Generate_DatePrototypeGetTimezoneOffset(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kTimezoneOffset);
}
// static
void Builtins::Generate_DatePrototypeGetUTCDate(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kDayUTC);
}
// static
void Builtins::Generate_DatePrototypeGetUTCDay(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kWeekdayUTC);
}
// static
void Builtins::Generate_DatePrototypeGetUTCFullYear(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kYearUTC);
}
// static
void Builtins::Generate_DatePrototypeGetUTCHours(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kHourUTC);
}
// static
void Builtins::Generate_DatePrototypeGetUTCMilliseconds(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kMillisecondUTC);
}
// static
void Builtins::Generate_DatePrototypeGetUTCMinutes(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kMinuteUTC);
}
// static
void Builtins::Generate_DatePrototypeGetUTCMonth(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kMonthUTC);
}
// static
void Builtins::Generate_DatePrototypeGetUTCSeconds(MacroAssembler* masm) {
Generate_DatePrototype_GetField(masm, JSDate::kSecondUTC);
}
namespace {
// ES6 section 19.2.1.1.1 CreateDynamicFunction
@ -4833,7 +4725,6 @@ MaybeHandle<JSFunction> CreateDynamicFunction(Isolate* isolate,
} // namespace
// ES6 section 19.2.1.1 Function ( p1, p2, ... , pn, body )
BUILTIN(FunctionConstructor) {
HandleScope scope(isolate);
@ -4960,7 +4851,6 @@ BUILTIN(FunctionPrototypeToString) {
"Function.prototype.toString")));
}
// ES6 section 25.2.1.1 GeneratorFunction (p1, p2, ... , pn, body)
BUILTIN(GeneratorFunctionConstructor) {
HandleScope scope(isolate);
@ -5026,7 +4916,6 @@ BUILTIN(SymbolConstructor) {
return *result;
}
// ES6 section 19.4.1.1 Symbol ( [ description ] ) for the [[Construct]] case.
BUILTIN(SymbolConstructor_ConstructStub) {
HandleScope scope(isolate);
@ -5604,7 +5493,6 @@ BUILTIN(ArrayBufferConstructor) {
handle(target->shared()->name(), isolate)));
}
// ES6 section 24.1.2.1 ArrayBuffer ( length ) for the [[Construct]] case.
BUILTIN(ArrayBufferConstructor_ConstructStub) {
HandleScope scope(isolate);
@ -5691,7 +5579,6 @@ BUILTIN(ProxyConstructor) {
isolate->factory()->NewStringFromAsciiChecked("Proxy")));
}
// ES6 section 26.2.1.1 Proxy ( target, handler ) for the [[Construct]] case.
BUILTIN(ProxyConstructor_ConstructStub) {
HandleScope scope(isolate);
@ -5701,30 +5588,25 @@ BUILTIN(ProxyConstructor_ConstructStub) {
RETURN_RESULT_OR_FAILURE(isolate, JSProxy::New(isolate, target, handler));
}
// -----------------------------------------------------------------------------
// Throwers for restricted function properties and strict arguments object
// properties
BUILTIN(RestrictedFunctionPropertiesThrower) {
HandleScope scope(isolate);
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kRestrictedFunctionProperties));
}
BUILTIN(RestrictedStrictArgumentsPropertiesThrower) {
HandleScope scope(isolate);
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kStrictPoisonPill));
}
// -----------------------------------------------------------------------------
//
namespace {
// Returns the holder JSObject if the function can legally be called with this
@ -5834,7 +5716,6 @@ MUST_USE_RESULT MaybeHandle<Object> HandleApiCallHelper(
} // namespace
BUILTIN(HandleApiCall) {
HandleScope scope(isolate);
Handle<JSFunction> function = args.target<JSFunction>();
@ -5853,7 +5734,6 @@ BUILTIN(HandleApiCall) {
}
}
Handle<Code> Builtins::CallFunction(ConvertReceiverMode mode,
TailCallMode tail_call_mode) {
switch (tail_call_mode) {
@ -6014,7 +5894,6 @@ MaybeHandle<Object> Builtins::InvokeApiFunction(Isolate* isolate,
return result;
}
// Helper function to handle calls to non-function objects created through the
// API. The object can be called as either a constructor (using new) or just as
// a function (without new).
@ -6074,14 +5953,12 @@ MUST_USE_RESULT static Object* HandleApiCallAsFunctionOrConstructor(
return result;
}
// Handle calls to non-function objects created through the API. This delegate
// function is used when the call is a normal function call.
BUILTIN(HandleApiCallAsFunction) {
return HandleApiCallAsFunctionOrConstructor(isolate, false, args);
}
// Handle calls to non-function objects created through the API. This delegate
// function is used when the call is a construct call.
BUILTIN(HandleApiCallAsConstructor) {
@ -6251,17 +6128,13 @@ Builtins::Builtins() : initialized_(false) {
memset(names_, 0, sizeof(names_[0]) * builtin_count);
}
Builtins::~Builtins() {
}
Builtins::~Builtins() {}
#define DEF_ENUM_C(name, ignore) FUNCTION_ADDR(Builtin_##name),
Address const Builtins::c_functions_[cfunction_count] = {
BUILTIN_LIST_C(DEF_ENUM_C)
};
BUILTIN_LIST_C(DEF_ENUM_C)};
#undef DEF_ENUM_C
struct BuiltinDesc {
Handle<Code> (*builder)(Isolate*, struct BuiltinDesc const*);
byte* generator;
@ -6273,7 +6146,10 @@ struct BuiltinDesc {
int argc;
};
#define BUILTIN_FUNCTION_TABLE_INIT { V8_ONCE_INIT, {} }
#define BUILTIN_FUNCTION_TABLE_INIT \
{ \
V8_ONCE_INIT, {} \
}
class BuiltinFunctionTable {
public:
@ -6446,7 +6322,6 @@ void Builtins::InitBuiltinFunctionTable() {
#undef DEF_FUNCTION_PTR_H
}
void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) {
DCHECK(!initialized_);
@ -6491,17 +6366,12 @@ void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) {
initialized_ = true;
}
void Builtins::TearDown() {
initialized_ = false;
}
void Builtins::TearDown() { initialized_ = false; }
void Builtins::IterateBuiltins(ObjectVisitor* v) {
v->VisitPointers(&builtins_[0], &builtins_[0] + builtin_count);
}
const char* Builtins::Lookup(byte* pc) {
// may be called during initialization (disassembler!)
if (initialized_) {
@ -6515,12 +6385,10 @@ const char* Builtins::Lookup(byte* pc) {
return NULL;
}
void Builtins::Generate_InterruptCheck(MacroAssembler* masm) {
masm->TailCallRuntime(Runtime::kInterrupt);
}
void Builtins::Generate_StackCheck(MacroAssembler* masm) {
masm->TailCallRuntime(Runtime::kStackGuard);
}
@ -6782,12 +6650,11 @@ void Builtins::Generate_AtomicsStore(CodeStubAssembler* a) {
Code** code_address = reinterpret_cast<Code**>(builtin_address(k##name)); \
return Handle<Code>(code_address); \
}
#define DEFINE_BUILTIN_ACCESSOR_H(name, kind) \
Handle<Code> Builtins::name() { \
Code** code_address = \
reinterpret_cast<Code**>(builtin_address(k##name)); \
return Handle<Code>(code_address); \
}
#define DEFINE_BUILTIN_ACCESSOR_H(name, kind) \
Handle<Code> Builtins::name() { \
Code** code_address = reinterpret_cast<Code**>(builtin_address(k##name)); \
return Handle<Code>(code_address); \
}
BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T)

View File

@ -1,10 +1,9 @@
// Copyright 2011 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_BUILTINS_H_
#define V8_BUILTINS_H_
#ifndef V8_BUILTINS_BUILTINS_H_
#define V8_BUILTINS_BUILTINS_H_
#include "src/base/flags.h"
#include "src/handles.h"
@ -15,23 +14,22 @@ namespace internal {
// Forward declarations.
class CodeStubAssembler;
#define CODE_AGE_LIST_WITH_ARG(V, A) \
V(Quadragenarian, A) \
V(Quinquagenarian, A) \
V(Sexagenarian, A) \
V(Septuagenarian, A) \
#define CODE_AGE_LIST_WITH_ARG(V, A) \
V(Quadragenarian, A) \
V(Quinquagenarian, A) \
V(Sexagenarian, A) \
V(Septuagenarian, A) \
V(Octogenarian, A)
#define CODE_AGE_LIST_IGNORE_ARG(X, V) V(X)
#define CODE_AGE_LIST(V) \
CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V)
#define CODE_AGE_LIST(V) CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V)
#define CODE_AGE_LIST_COMPLETE(V) \
V(ToBeExecutedOnce) \
V(NotExecuted) \
V(ExecutedOnce) \
V(NoAge) \
#define CODE_AGE_LIST_COMPLETE(V) \
V(ToBeExecutedOnce) \
V(NotExecuted) \
V(ExecutedOnce) \
V(NoAge) \
CODE_AGE_LIST_WITH_ARG(CODE_AGE_LIST_IGNORE_ARG, V)
#define DECLARE_CODE_AGE_BUILTIN(C, V) \
@ -392,7 +390,6 @@ class CodeStubAssembler;
class BuiltinFunctionTable;
class ObjectVisitor;
class Builtins {
public:
~Builtins();
@ -414,15 +411,18 @@ class Builtins {
#define DEF_ENUM_T(name, argc) k##name,
#define DEF_ENUM_S(name, kind, extra, interface_descriptor) k##name,
#define DEF_ENUM_H(name, kind) k##name,
BUILTIN_LIST_C(DEF_ENUM_C) BUILTIN_LIST_A(DEF_ENUM_A)
BUILTIN_LIST_T(DEF_ENUM_T) BUILTIN_LIST_S(DEF_ENUM_S)
BUILTIN_LIST_H(DEF_ENUM_H) BUILTIN_LIST_DEBUG_A(DEF_ENUM_A)
BUILTIN_LIST_C(DEF_ENUM_C)
BUILTIN_LIST_A(DEF_ENUM_A)
BUILTIN_LIST_T(DEF_ENUM_T)
BUILTIN_LIST_S(DEF_ENUM_S)
BUILTIN_LIST_H(DEF_ENUM_H)
BUILTIN_LIST_DEBUG_A(DEF_ENUM_A)
#undef DEF_ENUM_C
#undef DEF_ENUM_A
#undef DEF_ENUM_T
#undef DEF_ENUM_S
#undef DEF_ENUM_H
builtin_count
builtin_count
};
enum CFunctionId {
@ -471,9 +471,7 @@ class Builtins {
return reinterpret_cast<Address>(&builtins_[name]);
}
static Address c_function_address(CFunctionId id) {
return c_functions_[id];
}
static Address c_function_address(CFunctionId id) { return c_functions_[id]; }
const char* name(int index) {
DCHECK(index >= 0);
@ -821,11 +819,10 @@ class Builtins {
CallableType function_type);
static void Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm);
#define DECLARE_CODE_AGE_BUILTIN_GENERATOR(C) \
static void Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm); \
static void Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm);
#define DECLARE_CODE_AGE_BUILTIN_GENERATOR(C) \
static void Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm); \
static void Generate_Make##C##CodeYoungAgainOddMarking(MacroAssembler* masm);
CODE_AGE_LIST(DECLARE_CODE_AGE_BUILTIN_GENERATOR)
#undef DECLARE_CODE_AGE_BUILTIN_GENERATOR
@ -849,4 +846,4 @@ class Builtins {
} // namespace internal
} // namespace v8
#endif // V8_BUILTINS_H_
#endif // V8_BUILTINS_BUILTINS_H_

View File

@ -13,7 +13,6 @@
namespace v8 {
namespace internal {
#define __ ACCESS_MASM(masm)
void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
@ -245,38 +244,31 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ ret(0);
}
void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, true, false);
}
void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, true, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStubForDerived(
MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, true);
}
void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) {
FrameScope scope(masm, StackFrame::INTERNAL);
__ push(edi);
__ CallRuntime(Runtime::kThrowConstructedNonConstructable);
}
enum IsTagged { kEaxIsSmiTagged, kEaxIsUntaggedInt };
// Clobbers ecx, edx, edi; preserves all other registers.
static void Generate_CheckStackOverflow(MacroAssembler* masm,
IsTagged eax_is_tagged) {
@ -308,7 +300,6 @@ static void Generate_CheckStackOverflow(MacroAssembler* masm,
__ bind(&okay);
}
static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
bool is_construct) {
ProfileEntryHookStub::MaybeCallEntryHook(masm);
@ -342,7 +333,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
__ jmp(&entry, Label::kNear);
__ bind(&loop);
__ mov(edx, Operand(ebx, ecx, times_4, 0)); // push parameter from argv
__ push(Operand(edx, 0)); // dereference handle
__ push(Operand(edx, 0)); // dereference handle
__ inc(ecx);
__ bind(&entry);
__ cmp(ecx, eax);
@ -368,12 +359,10 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
__ ret(kPointerSize); // Remove receiver.
}
void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, false);
}
void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, true);
}
@ -460,7 +449,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
__ PushReturnAddressFrom(eax);
__ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
__ mov(eax,
FieldOperand(ecx, SharedFunctionInfo::kFormalParameterCountOffset));
FieldOperand(ecx, SharedFunctionInfo::kFormalParameterCountOffset));
// We abuse new.target both to indicate that this is a resume call and to
// pass in the generator object. In ordinary calls, new.target is always
// undefined because generator functions are non-constructable.
@ -768,7 +757,6 @@ void Builtins::Generate_InterpreterPushArgsAndCallImpl(
}
}
// static
void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -1026,7 +1014,6 @@ void Builtins::Generate_CompileOptimized(MacroAssembler* masm) {
Runtime::kCompileOptimized_NotConcurrent);
}
void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) {
GenerateTailCallToReturnedCode(masm, Runtime::kCompileOptimized_Concurrent);
}
@ -1097,19 +1084,18 @@ static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
__ ret(0);
}
#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \
void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
} \
void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
}
#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \
void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
} \
void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
}
CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR)
#undef DEFINE_CODE_AGE_BUILTIN_GENERATOR
void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
// For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact
// that make_code_young doesn't do any garbage collection which allows us to
@ -1142,17 +1128,14 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
__ ret(0);
}
void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) {
GenerateMakeCodeYoungAgainCommon(masm);
}
void Builtins::Generate_MarkCodeAsToBeExecutedOnce(MacroAssembler* masm) {
Generate_MarkCodeAsExecutedOnce(masm);
}
static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
SaveFPRegsMode save_doubles) {
// Enter an internal frame.
@ -1172,17 +1155,14 @@ static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
__ ret(0); // Return to IC Miss stub, continuation still on stack.
}
void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs);
}
void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kSaveFPRegs);
}
static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
Deoptimizer::BailoutType type) {
{
@ -1216,22 +1196,18 @@ static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
__ Abort(kNoCasesLeft);
}
void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
}
void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::SOFT);
}
void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
}
// static
void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
int field_index) {
@ -1364,7 +1340,6 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
// Stack Layout:
@ -1411,7 +1386,6 @@ void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
__ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
}
void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- eax : argc
@ -1552,7 +1526,6 @@ void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
}
}
void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- eax : argc
@ -1581,7 +1554,6 @@ void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- eax : argc
@ -1611,7 +1583,6 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
// static
void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
// ----------- S t a t e -------------
@ -1774,7 +1745,6 @@ void Builtins::Generate_NumberConstructor(MacroAssembler* masm) {
__ ret(1 * kPointerSize);
}
// static
void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -1861,7 +1831,6 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -1934,7 +1903,6 @@ void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2028,7 +1996,6 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
}
}
static void ArgumentsAdaptorStackCheck(MacroAssembler* masm,
Label* stack_overflow) {
// ----------- S t a t e -------------
@ -2055,7 +2022,6 @@ static void ArgumentsAdaptorStackCheck(MacroAssembler* masm,
__ j(less_equal, stack_overflow); // Signed comparison.
}
static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
__ push(ebp);
__ mov(ebp, esp);
@ -2074,7 +2040,6 @@ static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
__ push(edi);
}
static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
// Retrieve the number of arguments from the stack.
__ mov(ebx, Operand(ebp, ArgumentsAdaptorFrameConstants::kLengthOffset));
@ -2089,7 +2054,6 @@ static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
__ push(ecx);
}
// static
void Builtins::Generate_Apply(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2424,7 +2388,6 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
}
}
namespace {
void Generate_PushBoundArguments(MacroAssembler* masm) {
@ -2511,7 +2474,6 @@ void Generate_PushBoundArguments(MacroAssembler* masm) {
} // namespace
// static
void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
TailCallMode tail_call_mode) {
@ -2540,7 +2502,6 @@ void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
__ jmp(ecx);
}
// static
void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
TailCallMode tail_call_mode) {
@ -2603,7 +2564,6 @@ void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
}
}
// static
void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2625,7 +2585,6 @@ void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
__ jmp(ecx);
}
// static
void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2655,7 +2614,6 @@ void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
__ jmp(ecx);
}
// static
void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2677,7 +2635,6 @@ void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
ExternalReference(Runtime::kJSProxyConstruct, masm->isolate()));
}
// static
void Builtins::Generate_Construct(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2940,7 +2897,6 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
}
}
static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
Register function_template_info,
Register scratch0, Register scratch1,
@ -3004,7 +2960,6 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
__ bind(&receiver_check_passed);
}
void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- eax : number of arguments (not including the receiver)
@ -3048,7 +3003,6 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
}
}
void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
@ -3072,7 +3026,8 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// Load the OSR entrypoint offset from the deoptimization data.
__ mov(ebx, Operand(ebx, FixedArray::OffsetOfElementAt(
DeoptimizationInputData::kOsrPcOffsetIndex) - kHeapObjectTag));
DeoptimizationInputData::kOsrPcOffsetIndex) -
kHeapObjectTag));
__ SmiUntag(ebx);
// Compute the target address = code_obj + header_size + osr_offset
@ -3085,7 +3040,6 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
__ ret(0);
}
#undef __
} // namespace internal
} // namespace v8

6
src/builtins/mips/OWNERS Normal file
View File

@ -0,0 +1,6 @@
paul.lind@imgtec.com
gergely.kis@imgtec.com
akos.palfi@imgtec.com
balazs.kilvady@imgtec.com
dusan.milosavljevic@imgtec.com
ivica.bogosavljevic@imgtec.com

View File

@ -10,11 +10,9 @@
#include "src/full-codegen/full-codegen.h"
#include "src/runtime/runtime.h"
namespace v8 {
namespace internal {
#define __ ACCESS_MASM(masm)
void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
@ -50,7 +48,6 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
exit_frame_type == BUILTIN_EXIT);
}
// Load the built-in InternalArray function from the current context.
static void GenerateLoadInternalArrayFunction(MacroAssembler* masm,
Register result) {
@ -58,14 +55,12 @@ static void GenerateLoadInternalArrayFunction(MacroAssembler* masm,
__ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result);
}
// Load the built-in Array function from the current context.
static void GenerateLoadArrayFunction(MacroAssembler* masm, Register result) {
// Load the Array function from the native context.
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, result);
}
void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- a0 : number of arguments
@ -81,11 +76,11 @@ void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
// Initial map for the builtin InternalArray functions should be maps.
__ lw(a2, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
__ SmiTst(a2, t0);
__ Assert(ne, kUnexpectedInitialMapForInternalArrayFunction,
t0, Operand(zero_reg));
__ Assert(ne, kUnexpectedInitialMapForInternalArrayFunction, t0,
Operand(zero_reg));
__ GetObjectType(a2, a3, t0);
__ Assert(eq, kUnexpectedInitialMapForInternalArrayFunction,
t0, Operand(MAP_TYPE));
__ Assert(eq, kUnexpectedInitialMapForInternalArrayFunction, t0,
Operand(MAP_TYPE));
}
// Run the native code for the InternalArray function called as a normal
@ -95,7 +90,6 @@ void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- a0 : number of arguments
@ -111,11 +105,11 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// Initial map for the builtin Array functions should be maps.
__ lw(a2, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
__ SmiTst(a2, t0);
__ Assert(ne, kUnexpectedInitialMapForArrayFunction1,
t0, Operand(zero_reg));
__ Assert(ne, kUnexpectedInitialMapForArrayFunction1, t0,
Operand(zero_reg));
__ GetObjectType(a2, a3, t0);
__ Assert(eq, kUnexpectedInitialMapForArrayFunction2,
t0, Operand(MAP_TYPE));
__ Assert(eq, kUnexpectedInitialMapForArrayFunction2, t0,
Operand(MAP_TYPE));
}
// Run the native code for the Array function called as a normal function.
@ -126,7 +120,6 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
// static
void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
// ----------- S t a t e -------------
@ -277,7 +270,6 @@ void Builtins::Generate_NumberConstructor(MacroAssembler* masm) {
__ DropAndRet(1);
}
// static
void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -357,7 +349,6 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -429,7 +420,6 @@ void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -544,7 +534,6 @@ static void GenerateTailCallToReturnedCode(MacroAssembler* masm,
__ Jump(at);
}
void Builtins::Generate_InOptimizationQueue(MacroAssembler* masm) {
// Checking whether the queued function is ready for install is optional,
// since we come across interrupts and stack checks elsewhere. However,
@ -561,7 +550,6 @@ void Builtins::Generate_InOptimizationQueue(MacroAssembler* masm) {
GenerateTailCallToSharedCode(masm);
}
static void Generate_JSConstructStubHelper(MacroAssembler* masm,
bool is_api_function,
bool create_implicit_receiver,
@ -712,38 +700,31 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ Ret();
}
void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, true, false);
}
void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, true, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStubForDerived(
MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, true);
}
void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) {
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(a1);
__ CallRuntime(Runtime::kThrowConstructedNonConstructable);
}
enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt };
// Clobbers a2; preserves all other registers.
static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
IsTagged argc_is_tagged) {
@ -771,7 +752,6 @@ static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
__ bind(&okay);
}
static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
bool is_construct) {
// Called from JSEntryStub::GenerateBody
@ -811,13 +791,13 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
Label loop, entry;
__ Lsa(t2, s0, a3, kPointerSizeLog2);
__ b(&entry);
__ nop(); // Branch delay slot nop.
__ nop(); // Branch delay slot nop.
// t2 points past last arg.
__ bind(&loop);
__ lw(t0, MemOperand(s0)); // Read next parameter.
__ addiu(s0, s0, kPointerSize);
__ lw(t0, MemOperand(t0)); // Dereference handle.
__ push(t0); // Push parameter.
__ push(t0); // Push parameter.
__ bind(&entry);
__ Branch(&loop, ne, s0, Operand(t2));
@ -848,12 +828,10 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
__ Jump(ra);
}
void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, false);
}
void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, true);
}
@ -939,7 +917,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
{
__ lw(a0, FieldMemOperand(t0, JSFunction::kSharedFunctionInfoOffset));
__ lw(a0,
FieldMemOperand(a0, SharedFunctionInfo::kFormalParameterCountOffset));
FieldMemOperand(a0, SharedFunctionInfo::kFormalParameterCountOffset));
__ SmiUntag(a0);
// We abuse new.target both to indicate that this is a resume call and to
// pass in the generator object. In ordinary calls, new.target is always
@ -1468,7 +1446,6 @@ void Builtins::Generate_CompileOptimized(MacroAssembler* masm) {
Runtime::kCompileOptimized_NotConcurrent);
}
void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) {
GenerateTailCallToReturnedCode(masm, Runtime::kCompileOptimized_Concurrent);
}
@ -1518,8 +1495,7 @@ static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
// crawls in MakeCodeYoung. This seems a bit fragile.
// Set a0 to point to the head of the PlatformCodeAge sequence.
__ Subu(a0, a0,
Operand(kNoCodeAgeSequenceLength - Assembler::kInstrSize));
__ Subu(a0, a0, Operand(kNoCodeAgeSequenceLength - Assembler::kInstrSize));
// The following registers must be saved and restored when calling through to
// the runtime:
@ -1538,19 +1514,18 @@ static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
__ Jump(a0);
}
#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \
void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
} \
void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
}
#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \
void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
} \
void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
}
CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR)
#undef DEFINE_CODE_AGE_BUILTIN_GENERATOR
void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
// For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact
// that make_code_young doesn't do any garbage collection which allows us to
@ -1558,8 +1533,7 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
// pointers.
// Set a0 to point to the head of the PlatformCodeAge sequence.
__ Subu(a0, a0,
Operand(kNoCodeAgeSequenceLength - Assembler::kInstrSize));
__ Subu(a0, a0, Operand(kNoCodeAgeSequenceLength - Assembler::kInstrSize));
// The following registers must be saved and restored when calling through to
// the runtime:
@ -1585,17 +1559,14 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
__ Jump(a0);
}
void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) {
GenerateMakeCodeYoungAgainCommon(masm);
}
void Builtins::Generate_MarkCodeAsToBeExecutedOnce(MacroAssembler* masm) {
Generate_MarkCodeAsExecutedOnce(masm);
}
static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
SaveFPRegsMode save_doubles) {
{
@ -1611,20 +1582,17 @@ static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
}
__ Addu(sp, sp, Operand(kPointerSize)); // Ignore state
__ Jump(ra); // Jump to miss handler
__ Jump(ra); // Jump to miss handler
}
void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs);
}
void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kSaveFPRegs);
}
static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
Deoptimizer::BailoutType type) {
{
@ -1660,22 +1628,18 @@ static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
__ stop("no cases left");
}
void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
}
void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::SOFT);
}
void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
}
// Clobbers {t2, t3, t4, t5}.
static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
Register function_template_info,
@ -1738,7 +1702,6 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
__ bind(&receiver_check_passed);
}
void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- a0 : number of arguments excluding receiver
@ -1775,7 +1738,6 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kThrowIllegalInvocation);
}
void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ lw(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
@ -1796,7 +1758,8 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// Load the OSR entrypoint offset from the deoptimization data.
// <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset]
__ lw(a1, MemOperand(a1, FixedArray::OffsetOfElementAt(
DeoptimizationInputData::kOsrPcOffsetIndex) - kHeapObjectTag));
DeoptimizationInputData::kOsrPcOffsetIndex) -
kHeapObjectTag));
__ SmiUntag(a1);
// Compute the target address = code_obj + header_size + osr_offset
@ -1808,7 +1771,6 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
__ Ret();
}
// static
void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
int field_index) {
@ -1937,7 +1899,6 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
// 1. Make sure we have at least one argument.
@ -1980,7 +1941,6 @@ void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
__ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
}
void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- a0 : argc
@ -2044,7 +2004,6 @@ void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
}
}
void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- a0 : argc
@ -2123,7 +2082,6 @@ void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
}
}
static void ArgumentAdaptorStackCheck(MacroAssembler* masm,
Label* stack_overflow) {
// ----------- S t a t e -------------
@ -2145,16 +2103,14 @@ static void ArgumentAdaptorStackCheck(MacroAssembler* masm,
__ Branch(stack_overflow, le, t1, Operand(at));
}
static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
__ sll(a0, a0, kSmiTagSize);
__ li(t0, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
__ MultiPush(a0.bit() | a1.bit() | t0.bit() | fp.bit() | ra.bit());
__ Addu(fp, sp,
Operand(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize));
__ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp +
kPointerSize));
}
static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- v0 : result being passed through
@ -2170,7 +2126,6 @@ static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
__ Addu(sp, sp, Operand(kPointerSize));
}
// static
void Builtins::Generate_Apply(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2494,7 +2449,6 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
}
}
// static
void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
TailCallMode tail_call_mode) {
@ -2589,7 +2543,6 @@ void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
__ Jump(at);
}
// static
void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
TailCallMode tail_call_mode) {
@ -2649,7 +2602,6 @@ void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
}
}
// static
void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2671,7 +2623,6 @@ void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
__ Jump(at);
}
// static
void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2763,7 +2714,6 @@ void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
__ Jump(at);
}
// static
void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2782,7 +2732,6 @@ void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
ExternalReference(Runtime::kJSProxyConstruct, masm->isolate()));
}
// static
void Builtins::Generate_Construct(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2948,8 +2897,8 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
Label invoke, dont_adapt_arguments, stack_overflow;
Label enough, too_few;
__ Branch(&dont_adapt_arguments, eq,
a2, Operand(SharedFunctionInfo::kDontAdaptArgumentsSentinel));
__ Branch(&dont_adapt_arguments, eq, a2,
Operand(SharedFunctionInfo::kDontAdaptArgumentsSentinel));
// We use Uless as the number of argument should always be greater than 0.
__ Branch(&too_few, Uless, a0, Operand(a2));
@ -3051,7 +3000,6 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
LeaveArgumentsAdaptorFrame(masm);
__ Ret();
// -------------------------------------------
// Don't adapt arguments.
// -------------------------------------------
@ -3067,7 +3015,6 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
}
}
#undef __
} // namespace internal

View File

@ -0,0 +1,6 @@
paul.lind@imgtec.com
gergely.kis@imgtec.com
akos.palfi@imgtec.com
balazs.kilvady@imgtec.com
dusan.milosavljevic@imgtec.com
ivica.bogosavljevic@imgtec.com

View File

@ -13,7 +13,6 @@
namespace v8 {
namespace internal {
#define __ ACCESS_MASM(masm)
void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
@ -49,7 +48,6 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
exit_frame_type == BUILTIN_EXIT);
}
// Load the built-in InternalArray function from the current context.
static void GenerateLoadInternalArrayFunction(MacroAssembler* masm,
Register result) {
@ -57,14 +55,12 @@ static void GenerateLoadInternalArrayFunction(MacroAssembler* masm,
__ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result);
}
// Load the built-in Array function from the current context.
static void GenerateLoadArrayFunction(MacroAssembler* masm, Register result) {
// Load the Array function from the native context.
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, result);
}
void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- a0 : number of arguments
@ -80,11 +76,11 @@ void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
// Initial map for the builtin InternalArray functions should be maps.
__ ld(a2, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
__ SmiTst(a2, a4);
__ Assert(ne, kUnexpectedInitialMapForInternalArrayFunction,
a4, Operand(zero_reg));
__ Assert(ne, kUnexpectedInitialMapForInternalArrayFunction, a4,
Operand(zero_reg));
__ GetObjectType(a2, a3, a4);
__ Assert(eq, kUnexpectedInitialMapForInternalArrayFunction,
a4, Operand(MAP_TYPE));
__ Assert(eq, kUnexpectedInitialMapForInternalArrayFunction, a4,
Operand(MAP_TYPE));
}
// Run the native code for the InternalArray function called as a normal
@ -94,7 +90,6 @@ void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- a0 : number of arguments
@ -110,11 +105,11 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// Initial map for the builtin Array functions should be maps.
__ ld(a2, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset));
__ SmiTst(a2, a4);
__ Assert(ne, kUnexpectedInitialMapForArrayFunction1,
a4, Operand(zero_reg));
__ Assert(ne, kUnexpectedInitialMapForArrayFunction1, a4,
Operand(zero_reg));
__ GetObjectType(a2, a3, a4);
__ Assert(eq, kUnexpectedInitialMapForArrayFunction2,
a4, Operand(MAP_TYPE));
__ Assert(eq, kUnexpectedInitialMapForArrayFunction2, a4,
Operand(MAP_TYPE));
}
// Run the native code for the Array function called as a normal function.
@ -125,7 +120,6 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
// static
void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
// ----------- S t a t e -------------
@ -274,7 +268,6 @@ void Builtins::Generate_NumberConstructor(MacroAssembler* masm) {
__ DropAndRet(1);
}
void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- a0 : number of arguments
@ -354,7 +347,6 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -427,7 +419,6 @@ void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
}
}
void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- a0 : number of arguments
@ -541,7 +532,6 @@ static void GenerateTailCallToReturnedCode(MacroAssembler* masm,
__ Jump(at);
}
void Builtins::Generate_InOptimizationQueue(MacroAssembler* masm) {
// Checking whether the queued function is ready for install is optional,
// since we come across interrupts and stack checks elsewhere. However,
@ -558,7 +548,6 @@ void Builtins::Generate_InOptimizationQueue(MacroAssembler* masm) {
GenerateTailCallToSharedCode(masm);
}
static void Generate_JSConstructStubHelper(MacroAssembler* masm,
bool is_api_function,
bool create_implicit_receiver,
@ -706,22 +695,18 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ Ret();
}
void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, true, false);
}
void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, true, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStubForDerived(
MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, true);
@ -808,7 +793,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
{
__ ld(a0, FieldMemOperand(a4, JSFunction::kSharedFunctionInfoOffset));
__ lw(a0,
FieldMemOperand(a0, SharedFunctionInfo::kFormalParameterCountOffset));
FieldMemOperand(a0, SharedFunctionInfo::kFormalParameterCountOffset));
// We abuse new.target both to indicate that this is a resume call and to
// pass in the generator object. In ordinary calls, new.target is always
// undefined because generator functions are non-constructable.
@ -889,10 +874,8 @@ void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) {
__ CallRuntime(Runtime::kThrowConstructedNonConstructable);
}
enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt };
// Clobbers a2; preserves all other registers.
static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
IsTagged argc_is_tagged) {
@ -919,7 +902,6 @@ static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
__ bind(&okay);
}
static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
bool is_construct) {
// Called from JSEntryStub::GenerateBody
@ -959,13 +941,13 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
Label loop, entry;
__ Dlsa(a6, s0, a3, kPointerSizeLog2);
__ b(&entry);
__ nop(); // Branch delay slot nop.
__ nop(); // Branch delay slot nop.
// a6 points past last arg.
__ bind(&loop);
__ ld(a4, MemOperand(s0)); // Read next parameter.
__ daddiu(s0, s0, kPointerSize);
__ ld(a4, MemOperand(a4)); // Dereference handle.
__ push(a4); // Push parameter.
__ push(a4); // Push parameter.
__ bind(&entry);
__ Branch(&loop, ne, s0, Operand(a6));
@ -995,12 +977,10 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
__ Jump(ra);
}
void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, false);
}
void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, true);
}
@ -1506,8 +1486,7 @@ static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
// crawls in MakeCodeYoung. This seems a bit fragile.
// Set a0 to point to the head of the PlatformCodeAge sequence.
__ Dsubu(a0, a0,
Operand(kNoCodeAgeSequenceLength - Assembler::kInstrSize));
__ Dsubu(a0, a0, Operand(kNoCodeAgeSequenceLength - Assembler::kInstrSize));
// The following registers must be saved and restored when calling through to
// the runtime:
@ -1526,19 +1505,18 @@ static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
__ Jump(a0);
}
#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \
void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
} \
void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
}
#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \
void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
} \
void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
}
CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR)
#undef DEFINE_CODE_AGE_BUILTIN_GENERATOR
void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
// For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact
// that make_code_young doesn't do any garbage collection which allows us to
@ -1546,8 +1524,7 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
// pointers.
// Set a0 to point to the head of the PlatformCodeAge sequence.
__ Dsubu(a0, a0,
Operand(kNoCodeAgeSequenceLength - Assembler::kInstrSize));
__ Dsubu(a0, a0, Operand(kNoCodeAgeSequenceLength - Assembler::kInstrSize));
// The following registers must be saved and restored when calling through to
// the runtime:
@ -1573,17 +1550,14 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
__ Jump(a0);
}
void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) {
GenerateMakeCodeYoungAgainCommon(masm);
}
void Builtins::Generate_MarkCodeAsToBeExecutedOnce(MacroAssembler* masm) {
Generate_MarkCodeAsExecutedOnce(masm);
}
static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
SaveFPRegsMode save_doubles) {
{
@ -1599,20 +1573,17 @@ static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
}
__ Daddu(sp, sp, Operand(kPointerSize)); // Ignore state
__ Jump(ra); // Jump to miss handler
__ Jump(ra); // Jump to miss handler
}
void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs);
}
void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kSaveFPRegs);
}
static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
Deoptimizer::BailoutType type) {
{
@ -1650,22 +1621,18 @@ static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
__ stop("no cases left");
}
void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
}
void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::SOFT);
}
void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
}
// Clobbers {t2, t3, a4, a5}.
static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
Register function_template_info,
@ -1729,7 +1696,6 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
__ bind(&receiver_check_passed);
}
void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- a0 : number of arguments excluding receiver
@ -1766,7 +1732,6 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kThrowIllegalInvocation);
}
void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ ld(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
@ -1787,7 +1752,8 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// Load the OSR entrypoint offset from the deoptimization data.
// <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset]
__ ld(a1, MemOperand(a1, FixedArray::OffsetOfElementAt(
DeoptimizationInputData::kOsrPcOffsetIndex) - kHeapObjectTag));
DeoptimizationInputData::kOsrPcOffsetIndex) -
kHeapObjectTag));
__ SmiUntag(a1);
// Compute the target address = code_obj + header_size + osr_offset
@ -1799,7 +1765,6 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
__ Ret();
}
// static
void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
int field_index) {
@ -1928,7 +1893,6 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
// 1. Make sure we have at least one argument.
@ -1971,7 +1935,6 @@ void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
__ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
}
void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- a0 : argc
@ -2035,7 +1998,6 @@ void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
}
}
void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- a0 : argc
@ -2114,7 +2076,6 @@ void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
}
}
static void ArgumentAdaptorStackCheck(MacroAssembler* masm,
Label* stack_overflow) {
// ----------- S t a t e -------------
@ -2136,17 +2097,15 @@ static void ArgumentAdaptorStackCheck(MacroAssembler* masm,
__ Branch(stack_overflow, le, a5, Operand(at));
}
static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
// __ sll(a0, a0, kSmiTagSize);
__ dsll32(a0, a0, 0);
__ li(a4, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
__ MultiPush(a0.bit() | a1.bit() | a4.bit() | fp.bit() | ra.bit());
__ Daddu(fp, sp,
Operand(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize));
__ Daddu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp +
kPointerSize));
}
static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- v0 : result being passed through
@ -2163,7 +2122,6 @@ static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
__ Daddu(sp, sp, Operand(kPointerSize));
}
// static
void Builtins::Generate_Apply(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2485,7 +2443,6 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
}
}
// static
void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
TailCallMode tail_call_mode) {
@ -2580,7 +2537,6 @@ void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
__ Jump(at);
}
// static
void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
TailCallMode tail_call_mode) {
@ -2640,7 +2596,6 @@ void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
}
}
void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- a0 : the number of arguments (not including the receiver)
@ -2661,7 +2616,6 @@ void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
__ Jump(at);
}
// static
void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2753,7 +2707,6 @@ void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
__ Jump(at);
}
// static
void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2772,7 +2725,6 @@ void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
ExternalReference(Runtime::kJSProxyConstruct, masm->isolate()));
}
// static
void Builtins::Generate_Construct(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2938,8 +2890,8 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
Label invoke, dont_adapt_arguments, stack_overflow;
Label enough, too_few;
__ Branch(&dont_adapt_arguments, eq,
a2, Operand(SharedFunctionInfo::kDontAdaptArgumentsSentinel));
__ Branch(&dont_adapt_arguments, eq, a2,
Operand(SharedFunctionInfo::kDontAdaptArgumentsSentinel));
// We use Uless as the number of argument should always be greater than 0.
__ Branch(&too_few, Uless, a0, Operand(a2));
@ -3043,7 +2995,6 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
LeaveArgumentsAdaptorFrame(masm);
__ Ret();
// -------------------------------------------
// Don't adapt arguments.
// -------------------------------------------
@ -3059,7 +3010,6 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
}
}
#undef __
} // namespace internal

6
src/builtins/ppc/OWNERS Normal file
View File

@ -0,0 +1,6 @@
jyan@ca.ibm.com
dstence@us.ibm.com
joransiu@ca.ibm.com
mbrandy@us.ibm.com
michael_dawson@ca.ibm.com
bjaideep@ca.ibm.com

View File

@ -13,10 +13,8 @@
namespace v8 {
namespace internal {
#define __ ACCESS_MASM(masm)
void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
ExitFrameType exit_frame_type) {
// ----------- S t a t e -------------
@ -50,7 +48,6 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
exit_frame_type == BUILTIN_EXIT);
}
// Load the built-in InternalArray function from the current context.
static void GenerateLoadInternalArrayFunction(MacroAssembler* masm,
Register result) {
@ -58,14 +55,12 @@ static void GenerateLoadInternalArrayFunction(MacroAssembler* masm,
__ LoadNativeContextSlot(Context::INTERNAL_ARRAY_FUNCTION_INDEX, result);
}
// Load the built-in Array function from the current context.
static void GenerateLoadArrayFunction(MacroAssembler* masm, Register result) {
// Load the Array function from the current native context.
__ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, result);
}
void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : number of arguments
@ -93,7 +88,6 @@ void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : number of arguments
@ -122,7 +116,6 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
// static
void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
// ----------- S t a t e -------------
@ -278,7 +271,6 @@ void Builtins::Generate_NumberConstructor(MacroAssembler* masm) {
__ Ret(1);
}
// static
void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -361,7 +353,6 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -516,7 +507,6 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
}
}
static void GenerateTailCallToSharedCode(MacroAssembler* masm) {
__ LoadP(ip, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
__ LoadP(ip, FieldMemOperand(ip, SharedFunctionInfo::kCodeOffset));
@ -550,7 +540,6 @@ static void GenerateTailCallToReturnedCode(MacroAssembler* masm,
__ JumpToJSEntry(ip);
}
void Builtins::Generate_InOptimizationQueue(MacroAssembler* masm) {
// Checking whether the queued function is ready for install is optional,
// since we come across interrupts and stack checks elsewhere. However,
@ -568,7 +557,6 @@ void Builtins::Generate_InOptimizationQueue(MacroAssembler* masm) {
GenerateTailCallToSharedCode(masm);
}
static void Generate_JSConstructStubHelper(MacroAssembler* masm,
bool is_api_function,
bool create_implicit_receiver,
@ -725,22 +713,18 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ blr();
}
void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, true, false);
}
void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, true, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStubForDerived(
MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, true);
@ -924,10 +908,8 @@ void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) {
__ CallRuntime(Runtime::kThrowConstructedNonConstructable);
}
enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt };
// Clobbers r5; preserves all other registers.
static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
IsTagged argc_is_tagged) {
@ -955,7 +937,6 @@ static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc,
__ bind(&okay);
}
static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
bool is_construct) {
// Called from Generate_JS_Entry
@ -1031,12 +1012,10 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
// r3: result
}
void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, false);
}
void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, true);
}
@ -1289,7 +1268,7 @@ void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
// Get the bytecode array pointer from the frame.
__ LoadP(kInterpreterBytecodeArrayRegister,
MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp));
MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp));
if (FLAG_debug_code) {
// Check function data field is actually a BytecodeArray object.
@ -1302,7 +1281,7 @@ void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
// Get the target bytecode offset from the frame.
__ LoadP(kInterpreterBytecodeOffsetRegister,
MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
MemOperand(fp, InterpreterFrameConstants::kBytecodeOffsetFromFp));
__ SmiUntag(kInterpreterBytecodeOffsetRegister);
// Dispatch to the target bytecode.
@ -1313,7 +1292,6 @@ void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) {
__ Jump(ip);
}
void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : argument count (preserved for callee)
@ -1467,7 +1445,6 @@ void Builtins::Generate_CompileOptimized(MacroAssembler* masm) {
Runtime::kCompileOptimized_NotConcurrent);
}
void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) {
GenerateTailCallToReturnedCode(masm, Runtime::kCompileOptimized_Concurrent);
}
@ -1550,7 +1527,6 @@ static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR)
#undef DEFINE_CODE_AGE_BUILTIN_GENERATOR
void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
// For now, we are relying on the fact that make_code_young doesn't do any
// garbage collection which allows us to save/restore the registers without
@ -1587,17 +1563,14 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
__ Jump(r3);
}
void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) {
GenerateMakeCodeYoungAgainCommon(masm);
}
void Builtins::Generate_MarkCodeAsToBeExecutedOnce(MacroAssembler* masm) {
Generate_MarkCodeAsExecutedOnce(masm);
}
static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
SaveFPRegsMode save_doubles) {
{
@ -1616,17 +1589,14 @@ static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
__ blr(); // Jump to miss handler
}
void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs);
}
void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kSaveFPRegs);
}
static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
Deoptimizer::BailoutType type) {
{
@ -1663,22 +1633,18 @@ static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
__ stop("no cases left");
}
void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
}
void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::SOFT);
}
void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
}
// Clobbers registers {r7, r8, r9, r10}.
void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
Register function_template_info,
@ -1744,7 +1710,6 @@ void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
__ bind(&receiver_check_passed);
}
void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : number of arguments excluding receiver
@ -1756,7 +1721,6 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
// -- sp[4 * argc] : receiver
// -----------------------------------
// Load the FunctionTemplateInfo.
__ LoadP(r6, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
__ LoadP(r6, FieldMemOperand(r6, SharedFunctionInfo::kFunctionDataOffset));
@ -1782,7 +1746,6 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kThrowIllegalInvocation);
}
void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ LoadP(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
@ -1829,7 +1792,6 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
int field_index) {
@ -1957,7 +1919,6 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
// 1. Make sure we have at least one argument.
@ -1986,7 +1947,6 @@ void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
// Calculate the copy start address (destination). Copy end address is sp.
__ add(r5, sp, r5);
__ mtctr(r3);
__ bind(&loop);
__ LoadP(ip, MemOperand(r5, -kPointerSize));
@ -2003,7 +1963,6 @@ void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
__ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
}
void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : argc
@ -2066,7 +2025,6 @@ void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
}
}
void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : argc
@ -2144,7 +2102,6 @@ void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
}
}
static void ArgumentAdaptorStackCheck(MacroAssembler* masm,
Label* stack_overflow) {
// ----------- S t a t e -------------
@ -2166,7 +2123,6 @@ static void ArgumentAdaptorStackCheck(MacroAssembler* masm,
__ ble(stack_overflow); // Signed comparison.
}
static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
__ SmiTag(r3);
__ LoadSmiLiteral(r7, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
@ -2181,7 +2137,6 @@ static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
kPointerSize));
}
static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r3 : result being passed through
@ -2196,7 +2151,6 @@ static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
__ add(sp, sp, r0);
}
// static
void Builtins::Generate_Apply(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2526,7 +2480,6 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
}
}
namespace {
void Generate_PushBoundArguments(MacroAssembler* masm) {
@ -2609,7 +2562,6 @@ void Generate_PushBoundArguments(MacroAssembler* masm) {
} // namespace
// static
void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
TailCallMode tail_call_mode) {
@ -2641,7 +2593,6 @@ void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
__ JumpToJSEntry(ip);
}
// static
void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
TailCallMode tail_call_mode) {
@ -2703,7 +2654,6 @@ void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
}
}
// static
void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2725,7 +2675,6 @@ void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
__ JumpToJSEntry(ip);
}
// static
void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2755,7 +2704,6 @@ void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
__ JumpToJSEntry(ip);
}
// static
void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2774,7 +2722,6 @@ void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
ExternalReference(Runtime::kJSProxyConstruct, masm->isolate()));
}
// static
void Builtins::Generate_Construct(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -3040,7 +2987,6 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
LeaveArgumentsAdaptorFrame(masm);
__ blr();
// -------------------------------------------
// Dont adapt arguments.
// -------------------------------------------
@ -3055,7 +3001,6 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
}
}
#undef __
} // namespace internal
} // namespace v8

6
src/builtins/s390/OWNERS Normal file
View File

@ -0,0 +1,6 @@
jyan@ca.ibm.com
dstence@us.ibm.com
joransiu@ca.ibm.com
mbrandy@us.ibm.com
michael_dawson@ca.ibm.com
bjaideep@ca.ibm.com

View File

@ -12,7 +12,6 @@
namespace v8 {
namespace internal {
#define __ ACCESS_MASM(masm)
void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
@ -54,7 +53,6 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
exit_frame_type == BUILTIN_EXIT);
}
static void GenerateTailCallToSharedCode(MacroAssembler* masm) {
__ movp(kScratchRegister,
FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
@ -111,7 +109,6 @@ void Builtins::Generate_InOptimizationQueue(MacroAssembler* masm) {
GenerateTailCallToSharedCode(masm);
}
static void Generate_JSConstructStubHelper(MacroAssembler* masm,
bool is_api_function,
bool create_implicit_receiver,
@ -246,38 +243,31 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ ret(0);
}
void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, true, false);
}
void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, true, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStubForDerived(
MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, true);
}
void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) {
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(rdi);
__ CallRuntime(Runtime::kThrowConstructedNonConstructable);
}
enum IsTagged { kRaxIsSmiTagged, kRaxIsUntaggedInt };
// Clobbers rcx, r11, kScratchRegister; preserves all other registers.
static void Generate_CheckStackOverflow(MacroAssembler* masm,
IsTagged rax_is_tagged) {
@ -311,7 +301,6 @@ static void Generate_CheckStackOverflow(MacroAssembler* masm,
__ bind(&okay);
}
static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
bool is_construct) {
ProfileEntryHookStub::MaybeCallEntryHook(masm);
@ -326,11 +315,11 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
// Open a C++ scope for the FrameScope.
{
// Platform specific argument handling. After this, the stack contains
// an internal frame and the pushed function and receiver, and
// register rax and rbx holds the argument count and argument array,
// while rdi holds the function pointer, rsi the context, and rdx the
// new.target.
// Platform specific argument handling. After this, the stack contains
// an internal frame and the pushed function and receiver, and
// register rax and rbx holds the argument count and argument array,
// while rdi holds the function pointer, rsi the context, and rdx the
// new.target.
#ifdef _WIN64
// MSVC parameters in:
@ -361,7 +350,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
__ movp(rdi, rdx);
// Load the new.target into rdx.
__ movp(rdx, rcx);
#else // _WIN64
#else // _WIN64
// GCC parameters in:
// rdi : new_target
// rsi : function
@ -441,12 +430,10 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
__ ret(1 * kPointerSize); // Remove receiver.
}
void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, false);
}
void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, true);
}
@ -1079,7 +1066,6 @@ void Builtins::Generate_CompileOptimized(MacroAssembler* masm) {
Runtime::kCompileOptimized_NotConcurrent);
}
void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) {
GenerateTailCallToReturnedCode(masm, Runtime::kCompileOptimized_Concurrent);
}
@ -1148,20 +1134,18 @@ static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
__ ret(0);
}
#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \
void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
} \
void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
}
#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \
void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
} \
void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
}
CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR)
#undef DEFINE_CODE_AGE_BUILTIN_GENERATOR
void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
// For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact
// that make_code_young doesn't do any garbage collection which allows us to
@ -1192,17 +1176,14 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
__ ret(0);
}
void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) {
GenerateMakeCodeYoungAgainCommon(masm);
}
void Builtins::Generate_MarkCodeAsToBeExecutedOnce(MacroAssembler* masm) {
Generate_MarkCodeAsExecutedOnce(masm);
}
static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
SaveFPRegsMode save_doubles) {
// Enter an internal frame.
@ -1222,17 +1203,14 @@ static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
__ ret(0); // Return to IC Miss stub, continuation still on stack.
}
void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs);
}
void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kSaveFPRegs);
}
static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
Deoptimizer::BailoutType type) {
// Enter an internal frame.
@ -1268,22 +1246,18 @@ static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
__ Abort(kNoCasesLeft);
}
void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
}
void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::SOFT);
}
void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
}
// static
void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
int field_index) {
@ -1418,7 +1392,6 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
// Stack Layout:
@ -1471,7 +1444,6 @@ void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
__ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
}
void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- rax : argc
@ -1536,7 +1508,6 @@ void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
}
}
void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- rax : argc
@ -1618,7 +1589,6 @@ void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
}
}
void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- rax : argc
@ -1648,7 +1618,6 @@ void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- rax : argc
@ -1836,7 +1805,6 @@ void Builtins::Generate_NumberConstructor(MacroAssembler* masm) {
__ ret(1 * kPointerSize);
}
// static
void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -1920,7 +1888,6 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -1994,7 +1961,6 @@ void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2079,7 +2045,6 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
}
}
static void ArgumentsAdaptorStackCheck(MacroAssembler* masm,
Label* stack_overflow) {
// ----------- S t a t e -------------
@ -2106,7 +2071,6 @@ static void ArgumentsAdaptorStackCheck(MacroAssembler* masm,
__ j(less_equal, stack_overflow); // Signed comparison.
}
static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
__ pushq(rbp);
__ movp(rbp, rsp);
@ -2124,7 +2088,6 @@ static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
__ Push(r8);
}
static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
// Retrieve the number of arguments from the stack. Number is a Smi.
__ movp(rbx, Operand(rbp, ArgumentsAdaptorFrameConstants::kLengthOffset));
@ -2345,7 +2308,6 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_Apply(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2678,7 +2640,6 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
}
}
namespace {
void Generate_PushBoundArguments(MacroAssembler* masm) {
@ -2763,7 +2724,6 @@ void Generate_PushBoundArguments(MacroAssembler* masm) {
} // namespace
// static
void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
TailCallMode tail_call_mode) {
@ -2793,7 +2753,6 @@ void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
__ jmp(rcx);
}
// static
void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
TailCallMode tail_call_mode) {
@ -2857,7 +2816,6 @@ void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
}
}
// static
void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2879,7 +2837,6 @@ void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
__ jmp(rcx);
}
// static
void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2909,7 +2866,6 @@ void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
__ jmp(rcx);
}
// static
void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2930,7 +2886,6 @@ void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
ExternalReference(Runtime::kJSProxyConstruct, masm->isolate()));
}
// static
void Builtins::Generate_Construct(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2983,7 +2938,6 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
RelocInfo::CODE_TARGET);
}
static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
Register function_template_info,
Register scratch0, Register scratch1,
@ -3049,7 +3003,6 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
__ bind(&receiver_check_passed);
}
void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- rax : number of arguments (not including the receiver)
@ -3093,7 +3046,6 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
}
}
void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ movp(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
@ -3116,8 +3068,10 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
__ movp(rbx, Operand(rax, Code::kDeoptimizationDataOffset - kHeapObjectTag));
// Load the OSR entrypoint offset from the deoptimization data.
__ SmiToInteger32(rbx, Operand(rbx, FixedArray::OffsetOfElementAt(
DeoptimizationInputData::kOsrPcOffsetIndex) - kHeapObjectTag));
__ SmiToInteger32(
rbx, Operand(rbx, FixedArray::OffsetOfElementAt(
DeoptimizationInputData::kOsrPcOffsetIndex) -
kHeapObjectTag));
// Compute the target address = code_obj + header_size + osr_offset
__ leap(rax, Operand(rax, rbx, times_1, Code::kHeaderSize - kHeapObjectTag));
@ -3129,7 +3083,6 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
__ ret(0);
}
#undef __
} // namespace internal

1
src/builtins/x87/OWNERS Normal file
View File

@ -0,0 +1 @@
weiliang.lin@intel.com

View File

@ -13,7 +13,6 @@
namespace v8 {
namespace internal {
#define __ ACCESS_MASM(masm)
void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
@ -246,38 +245,31 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
__ ret(0);
}
void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, true, false);
}
void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, true, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, false);
}
void Builtins::Generate_JSBuiltinsConstructStubForDerived(
MacroAssembler* masm) {
Generate_JSConstructStubHelper(masm, false, false, true);
}
void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) {
FrameScope scope(masm, StackFrame::INTERNAL);
__ push(edi);
__ CallRuntime(Runtime::kThrowConstructedNonConstructable);
}
enum IsTagged { kEaxIsSmiTagged, kEaxIsUntaggedInt };
// Clobbers ecx, edx, edi; preserves all other registers.
static void Generate_CheckStackOverflow(MacroAssembler* masm,
IsTagged eax_is_tagged) {
@ -309,7 +301,6 @@ static void Generate_CheckStackOverflow(MacroAssembler* masm,
__ bind(&okay);
}
static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
bool is_construct) {
ProfileEntryHookStub::MaybeCallEntryHook(masm);
@ -343,7 +334,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
__ jmp(&entry, Label::kNear);
__ bind(&loop);
__ mov(edx, Operand(ebx, ecx, times_4, 0)); // push parameter from argv
__ push(Operand(edx, 0)); // dereference handle
__ push(Operand(edx, 0)); // dereference handle
__ inc(ecx);
__ bind(&entry);
__ cmp(ecx, eax);
@ -369,12 +360,10 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
__ ret(kPointerSize); // Remove receiver.
}
void Builtins::Generate_JSEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, false);
}
void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
Generate_JSEntryTrampolineHelper(masm, true);
}
@ -769,7 +758,6 @@ void Builtins::Generate_InterpreterPushArgsAndCallImpl(
}
}
// static
void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -1027,7 +1015,6 @@ void Builtins::Generate_CompileOptimized(MacroAssembler* masm) {
Runtime::kCompileOptimized_NotConcurrent);
}
void Builtins::Generate_CompileOptimizedConcurrent(MacroAssembler* masm) {
GenerateTailCallToReturnedCode(masm, Runtime::kCompileOptimized_Concurrent);
}
@ -1098,19 +1085,18 @@ static void GenerateMakeCodeYoungAgainCommon(MacroAssembler* masm) {
__ ret(0);
}
#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \
void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
} \
void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
}
#define DEFINE_CODE_AGE_BUILTIN_GENERATOR(C) \
void Builtins::Generate_Make##C##CodeYoungAgainEvenMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
} \
void Builtins::Generate_Make##C##CodeYoungAgainOddMarking( \
MacroAssembler* masm) { \
GenerateMakeCodeYoungAgainCommon(masm); \
}
CODE_AGE_LIST(DEFINE_CODE_AGE_BUILTIN_GENERATOR)
#undef DEFINE_CODE_AGE_BUILTIN_GENERATOR
void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
// For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact
// that make_code_young doesn't do any garbage collection which allows us to
@ -1143,17 +1129,14 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
__ ret(0);
}
void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) {
GenerateMakeCodeYoungAgainCommon(masm);
}
void Builtins::Generate_MarkCodeAsToBeExecutedOnce(MacroAssembler* masm) {
Generate_MarkCodeAsExecutedOnce(masm);
}
static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
SaveFPRegsMode save_doubles) {
// Enter an internal frame.
@ -1173,17 +1156,14 @@ static void Generate_NotifyStubFailureHelper(MacroAssembler* masm,
__ ret(0); // Return to IC Miss stub, continuation still on stack.
}
void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs);
}
void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) {
Generate_NotifyStubFailureHelper(masm, kSaveFPRegs);
}
static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
Deoptimizer::BailoutType type) {
{
@ -1217,22 +1197,18 @@ static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
__ Abort(kNoCasesLeft);
}
void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER);
}
void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::SOFT);
}
void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) {
Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY);
}
// static
void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
int field_index) {
@ -1365,7 +1341,6 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
// Stack Layout:
@ -1412,7 +1387,6 @@ void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
__ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
}
void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- eax : argc
@ -1553,7 +1527,6 @@ void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
}
}
void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- eax : argc
@ -1582,7 +1555,6 @@ void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- eax : argc
@ -1612,7 +1584,6 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
__ TailCallStub(&stub);
}
// static
void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
// ----------- S t a t e -------------
@ -1791,7 +1762,6 @@ void Builtins::Generate_NumberConstructor(MacroAssembler* masm) {
__ ret(1 * kPointerSize);
}
// static
void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -1878,7 +1848,6 @@ void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -1951,7 +1920,6 @@ void Builtins::Generate_StringConstructor(MacroAssembler* masm) {
}
}
// static
void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2045,7 +2013,6 @@ void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
}
}
static void ArgumentsAdaptorStackCheck(MacroAssembler* masm,
Label* stack_overflow) {
// ----------- S t a t e -------------
@ -2072,7 +2039,6 @@ static void ArgumentsAdaptorStackCheck(MacroAssembler* masm,
__ j(less_equal, stack_overflow); // Signed comparison.
}
static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
__ push(ebp);
__ mov(ebp, esp);
@ -2091,7 +2057,6 @@ static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
__ push(edi);
}
static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
// Retrieve the number of arguments from the stack.
__ mov(ebx, Operand(ebp, ArgumentsAdaptorFrameConstants::kLengthOffset));
@ -2106,7 +2071,6 @@ static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
__ push(ecx);
}
// static
void Builtins::Generate_Apply(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2448,7 +2412,6 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
}
}
namespace {
void Generate_PushBoundArguments(MacroAssembler* masm) {
@ -2535,7 +2498,6 @@ void Generate_PushBoundArguments(MacroAssembler* masm) {
} // namespace
// static
void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
TailCallMode tail_call_mode) {
@ -2564,7 +2526,6 @@ void Builtins::Generate_CallBoundFunctionImpl(MacroAssembler* masm,
__ jmp(ecx);
}
// static
void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
TailCallMode tail_call_mode) {
@ -2627,7 +2588,6 @@ void Builtins::Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode,
}
}
// static
void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2649,7 +2609,6 @@ void Builtins::Generate_ConstructFunction(MacroAssembler* masm) {
__ jmp(ecx);
}
// static
void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2679,7 +2638,6 @@ void Builtins::Generate_ConstructBoundFunction(MacroAssembler* masm) {
__ jmp(ecx);
}
// static
void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2701,7 +2659,6 @@ void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
ExternalReference(Runtime::kJSProxyConstruct, masm->isolate()));
}
// static
void Builtins::Generate_Construct(MacroAssembler* masm) {
// ----------- S t a t e -------------
@ -2965,7 +2922,6 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
}
}
static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
Register function_template_info,
Register scratch0, Register scratch1,
@ -3029,7 +2985,6 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
__ bind(&receiver_check_passed);
}
void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- eax : number of arguments (not including the receiver)
@ -3073,7 +3028,6 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
}
}
void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// Lookup the function in the JavaScript frame.
__ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
@ -3097,7 +3051,8 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
// Load the OSR entrypoint offset from the deoptimization data.
__ mov(ebx, Operand(ebx, FixedArray::OffsetOfElementAt(
DeoptimizationInputData::kOsrPcOffsetIndex) - kHeapObjectTag));
DeoptimizationInputData::kOsrPcOffsetIndex) -
kHeapObjectTag));
__ SmiUntag(ebx);
// Compute the target address = code_obj + header_size + osr_offset
@ -3110,7 +3065,6 @@ void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
__ ret(0);
}
#undef __
} // namespace internal
} // namespace v8

View File

@ -10,7 +10,7 @@
// Clients of this interface shouldn't depend on lots of compiler internals.
// Do not include anything from src/compiler here!
#include "src/allocation.h"
#include "src/builtins.h"
#include "src/builtins/builtins.h"
#include "src/heap/heap.h"
#include "src/machine-type.h"
#include "src/runtime/runtime.h"

View File

@ -9,7 +9,7 @@
#include "src/allocation.h"
#include "src/base/platform/elapsed-timer.h"
#include "src/base/platform/time.h"
#include "src/builtins.h"
#include "src/builtins/builtins.h"
#include "src/globals.h"
#include "src/objects.h"
#include "src/runtime/runtime.h"

View File

@ -7,7 +7,7 @@
#include "src/allocation.h"
#include "src/base/smart-pointers.h"
#include "src/builtins.h"
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
#include "src/frames.h"
#include "src/interpreter/bytecode-register.h"

View File

@ -7,7 +7,7 @@
#include "src/allocation.h"
#include "src/base/smart-pointers.h"
#include "src/builtins.h"
#include "src/builtins/builtins.h"
#include "src/frames.h"
#include "src/interpreter/bytecodes.h"
#include "src/interpreter/interpreter-assembler.h"

View File

@ -9,7 +9,7 @@
// Do not include anything from src/interpreter other than
// src/interpreter/bytecodes.h here!
#include "src/base/macros.h"
#include "src/builtins.h"
#include "src/builtins/builtins.h"
#include "src/interpreter/bytecodes.h"
#include "src/parsing/token.h"
#include "src/runtime/runtime.h"

View File

@ -15,7 +15,7 @@
#include "src/base/accounting-allocator.h"
#include "src/base/atomicops.h"
#include "src/base/hashmap.h"
#include "src/builtins.h"
#include "src/builtins/builtins.h"
#include "src/cancelable-task.h"
#include "src/contexts.h"
#include "src/date.h"

View File

@ -14,7 +14,7 @@
#include "src/base/atomicops.h"
#include "src/base/bits.h"
#include "src/builtins.h"
#include "src/builtins/builtins.h"
#include "src/contexts-inl.h"
#include "src/conversions-inl.h"
#include "src/factory.h"

View File

@ -12,15 +12,15 @@
#include "src/base/bits.h"
#include "src/base/flags.h"
#include "src/base/smart-pointers.h"
#include "src/builtins.h"
#include "src/builtins/builtins.h"
#include "src/checks.h"
#include "src/elements-kind.h"
#include "src/field-index.h"
#include "src/flags.h"
#include "src/list.h"
#include "src/property-details.h"
#include "src/unicode.h"
#include "src/unicode-decoder.h"
#include "src/unicode.h"
#include "src/zone.h"
#if V8_TARGET_ARCH_ARM

View File

@ -467,8 +467,8 @@
'bit-vector.h',
'bootstrapper.cc',
'bootstrapper.h',
'builtins.cc',
'builtins.h',
'builtins/builtins.cc',
'builtins/builtins.h',
'cached-powers.cc',
'cached-powers.h',
'cancelable-task.cc',
@ -1217,7 +1217,6 @@
'arm/assembler-arm-inl.h',
'arm/assembler-arm.cc',
'arm/assembler-arm.h',
'arm/builtins-arm.cc',
'arm/code-stubs-arm.cc',
'arm/code-stubs-arm.h',
'arm/codegen-arm.cc',
@ -1235,6 +1234,7 @@
'arm/macro-assembler-arm.h',
'arm/simulator-arm.cc',
'arm/simulator-arm.h',
'builtins/arm/builtins-arm.cc',
'compiler/arm/code-generator-arm.cc',
'compiler/arm/instruction-codes-arm.h',
'compiler/arm/instruction-scheduler-arm.cc',
@ -1261,7 +1261,6 @@
'arm64/assembler-arm64.cc',
'arm64/assembler-arm64.h',
'arm64/assembler-arm64-inl.h',
'arm64/builtins-arm64.cc',
'arm64/codegen-arm64.cc',
'arm64/codegen-arm64.h',
'arm64/code-stubs-arm64.cc',
@ -1289,6 +1288,7 @@
'arm64/simulator-arm64.h',
'arm64/utils-arm64.cc',
'arm64/utils-arm64.h',
'builtins/arm64/builtins-arm64.cc',
'compiler/arm64/code-generator-arm64.cc',
'compiler/arm64/instruction-codes-arm64.h',
'compiler/arm64/instruction-scheduler-arm64.cc',
@ -1318,7 +1318,6 @@
'ia32/assembler-ia32-inl.h',
'ia32/assembler-ia32.cc',
'ia32/assembler-ia32.h',
'ia32/builtins-ia32.cc',
'ia32/code-stubs-ia32.cc',
'ia32/code-stubs-ia32.h',
'ia32/codegen-ia32.cc',
@ -1331,6 +1330,7 @@
'ia32/interface-descriptors-ia32.cc',
'ia32/macro-assembler-ia32.cc',
'ia32/macro-assembler-ia32.h',
'builtins/ia32/builtins-ia32.cc',
'compiler/ia32/code-generator-ia32.cc',
'compiler/ia32/instruction-codes-ia32.h',
'compiler/ia32/instruction-scheduler-ia32.cc',
@ -1357,7 +1357,6 @@
'x87/assembler-x87-inl.h',
'x87/assembler-x87.cc',
'x87/assembler-x87.h',
'x87/builtins-x87.cc',
'x87/code-stubs-x87.cc',
'x87/code-stubs-x87.h',
'x87/codegen-x87.cc',
@ -1370,6 +1369,7 @@
'x87/interface-descriptors-x87.cc',
'x87/macro-assembler-x87.cc',
'x87/macro-assembler-x87.h',
'builtins/x87/builtins-x87.cc',
'compiler/x87/code-generator-x87.cc',
'compiler/x87/instruction-codes-x87.h',
'compiler/x87/instruction-scheduler-x87.cc',
@ -1396,7 +1396,6 @@
'mips/assembler-mips.cc',
'mips/assembler-mips.h',
'mips/assembler-mips-inl.h',
'mips/builtins-mips.cc',
'mips/codegen-mips.cc',
'mips/codegen-mips.h',
'mips/code-stubs-mips.cc',
@ -1413,6 +1412,7 @@
'mips/macro-assembler-mips.h',
'mips/simulator-mips.cc',
'mips/simulator-mips.h',
'builtins/mips/builtins-mips.cc',
'compiler/mips/code-generator-mips.cc',
'compiler/mips/instruction-codes-mips.h',
'compiler/mips/instruction-scheduler-mips.cc',
@ -1439,7 +1439,6 @@
'mips64/assembler-mips64.cc',
'mips64/assembler-mips64.h',
'mips64/assembler-mips64-inl.h',
'mips64/builtins-mips64.cc',
'mips64/codegen-mips64.cc',
'mips64/codegen-mips64.h',
'mips64/code-stubs-mips64.cc',
@ -1456,6 +1455,7 @@
'mips64/macro-assembler-mips64.h',
'mips64/simulator-mips64.cc',
'mips64/simulator-mips64.h',
'builtins/mips64/builtins-mips64.cc',
'compiler/mips64/code-generator-mips64.cc',
'compiler/mips64/instruction-codes-mips64.h',
'compiler/mips64/instruction-scheduler-mips64.cc',
@ -1479,6 +1479,7 @@
}],
['v8_target_arch=="x64" or v8_target_arch=="x32"', {
'sources': [ ### gcmole(arch:x64) ###
'builtins/x64/builtins-x64.cc',
'crankshaft/x64/lithium-codegen-x64.cc',
'crankshaft/x64/lithium-codegen-x64.h',
'crankshaft/x64/lithium-gap-resolver-x64.cc',
@ -1488,7 +1489,6 @@
'x64/assembler-x64-inl.h',
'x64/assembler-x64.cc',
'x64/assembler-x64.h',
'x64/builtins-x64.cc',
'x64/code-stubs-x64.cc',
'x64/code-stubs-x64.h',
'x64/codegen-x64.cc',
@ -1522,6 +1522,7 @@
}],
['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', {
'sources': [ ### gcmole(arch:ppc) ###
'builtins/ppc/builtins-ppc.cc',
'compiler/ppc/code-generator-ppc.cc',
'compiler/ppc/instruction-codes-ppc.h',
'compiler/ppc/instruction-scheduler-ppc.cc',
@ -1542,7 +1543,6 @@
'ppc/assembler-ppc-inl.h',
'ppc/assembler-ppc.cc',
'ppc/assembler-ppc.h',
'ppc/builtins-ppc.cc',
'ppc/code-stubs-ppc.cc',
'ppc/code-stubs-ppc.h',
'ppc/codegen-ppc.cc',
@ -1565,6 +1565,7 @@
}],
['v8_target_arch=="s390" or v8_target_arch=="s390x"', {
'sources': [ ### gcmole(arch:s390) ###
'builtins/s390/builtins-s390.cc',
'compiler/s390/code-generator-s390.cc',
'compiler/s390/instruction-codes-s390.h',
'compiler/s390/instruction-scheduler-s390.cc',
@ -1587,7 +1588,6 @@
's390/assembler-s390.cc',
's390/assembler-s390.h',
's390/assembler-s390-inl.h',
's390/builtins-s390.cc',
's390/codegen-s390.cc',
's390/codegen-s390.h',
's390/code-stubs-s390.cc',