Commit 8d97900a authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

Revert "[Assembler][x64] Make immediates immutable"

This reverts commit 01db326c.

Reason for revert:
https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20msvc/builds/1607

Original change's description:
> [Assembler][x64] Make immediates immutable
> 
> On x64, we already pass immediates by value. This CL ensures that this
> is indeed cheap, and it makes immediates immutable.
> 
> R=​mstarzinger@chromium.org
> 
> Bug: v8:7310
> Change-Id: I53a0666d53b9de69d390621298798c03b5190497
> Reviewed-on: https://chromium-review.googlesource.com/934341
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#51613}

TBR=mstarzinger@chromium.org,clemensh@chromium.org

Change-Id: Id3870e671c106644b62353c2b6c0ec2607596166
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7310
Reviewed-on: https://chromium-review.googlesource.com/939901Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51614}
parent 01db326c
......@@ -301,26 +301,23 @@ enum RoundingMode {
// -----------------------------------------------------------------------------
// Machine instruction Immediates
class Immediate {
class Immediate BASE_EMBEDDED {
public:
explicit constexpr Immediate(int32_t value) : value_(value) {}
explicit constexpr Immediate(int32_t value, RelocInfo::Mode rmode)
explicit Immediate(int32_t value) : value_(value) {}
explicit Immediate(int32_t value, RelocInfo::Mode rmode)
: value_(value), rmode_(rmode) {}
explicit Immediate(Smi* value)
: value_(static_cast<int32_t>(reinterpret_cast<intptr_t>(value))) {
explicit Immediate(Smi* value) {
DCHECK(SmiValuesAre31Bits()); // Only available for 31-bit SMI.
value_ = static_cast<int32_t>(reinterpret_cast<intptr_t>(value));
}
private:
const int32_t value_;
const RelocInfo::Mode rmode_ = RelocInfo::NONE;
int32_t value_;
RelocInfo::Mode rmode_ = RelocInfo::NONE;
friend class Assembler;
};
static_assert(sizeof(Immediate) <= kPointerSize,
"Immediate must be small enough to pass it by value");
static_assert(IS_TRIVIALLY_COPYABLE(Immediate),
"Immediate must be trivially copyable to pass it by value");
// -----------------------------------------------------------------------------
// Machine instruction Operands
......
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