Skip to content

Commit

Permalink
jumbo: Include src/compiler/*linkage.cc in jumbo compilation units
Browse files Browse the repository at this point in the history
BUG=chromium:752428

Change-Id: I0d1f3a09ecd2ffb7bfd8120b212e88fd00008fc0
Reviewed-on: https://chromium-review.googlesource.com/608961
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#47544}
  • Loading branch information
mostynb authored and Commit Bot committed Aug 23, 2017
1 parent 27fd52a commit 66ae347
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 24 deletions.
3 changes: 0 additions & 3 deletions BUILD.gn
Expand Up @@ -2076,9 +2076,6 @@ v8_source_set("v8_base") {
jumbo_excluded_sources = [
# TODO(mostynb@opera.com): don't exclude these http://crbug.com/752428
"src/profiler/heap-snapshot-generator.cc", # Macro clash in mman-linux.h
"src/compiler/c-linkage.cc", # Symbol clashes with linkage.cc
"src/compiler/wasm-linkage.cc", # regloc symbol clash with linkage.cc

"src/compiler/escape-analysis.cc", # Symbol clashes with new-escape-analysis.cc
"src/compiler/escape-analysis-reducer.cc", # Symbol clashes with new-escape-analysis-reducer.cc
]
Expand Down
17 changes: 8 additions & 9 deletions src/compiler/c-linkage.cc
Expand Up @@ -14,10 +14,6 @@ namespace internal {
namespace compiler {

namespace {
LinkageLocation regloc(Register reg, MachineType type) {
return LinkageLocation::ForRegister(reg.code(), type);
}


// Platform-specific configuration for C calling convention.
#if V8_TARGET_ARCH_IA32
Expand Down Expand Up @@ -178,19 +174,21 @@ CallDescriptor* Linkage::GetSimplifiedCDescriptor(
CHECK(locations.return_count_ <= 2);

if (locations.return_count_ > 0) {
locations.AddReturn(regloc(kReturnRegister0, msig->GetReturn(0)));
locations.AddReturn(LinkageLocation::ForRegister(kReturnRegister0.code(),
msig->GetReturn(0)));
}
if (locations.return_count_ > 1) {
locations.AddReturn(regloc(kReturnRegister1, msig->GetReturn(1)));
locations.AddReturn(LinkageLocation::ForRegister(kReturnRegister1.code(),
msig->GetReturn(1)));
}

const int parameter_count = static_cast<int>(msig->parameter_count());

#ifdef PARAM_REGISTERS
const Register kParamRegisters[] = {PARAM_REGISTERS};
const v8::internal::Register kParamRegisters[] = {PARAM_REGISTERS};
const int kParamRegisterCount = static_cast<int>(arraysize(kParamRegisters));
#else
const Register* kParamRegisters = nullptr;
const v8::internal::Register* kParamRegisters = nullptr;
const int kParamRegisterCount = 0;
#endif

Expand All @@ -202,7 +200,8 @@ CallDescriptor* Linkage::GetSimplifiedCDescriptor(
// Add register and/or stack parameter(s).
for (int i = 0; i < parameter_count; i++) {
if (i < kParamRegisterCount) {
locations.AddParam(regloc(kParamRegisters[i], msig->GetParam(i)));
locations.AddParam(LinkageLocation::ForRegister(kParamRegisters[i].code(),
msig->GetParam(i)));
} else {
locations.AddParam(LinkageLocation::ForCallerFrameSlot(
-1 - stack_offset, msig->GetParam(i)));
Expand Down
18 changes: 6 additions & 12 deletions src/compiler/wasm-linkage.cc
Expand Up @@ -38,14 +38,6 @@ MachineType MachineTypeFor(ValueType type) {
}
}

LinkageLocation regloc(Register reg, MachineType type) {
return LinkageLocation::ForRegister(reg.code(), type);
}

LinkageLocation regloc(DoubleRegister reg, MachineType type) {
return LinkageLocation::ForRegister(reg.code(), type);
}

LinkageLocation stackloc(int i, MachineType type) {
return LinkageLocation::ForCallerFrameSlot(i, type);
}
Expand Down Expand Up @@ -173,11 +165,12 @@ struct Allocator {
if (type == wasm::kWasmF32) {
int float_reg_code = reg.code() * 2;
DCHECK(float_reg_code < RegisterConfiguration::kMaxFPRegisters);
return regloc(DoubleRegister::from_code(float_reg_code),
MachineTypeFor(type));
return LinkageLocation::ForRegister(
DoubleRegister::from_code(float_reg_code).code(),
MachineTypeFor(type));
}
#endif
return regloc(reg, MachineTypeFor(type));
return LinkageLocation::ForRegister(reg.code(), MachineTypeFor(type));
} else {
int offset = -1 - stack_offset;
stack_offset += Words(type);
Expand All @@ -186,7 +179,8 @@ struct Allocator {
} else {
// Allocate a general purpose register/stack location.
if (gp_offset < gp_count) {
return regloc(gp_regs[gp_offset++], MachineTypeFor(type));
return LinkageLocation::ForRegister(gp_regs[gp_offset++].code(),
MachineTypeFor(type));
} else {
int offset = -1 - stack_offset;
stack_offset += Words(type);
Expand Down

0 comments on commit 66ae347

Please sign in to comment.