Skip to content

Commit

Permalink
[mips][no-wasm] Exclude src/wasm from compilation
Browse files Browse the repository at this point in the history
Port: 3f9ff06

Bug: v8:11238
Change-Id: I3ac454b7ea1addbbf41407c7acd6a18da7b35d10
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2763965
Auto-Submit: Liu yu <[email protected]>
Reviewed-by: Zhao Jiazhong <[email protected]>
Reviewed-by: Clemens Backes <[email protected]>
Reviewed-by: Jakob Gruber <[email protected]>
Commit-Queue: Jakob Gruber <[email protected]>
Cr-Commit-Position: refs/heads/master@{#73457}
  • Loading branch information
LiuYu396 authored and Commit Bot committed Mar 17, 2021
1 parent 20a2551 commit 2c9ea6d
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 18 deletions.
14 changes: 9 additions & 5 deletions src/builtins/mips/builtins-mips.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
#include "src/objects/objects-inl.h"
#include "src/objects/smi.h"
#include "src/runtime/runtime.h"

#if V8_ENABLE_WEBASSEMBLY
#include "src/wasm/wasm-linkage.h"
#include "src/wasm/wasm-objects.h"
#endif // V8_ENABLE_WEBASSEMBLY

namespace v8 {
namespace internal {
Expand Down Expand Up @@ -2288,6 +2291,7 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
RelocInfo::CODE_TARGET);
}

#if V8_ENABLE_WEBASSEMBLY
void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
// The function index was put in t0 by the jump table trampoline.
// Convert to Smi for the runtime call.
Expand Down Expand Up @@ -2357,6 +2361,11 @@ void Builtins::Generate_WasmDebugBreak(MacroAssembler* masm) {
__ Ret();
}

void Builtins::Generate_GenericJSToWasmWrapper(MacroAssembler* masm) {
__ Trap();
}
#endif // V8_ENABLE_WEBASSEMBLY

void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
SaveFPRegsMode save_doubles, ArgvMode argv_mode,
bool builtin_exit_frame) {
Expand Down Expand Up @@ -2623,11 +2632,6 @@ void Builtins::Generate_DoubleToI(MacroAssembler* masm) {
__ Ret();
}

void Builtins::Generate_GenericJSToWasmWrapper(MacroAssembler* masm) {
// TODO(v8:10701): Implement for this platform.
__ Trap();
}

namespace {

int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
Expand Down
14 changes: 9 additions & 5 deletions src/builtins/mips64/builtins-mips64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
#include "src/objects/objects-inl.h"
#include "src/objects/smi.h"
#include "src/runtime/runtime.h"

#if V8_ENABLE_WEBASSEMBLY
#include "src/wasm/wasm-linkage.h"
#include "src/wasm/wasm-objects.h"
#endif // V8_ENABLE_WEBASSEMBLY

namespace v8 {
namespace internal {
Expand Down Expand Up @@ -2354,6 +2357,7 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
RelocInfo::CODE_TARGET);
}

#if V8_ENABLE_WEBASSEMBLY
void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
// The function index was put in t0 by the jump table trampoline.
// Convert to Smi for the runtime call
Expand Down Expand Up @@ -2449,6 +2453,11 @@ void Builtins::Generate_WasmDebugBreak(MacroAssembler* masm) {
__ Ret();
}

void Builtins::Generate_GenericJSToWasmWrapper(MacroAssembler* masm) {
__ Trap();
}
#endif // V8_ENABLE_WEBASSEMBLY

void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
SaveFPRegsMode save_doubles, ArgvMode argv_mode,
bool builtin_exit_frame) {
Expand Down Expand Up @@ -2716,11 +2725,6 @@ void Builtins::Generate_DoubleToI(MacroAssembler* masm) {
__ Ret();
}

void Builtins::Generate_GenericJSToWasmWrapper(MacroAssembler* masm) {
// TODO(v8:10701): Implement for this platform.
__ Trap();
}

namespace {

int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
Expand Down
5 changes: 3 additions & 2 deletions src/codegen/mips/macro-assembler-mips.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2744,11 +2744,12 @@ void TurboAssembler::TruncateDoubleToI(Isolate* isolate, Zone* zone,
Subu(sp, sp, Operand(kDoubleSize)); // Put input on stack.
Sdc1(double_input, MemOperand(sp, 0));

if (stub_mode == StubCallMode::kCallWasmRuntimeStub) {
#if V8_ENABLE_WEBASSEMBLY
if (stub_mode == StubCallMode::kCallWasmRuntimeStub) {
Call(wasm::WasmCode::kDoubleToI, RelocInfo::WASM_STUB_CALL);
#else
UNREACHABLE();
// For balance.
if (false) {
#endif // V8_ENABLE_WEBASSEMBLY
} else {
Call(BUILTIN_CODE(isolate, DoubleToI), RelocInfo::CODE_TARGET);
Expand Down
5 changes: 3 additions & 2 deletions src/codegen/mips64/macro-assembler-mips64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3382,11 +3382,12 @@ void TurboAssembler::TruncateDoubleToI(Isolate* isolate, Zone* zone,
Dsubu(sp, sp, Operand(kDoubleSize)); // Put input on stack.
Sdc1(double_input, MemOperand(sp, 0));

if (stub_mode == StubCallMode::kCallWasmRuntimeStub) {
#if V8_ENABLE_WEBASSEMBLY
if (stub_mode == StubCallMode::kCallWasmRuntimeStub) {
Call(wasm::WasmCode::kDoubleToI, RelocInfo::WASM_STUB_CALL);
#else
UNREACHABLE();
// For balance.
if (false) {
#endif // V8_ENABLE_WEBASSEMBLY
} else {
Call(BUILTIN_CODE(isolate, DoubleToI), RelocInfo::CODE_TARGET);
Expand Down
5 changes: 3 additions & 2 deletions src/compiler/backend/mips/code-generator-mips.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4076,13 +4076,14 @@ void CodeGenerator::AssembleConstructFrame() {
auto call_descriptor = linkage()->GetIncomingDescriptor();
if (frame_access_state()->has_frame()) {
if (call_descriptor->IsCFunctionCall()) {
if (info()->GetOutputStackFrameType() == StackFrame::C_WASM_ENTRY) {
#if V8_ENABLE_WEBASSEMBLY
if (info()->GetOutputStackFrameType() == StackFrame::C_WASM_ENTRY) {
__ StubPrologue(StackFrame::C_WASM_ENTRY);
// Reserve stack space for saving the c_entry_fp later.
__ Subu(sp, sp, Operand(kSystemPointerSize));
#else
UNREACHABLE();
// For balance.
if (false) {
#endif // V8_ENABLE_WEBASSEMBLY
} else {
__ Push(ra, fp);
Expand Down
5 changes: 3 additions & 2 deletions src/compiler/backend/mips64/code-generator-mips64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4286,13 +4286,14 @@ void CodeGenerator::AssembleConstructFrame() {

if (frame_access_state()->has_frame()) {
if (call_descriptor->IsCFunctionCall()) {
if (info()->GetOutputStackFrameType() == StackFrame::C_WASM_ENTRY) {
#if V8_ENABLE_WEBASSEMBLY
if (info()->GetOutputStackFrameType() == StackFrame::C_WASM_ENTRY) {
__ StubPrologue(StackFrame::C_WASM_ENTRY);
// Reserve stack space for saving the c_entry_fp later.
__ Dsubu(sp, sp, Operand(kSystemPointerSize));
#else
UNREACHABLE();
// For balance.
if (false) {
#endif // V8_ENABLE_WEBASSEMBLY
} else {
__ Push(ra, fp);
Expand Down

0 comments on commit 2c9ea6d

Please sign in to comment.