Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: src/builtins/x64/builtins-x64.cc

Issue 2145023002: [builtins] move builtin files to src/builtins/. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/s390/builtins-s390.cc ('k') | src/builtins/x87/OWNERS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/x64/builtins-x64.cc
diff --git a/src/x64/builtins-x64.cc b/src/builtins/x64/builtins-x64.cc
similarity index 99%
rename from src/x64/builtins-x64.cc
rename to src/builtins/x64/builtins-x64.cc
index bdf00451acb85afb16a610b90f9d97e4b3f6d426..dfd653fdea1ad75b65b1cd9819522493aa2307a7 100644
--- a/src/x64/builtins-x64.cc
+++ b/src/builtins/x64/builtins-x64.cc
@@ -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
« no previous file with comments | « src/builtins/s390/builtins-s390.cc ('k') | src/builtins/x87/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698