Commit 194588d4 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC/s390: [ubsan] Port Smi to the new design

Port 6d706ae3

Original Commit Message:

    and split Smi out of objects.h into smi.h.

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

Change-Id: Id876a65c3e0af550caa246090b60580645faedc5
Reviewed-on: https://chromium-review.googlesource.com/c/1320032Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#57295}
parent 045756f3
...@@ -384,7 +384,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { ...@@ -384,7 +384,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
__ Move(ip, debug_hook); __ Move(ip, debug_hook);
__ LoadByte(ip, MemOperand(ip), r0); __ LoadByte(ip, MemOperand(ip), r0);
__ extsb(ip, ip); __ extsb(ip, ip);
__ CmpSmiLiteral(ip, Smi::kZero, r0); __ CmpSmiLiteral(ip, Smi::zero(), r0);
__ bne(&prepare_step_in_if_stepping); __ bne(&prepare_step_in_if_stepping);
// Flood function if we need to continue stepping in the suspended generator. // Flood function if we need to continue stepping in the suspended generator.
...@@ -1103,7 +1103,7 @@ static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) { ...@@ -1103,7 +1103,7 @@ static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) {
Label builtin_trampoline, trampoline_loaded; Label builtin_trampoline, trampoline_loaded;
Smi interpreter_entry_return_pc_offset( Smi interpreter_entry_return_pc_offset(
masm->isolate()->heap()->interpreter_entry_return_pc_offset()); masm->isolate()->heap()->interpreter_entry_return_pc_offset());
DCHECK_NE(interpreter_entry_return_pc_offset, Smi::kZero); DCHECK_NE(interpreter_entry_return_pc_offset, Smi::zero());
// If the SFI function_data is an InterpreterData, get the trampoline stored // If the SFI function_data is an InterpreterData, get the trampoline stored
// in it, otherwise get the trampoline from the builtins list. // in it, otherwise get the trampoline from the builtins list.
...@@ -1340,7 +1340,7 @@ void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { ...@@ -1340,7 +1340,7 @@ void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
// If the code object is null, just return to the caller. // If the code object is null, just return to the caller.
Label skip; Label skip;
__ CmpSmiLiteral(r3, Smi::kZero, r0); __ CmpSmiLiteral(r3, Smi::zero(), r0);
__ bne(&skip); __ bne(&skip);
__ Ret(); __ Ret();
...@@ -1598,7 +1598,7 @@ static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { ...@@ -1598,7 +1598,7 @@ static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
} else { } else {
__ Push(fp, r7, r4, r3); __ Push(fp, r7, r4, r3);
} }
__ Push(Smi::kZero); // Padding. __ Push(Smi::zero()); // Padding.
__ addi(fp, sp, __ addi(fp, sp,
Operand(ArgumentsAdaptorFrameConstants::kFixedFrameSizeFromFp)); Operand(ArgumentsAdaptorFrameConstants::kFixedFrameSizeFromFp));
} }
...@@ -2296,7 +2296,7 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) { ...@@ -2296,7 +2296,7 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
WasmInstanceObject::kCEntryStubOffset)); WasmInstanceObject::kCEntryStubOffset));
// Initialize the JavaScript context with 0. CEntry will use it to // Initialize the JavaScript context with 0. CEntry will use it to
// set the current context on the isolate. // set the current context on the isolate.
__ LoadSmiLiteral(cp, Smi::kZero); __ LoadSmiLiteral(cp, Smi::zero());
__ CallRuntimeWithCEntry(Runtime::kWasmCompileLazy, r5); __ CallRuntimeWithCEntry(Runtime::kWasmCompileLazy, r5);
// The entrypoint address is the return value. // The entrypoint address is the return value.
__ mr(r11, kReturnRegister0); __ mr(r11, kReturnRegister0);
......
...@@ -375,7 +375,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { ...@@ -375,7 +375,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
ExternalReference::debug_hook_on_function_call_address(masm->isolate()); ExternalReference::debug_hook_on_function_call_address(masm->isolate());
__ Move(ip, debug_hook); __ Move(ip, debug_hook);
__ LoadB(ip, MemOperand(ip)); __ LoadB(ip, MemOperand(ip));
__ CmpSmiLiteral(ip, Smi::kZero, r0); __ CmpSmiLiteral(ip, Smi::zero(), r0);
__ bne(&prepare_step_in_if_stepping); __ bne(&prepare_step_in_if_stepping);
// Flood function if we need to continue stepping in the suspended generator. // Flood function if we need to continue stepping in the suspended generator.
...@@ -1108,7 +1108,7 @@ static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) { ...@@ -1108,7 +1108,7 @@ static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) {
Label builtin_trampoline, trampoline_loaded; Label builtin_trampoline, trampoline_loaded;
Smi interpreter_entry_return_pc_offset( Smi interpreter_entry_return_pc_offset(
masm->isolate()->heap()->interpreter_entry_return_pc_offset()); masm->isolate()->heap()->interpreter_entry_return_pc_offset());
DCHECK_NE(interpreter_entry_return_pc_offset, Smi::kZero); DCHECK_NE(interpreter_entry_return_pc_offset, Smi::zero());
// If the SFI function_data is an InterpreterData, get the trampoline stored // If the SFI function_data is an InterpreterData, get the trampoline stored
// in it, otherwise get the trampoline from the builtins list. // in it, otherwise get the trampoline from the builtins list.
...@@ -1342,7 +1342,7 @@ void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { ...@@ -1342,7 +1342,7 @@ void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
// If the code object is null, just return to the caller. // If the code object is null, just return to the caller.
Label skip; Label skip;
__ CmpSmiLiteral(r2, Smi::kZero, r0); __ CmpSmiLiteral(r2, Smi::zero(), r0);
__ bne(&skip); __ bne(&skip);
__ Ret(); __ Ret();
...@@ -1602,7 +1602,7 @@ static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { ...@@ -1602,7 +1602,7 @@ static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
__ StoreP(r6, MemOperand(sp, 2 * kPointerSize)); __ StoreP(r6, MemOperand(sp, 2 * kPointerSize));
__ StoreP(r3, MemOperand(sp, 1 * kPointerSize)); __ StoreP(r3, MemOperand(sp, 1 * kPointerSize));
__ StoreP(r2, MemOperand(sp, 0 * kPointerSize)); __ StoreP(r2, MemOperand(sp, 0 * kPointerSize));
__ Push(Smi::kZero); // Padding. __ Push(Smi::zero()); // Padding.
__ la(fp, __ la(fp,
MemOperand(sp, ArgumentsAdaptorFrameConstants::kFixedFrameSizeFromFp)); MemOperand(sp, ArgumentsAdaptorFrameConstants::kFixedFrameSizeFromFp));
} }
...@@ -2303,7 +2303,7 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) { ...@@ -2303,7 +2303,7 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
WasmInstanceObject::kCEntryStubOffset)); WasmInstanceObject::kCEntryStubOffset));
// Initialize the JavaScript context with 0. CEntry will use it to // Initialize the JavaScript context with 0. CEntry will use it to
// set the current context on the isolate. // set the current context on the isolate.
__ LoadSmiLiteral(cp, Smi::kZero); __ LoadSmiLiteral(cp, Smi::zero());
__ CallRuntimeWithCEntry(Runtime::kWasmCompileLazy, r4); __ CallRuntimeWithCEntry(Runtime::kWasmCompileLazy, r4);
// The entrypoint address is the return value. // The entrypoint address is the return value.
__ LoadRR(ip, r2); __ LoadRR(ip, r2);
......
...@@ -2382,7 +2382,7 @@ void CodeGenerator::AssembleConstructFrame() { ...@@ -2382,7 +2382,7 @@ void CodeGenerator::AssembleConstructFrame() {
FieldMemOperand(kWasmInstanceRegister, FieldMemOperand(kWasmInstanceRegister,
WasmInstanceObject::kCEntryStubOffset), WasmInstanceObject::kCEntryStubOffset),
r0); r0);
__ Move(cp, Smi::kZero); __ Move(cp, Smi::zero());
__ CallRuntimeWithCEntry(Runtime::kThrowWasmStackOverflow, r5); __ CallRuntimeWithCEntry(Runtime::kThrowWasmStackOverflow, r5);
// We come from WebAssembly, there are no references for the GC. // We come from WebAssembly, there are no references for the GC.
ReferenceMap* reference_map = new (zone()) ReferenceMap(zone()); ReferenceMap* reference_map = new (zone()) ReferenceMap(zone());
......
...@@ -3068,7 +3068,7 @@ void CodeGenerator::AssembleConstructFrame() { ...@@ -3068,7 +3068,7 @@ void CodeGenerator::AssembleConstructFrame() {
__ LoadP(r4, FieldMemOperand(kWasmInstanceRegister, __ LoadP(r4, FieldMemOperand(kWasmInstanceRegister,
WasmInstanceObject::kCEntryStubOffset)); WasmInstanceObject::kCEntryStubOffset));
__ Move(cp, Smi::kZero); __ Move(cp, Smi::zero());
__ CallRuntimeWithCEntry(Runtime::kThrowWasmStackOverflow, r4); __ CallRuntimeWithCEntry(Runtime::kThrowWasmStackOverflow, r4);
// We come from WebAssembly, there are no references for the GC. // We come from WebAssembly, there are no references for the GC.
ReferenceMap* reference_map = new (zone()) ReferenceMap(zone()); ReferenceMap* reference_map = new (zone()) ReferenceMap(zone());
......
...@@ -581,7 +581,7 @@ void CallApiGetterStub::Generate(MacroAssembler* masm) { ...@@ -581,7 +581,7 @@ void CallApiGetterStub::Generate(MacroAssembler* masm) {
__ Push(scratch, scratch); __ Push(scratch, scratch);
__ Move(scratch, ExternalReference::isolate_address(isolate())); __ Move(scratch, ExternalReference::isolate_address(isolate()));
__ Push(scratch, holder); __ Push(scratch, holder);
__ Push(Smi::kZero); // should_throw_on_error -> false __ Push(Smi::zero()); // should_throw_on_error -> false
__ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset)); __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset));
__ push(scratch); __ push(scratch);
......
...@@ -1284,7 +1284,7 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target, ...@@ -1284,7 +1284,7 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target,
Move(r7, debug_hook_active); Move(r7, debug_hook_active);
LoadByte(r7, MemOperand(r7), r0); LoadByte(r7, MemOperand(r7), r0);
extsb(r7, r7); extsb(r7, r7);
CmpSmiLiteral(r7, Smi::kZero, r0); CmpSmiLiteral(r7, Smi::zero(), r0);
beq(&skip_hook); beq(&skip_hook);
{ {
...@@ -1421,7 +1421,7 @@ void MacroAssembler::PushStackHandler() { ...@@ -1421,7 +1421,7 @@ void MacroAssembler::PushStackHandler() {
STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize); STATIC_ASSERT(StackHandlerConstants::kSize == 2 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize);
Push(Smi::kZero); // Padding. Push(Smi::zero()); // Padding.
// Link the current handler as the next handler. // Link the current handler as the next handler.
// Preserve r3-r7. // Preserve r3-r7.
......
...@@ -613,7 +613,7 @@ void CallApiGetterStub::Generate(MacroAssembler* masm) { ...@@ -613,7 +613,7 @@ void CallApiGetterStub::Generate(MacroAssembler* masm) {
__ Push(scratch, scratch); __ Push(scratch, scratch);
__ Move(scratch, ExternalReference::isolate_address(isolate())); __ Move(scratch, ExternalReference::isolate_address(isolate()));
__ Push(scratch, holder); __ Push(scratch, holder);
__ Push(Smi::kZero); // should_throw_on_error -> false __ Push(Smi::zero()); // should_throw_on_error -> false
__ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset)); __ LoadP(scratch, FieldMemOperand(callback, AccessorInfo::kNameOffset));
__ push(scratch); __ push(scratch);
......
...@@ -1496,7 +1496,7 @@ void MacroAssembler::PushStackHandler() { ...@@ -1496,7 +1496,7 @@ void MacroAssembler::PushStackHandler() {
lay(sp, MemOperand(sp, -StackHandlerConstants::kSize)); lay(sp, MemOperand(sp, -StackHandlerConstants::kSize));
// Store padding. // Store padding.
mov(r0, Operand(Smi::kZero)); lghi(r0, Operand::Zero());
StoreP(r0, MemOperand(sp)); // Padding. StoreP(r0, MemOperand(sp)); // Padding.
// Copy the old handler into the next handler slot. // Copy the old handler into the next handler slot.
......
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