Commit 9f68ab24 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC/s390: [nojit] Change builtin pointers to use Smis underneath

Port fa3cbf60

Original Commit Message:

    This changes Torque's builtin pointers to use a Smi representation
    underneath instead of storing the Code target object. Callsites look
    up the target entry point through IsolateData::builtin_entry_table.

    The notable effect of this CL is that builtin pointer calls no longer
    call any on-heap Code.

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

Change-Id: I49bb08de916fd93e576936a56b0e1a0e21072289
Reviewed-on: https://chromium-review.googlesource.com/c/1394301Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#58530}
parent 731ff0b8
...@@ -3024,8 +3024,18 @@ void TurboAssembler::JumpIfLessThan(Register x, int32_t y, Label* dest) { ...@@ -3024,8 +3024,18 @@ void TurboAssembler::JumpIfLessThan(Register x, int32_t y, Label* dest) {
} }
void TurboAssembler::CallBuiltinPointer(Register builtin_pointer) { void TurboAssembler::CallBuiltinPointer(Register builtin_pointer) {
STATIC_ASSERT(kSystemPointerSize == 8);
STATIC_ASSERT(kSmiShiftSize == 31);
STATIC_ASSERT(kSmiTagSize == 1);
STATIC_ASSERT(kSmiTag == 0);
// The builtin_pointer register contains the builtin index as a Smi.
// Untagging is folded into the indexing operand below.
ShiftRightArithImm(builtin_pointer, builtin_pointer,
kSmiShift - kSystemPointerSizeLog2);
addi(builtin_pointer, builtin_pointer, addi(builtin_pointer, builtin_pointer,
Operand(Code::kHeaderSize - kHeapObjectTag)); Operand(IsolateData::builtin_entry_table_offset()));
LoadPX(builtin_pointer, MemOperand(kRootRegister, builtin_pointer));
Call(builtin_pointer); Call(builtin_pointer);
} }
......
...@@ -4393,8 +4393,18 @@ void TurboAssembler::JumpIfLessThan(Register x, int32_t y, Label* dest) { ...@@ -4393,8 +4393,18 @@ void TurboAssembler::JumpIfLessThan(Register x, int32_t y, Label* dest) {
} }
void TurboAssembler::CallBuiltinPointer(Register builtin_pointer) { void TurboAssembler::CallBuiltinPointer(Register builtin_pointer) {
STATIC_ASSERT(kSystemPointerSize == 8);
STATIC_ASSERT(kSmiShiftSize == 31);
STATIC_ASSERT(kSmiTagSize == 1);
STATIC_ASSERT(kSmiTag == 0);
// The builtin_pointer register contains the builtin index as a Smi.
// Untagging is folded into the indexing operand below.
ShiftRightArithP(builtin_pointer, builtin_pointer,
Operand(kSmiShift - kSystemPointerSizeLog2));
AddP(builtin_pointer, builtin_pointer, AddP(builtin_pointer, builtin_pointer,
Operand(Code::kHeaderSize - kHeapObjectTag)); Operand(IsolateData::builtin_entry_table_offset()));
LoadP(builtin_pointer, MemOperand(kRootRegister, builtin_pointer));
Call(builtin_pointer); Call(builtin_pointer);
} }
......
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