Commit 2489567d authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC/s390: [builtins] Update isolate-independent list & related fixups

Port 519bd47f

Original Commit Message:

    With the exception of the InterpreterEntryTrampoline, all builtins are
    now isolate-independent and can be embedded into the binary.

    This CL updates the corresponding list and also contains a few smallish
    tweaks to support having these builtins off the heap:

    * wasm: copy the off-heap builtin, not its trampoline.
    * Code::contains: support off-heap builtins.
    * JSFunction::is_compiled: compare builtin index instead of identity
      (this is relevant during mksnapshot when we transition from the
      on-heap builtin to its off-heap representation + the trampoline).
    * Remove old DCHECKs.
    * A few tweaks in macro-assembler ports that have snuck in recently.

R=jgruber@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: Ib16ce35f5ebdade42720f536ac521c79e7c46778
Reviewed-on: https://chromium-review.googlesource.com/1042927Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#52973}
parent 7b046d04
......@@ -485,7 +485,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
Label stepping_prepared;
ExternalReference debug_hook =
ExternalReference::debug_hook_on_function_call_address(masm->isolate());
__ mov(ip, Operand(debug_hook));
__ Move(ip, debug_hook);
__ LoadByte(ip, MemOperand(ip), r0);
__ extsb(ip, ip);
__ CmpSmiLiteral(ip, Smi::kZero, r0);
......@@ -496,7 +496,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
ExternalReference debug_suspended_generator =
ExternalReference::debug_suspended_generator_address(masm->isolate());
__ mov(ip, Operand(debug_suspended_generator));
__ Move(ip, debug_suspended_generator);
__ LoadP(ip, MemOperand(ip));
__ cmp(ip, r4);
__ beq(&prepare_step_in_suspended_generator);
......@@ -627,11 +627,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
// r6: argc
// r7: argv
// r0,r8-r9, cp may be clobbered
{
NoRootArrayScope no_root_array(masm);
ProfileEntryHookStub::MaybeCallEntryHook(masm);
__ InitializeRootRegister();
}
ProfileEntryHookStub::MaybeCallEntryHook(masm);
// Enter an internal frame.
{
......@@ -1355,8 +1351,7 @@ static void GetSharedFunctionInfoCode(MacroAssembler* masm, Register sfi_data,
// IsSmi: Is builtin
__ JumpIfNotSmi(sfi_data, &check_is_bytecode_array);
__ mov(scratch1,
Operand(ExternalReference::builtins_address(masm->isolate())));
__ Move(scratch1, ExternalReference::builtins_address(masm->isolate()));
__ SmiUntag(sfi_data, LeaveRC, kPointerSizeLog2);
__ LoadPX(sfi_data, MemOperand(scratch1, sfi_data));
__ b(&done);
......@@ -1445,7 +1440,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
GetSharedFunctionInfoCode(masm, entry, r8);
// If code entry points to anything other than CompileLazy, install that.
__ mov(r8, Operand(masm->CodeObject()));
__ Move(r8, masm->CodeObject());
__ cmp(entry, r8);
__ beq(&gotta_call_runtime);
......@@ -1500,8 +1495,7 @@ void Builtins::Generate_DeserializeLazy(MacroAssembler* masm) {
// Load the code object at builtins_table[builtin_id] into scratch1.
__ SmiUntag(scratch1);
__ mov(scratch0,
Operand(ExternalReference::builtins_address(masm->isolate())));
__ Move(scratch0, ExternalReference::builtins_address(masm->isolate()));
__ ShiftLeftImm(scratch1, scratch1, Operand(kPointerSizeLog2));
__ LoadPX(scratch1, MemOperand(scratch0, scratch1));
......
......@@ -483,7 +483,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
Label stepping_prepared;
ExternalReference debug_hook =
ExternalReference::debug_hook_on_function_call_address(masm->isolate());
__ mov(ip, Operand(debug_hook));
__ Move(ip, debug_hook);
__ LoadB(ip, MemOperand(ip));
__ CmpSmiLiteral(ip, Smi::kZero, r0);
__ bne(&prepare_step_in_if_stepping);
......@@ -493,7 +493,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
ExternalReference debug_suspended_generator =
ExternalReference::debug_suspended_generator_address(masm->isolate());
__ mov(ip, Operand(debug_suspended_generator));
__ Move(ip, debug_suspended_generator);
__ LoadP(ip, MemOperand(ip));
__ CmpP(ip, r3);
__ beq(&prepare_step_in_suspended_generator);
......@@ -629,11 +629,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
// r5: argc
// r6: argv
// r0,r7-r9, cp may be clobbered
{
NoRootArrayScope no_root_array(masm);
ProfileEntryHookStub::MaybeCallEntryHook(masm);
__ InitializeRootRegister();
}
ProfileEntryHookStub::MaybeCallEntryHook(masm);
// Enter an internal frame.
{
......@@ -1360,8 +1356,7 @@ static void GetSharedFunctionInfoCode(MacroAssembler* masm, Register sfi_data,
// IsSmi: Is builtin
__ JumpIfNotSmi(sfi_data, &check_is_bytecode_array);
__ mov(scratch1,
Operand(ExternalReference::builtins_address(masm->isolate())));
__ Move(scratch1, ExternalReference::builtins_address(masm->isolate()));
__ SmiUntag(sfi_data, kPointerSizeLog2);
__ LoadP(sfi_data, MemOperand(scratch1, sfi_data));
__ b(&done);
......@@ -1450,7 +1445,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
GetSharedFunctionInfoCode(masm, entry, r7);
// If code entry points to anything other than CompileLazy, install that.
__ mov(r7, Operand(masm->CodeObject()));
__ Move(r7, masm->CodeObject());
__ CmpP(entry, r7);
__ beq(&gotta_call_runtime);
......@@ -1505,8 +1500,7 @@ void Builtins::Generate_DeserializeLazy(MacroAssembler* masm) {
// Load the code object at builtins_table[builtin_id] into scratch1.
__ SmiUntag(scratch1);
__ mov(scratch0,
Operand(ExternalReference::builtins_address(masm->isolate())));
__ Move(scratch0, ExternalReference::builtins_address(masm->isolate()));
__ ShiftLeftP(scratch1, scratch1, Operand(kPointerSizeLog2));
__ LoadP(scratch1, MemOperand(scratch0, scratch1));
......
......@@ -155,6 +155,7 @@ void TurboAssembler::LookupConstant(Register destination,
FixedArray::kHeaderSize + index * kPointerSize - kHeapObjectTag;
CHECK(is_uint19(offset));
DCHECK_NE(destination, r0);
LoadRoot(destination, Heap::kBuiltinsConstantsTableRootIndex);
LoadP(destination, MemOperand(destination, offset), r0);
}
......@@ -989,8 +990,8 @@ void TurboAssembler::EnterFrame(StackFrame::Type type,
PushCommonFrame(ip);
}
if (type == StackFrame::INTERNAL) {
mov(r0, Operand(CodeObject()));
push(r0);
Move(ip, CodeObject());
push(ip);
}
}
......@@ -1426,7 +1427,7 @@ void MacroAssembler::MaybeDropFrames() {
// Check whether we need to drop frames to restart a function on the stack.
ExternalReference restart_fp =
ExternalReference::debug_restart_fp_address(isolate());
mov(r4, Operand(restart_fp));
Move(r4, restart_fp);
LoadP(r4, MemOperand(r4));
cmpi(r4, Operand::Zero());
Jump(BUILTIN_CODE(isolate(), FrameDropperTrampoline), RelocInfo::CODE_TARGET,
......
......@@ -150,6 +150,7 @@ void TurboAssembler::LookupConstant(Register destination,
FixedArray::kHeaderSize + index * kPointerSize - kHeapObjectTag;
CHECK(is_uint19(offset));
DCHECK_NE(destination, r0);
LoadRoot(destination, Heap::kBuiltinsConstantsTableRootIndex);
LoadP(destination, MemOperand(destination, offset));
}
......@@ -1015,8 +1016,8 @@ void TurboAssembler::EnterFrame(StackFrame::Type type,
PushCommonFrame(ip);
if (type == StackFrame::INTERNAL) {
mov(r0, Operand(CodeObject()));
push(r0);
Move(r1, CodeObject());
push(r1);
}
}
......@@ -1447,7 +1448,7 @@ void MacroAssembler::MaybeDropFrames() {
// Check whether we need to drop frames to restart a function on the stack.
ExternalReference restart_fp =
ExternalReference::debug_restart_fp_address(isolate());
mov(r3, Operand(restart_fp));
Move(r3, restart_fp);
LoadP(r3, MemOperand(r3));
CmpP(r3, Operand::Zero());
Jump(BUILTIN_CODE(isolate(), FrameDropperTrampoline), RelocInfo::CODE_TARGET,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment