Commit 7dccb798 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

Fix GCC 5.4 error on ubuntu 16.04

The stock GCC on Ubuntu 16.04 complains these constants
are unused (possibly gcc issue). This CL changes these
to constexpr to workaround gcc errors.

R=clemensh@chromium.org, joransiu@ca.ibm.com

Change-Id: I8c1772e91744bc46ace6bee576b90d40c0cdf41f
Reviewed-on: https://chromium-review.googlesource.com/881554Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#50936}
parent 2c5de06c
This diff is collapsed.
...@@ -110,7 +110,7 @@ void HandleScope::DeleteExtensions(Isolate* isolate) { ...@@ -110,7 +110,7 @@ void HandleScope::DeleteExtensions(Isolate* isolate) {
void HandleScope::ZapRange(Object** start, Object** end) { void HandleScope::ZapRange(Object** start, Object** end) {
DCHECK_LE(end - start, kHandleBlockSize); DCHECK_LE(end - start, kHandleBlockSize);
for (Object** p = start; p != end; p++) { for (Object** p = start; p != end; p++) {
*reinterpret_cast<Address*>(p) = kHandleZapValue; *reinterpret_cast<Address*>(p) = reinterpret_cast<Address>(kHandleZapValue);
} }
} }
#endif #endif
......
...@@ -4945,7 +4945,8 @@ void Heap::ZapFromSpace() { ...@@ -4945,7 +4945,8 @@ void Heap::ZapFromSpace() {
PageRange(new_space_->FromSpaceStart(), new_space_->FromSpaceEnd())) { PageRange(new_space_->FromSpaceStart(), new_space_->FromSpaceEnd())) {
for (Address cursor = page->area_start(), limit = page->area_end(); for (Address cursor = page->area_start(), limit = page->area_end();
cursor < limit; cursor += kPointerSize) { cursor < limit; cursor += kPointerSize) {
Memory::Address_at(cursor) = kFromSpaceZapValue; Memory::Address_at(cursor) =
reinterpret_cast<Address>(kFromSpaceZapValue);
} }
} }
} }
......
...@@ -1106,7 +1106,7 @@ bool MemoryAllocator::UncommitBlock(Address start, size_t size) { ...@@ -1106,7 +1106,7 @@ bool MemoryAllocator::UncommitBlock(Address start, size_t size) {
void MemoryAllocator::ZapBlock(Address start, size_t size) { void MemoryAllocator::ZapBlock(Address start, size_t size) {
for (size_t s = 0; s + kPointerSize <= size; s += kPointerSize) { for (size_t s = 0; s + kPointerSize <= size; s += kPointerSize) {
Memory::Address_at(start + s) = kZapValue; Memory::Address_at(start + s) = reinterpret_cast<Address>(kZapValue);
} }
} }
......
...@@ -186,7 +186,8 @@ void MacroAssembler::PushAddress(ExternalReference source) { ...@@ -186,7 +186,8 @@ void MacroAssembler::PushAddress(ExternalReference source) {
int64_t address = reinterpret_cast<int64_t>(source.address()); int64_t address = reinterpret_cast<int64_t>(source.address());
if (is_int32(address) && !serializer_enabled()) { if (is_int32(address) && !serializer_enabled()) {
if (emit_debug_code()) { if (emit_debug_code()) {
Move(kScratchRegister, kZapValue, RelocInfo::NONE); Move(kScratchRegister, reinterpret_cast<Address>(kZapValue),
RelocInfo::NONE);
} }
Push(Immediate(static_cast<int32_t>(address))); Push(Immediate(static_cast<int32_t>(address)));
return; return;
...@@ -255,8 +256,8 @@ void MacroAssembler::RecordWriteField(Register object, int offset, ...@@ -255,8 +256,8 @@ void MacroAssembler::RecordWriteField(Register object, int offset,
// Clobber clobbered input registers when running with the debug-code flag // Clobber clobbered input registers when running with the debug-code flag
// turned on to provoke errors. // turned on to provoke errors.
if (emit_debug_code()) { if (emit_debug_code()) {
Move(value, kZapValue, RelocInfo::NONE); Move(value, reinterpret_cast<Address>(kZapValue), RelocInfo::NONE);
Move(dst, kZapValue, RelocInfo::NONE); Move(dst, reinterpret_cast<Address>(kZapValue), RelocInfo::NONE);
} }
} }
...@@ -386,8 +387,8 @@ void MacroAssembler::RecordWrite(Register object, Register address, ...@@ -386,8 +387,8 @@ void MacroAssembler::RecordWrite(Register object, Register address,
// Clobber clobbered registers when running with the debug-code flag // Clobber clobbered registers when running with the debug-code flag
// turned on to provoke errors. // turned on to provoke errors.
if (emit_debug_code()) { if (emit_debug_code()) {
Move(address, kZapValue, RelocInfo::NONE); Move(address, reinterpret_cast<Address>(kZapValue), RelocInfo::NONE);
Move(value, kZapValue, RelocInfo::NONE); Move(value, reinterpret_cast<Address>(kZapValue), RelocInfo::NONE);
} }
} }
......
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