Commit 34342f31 authored by clemensh's avatar clemensh Committed by Commit bot

Move Smi::kZero definition to the header

Since we don't pass references to this constant to the DCHECKs any more
(see http://crrev.com/2524093002), the constant can now be initialized
in the header, reducing code size and increasing performance.

Before the mentioned change in CHECK/DCHECK, this caused link errors.

R=ishell@chromium.org
CC=jgruber@chromium.org
BUG=v8:5684

Review-Url: https://codereview.chromium.org/2541533002
Cr-Commit-Position: refs/heads/master@{#41450}
parent 39e6f2ca
......@@ -2203,9 +2203,6 @@ std::ostream& operator<<(std::ostream& os, const Brief& v) {
return os;
}
// Declaration of the static Smi::kZero constant.
Smi* const Smi::kZero(nullptr);
void Smi::SmiPrint(std::ostream& os) const { // NOLINT
os << value();
}
......
......@@ -1612,7 +1612,7 @@ class Smi: public Object {
V8_EXPORT_PRIVATE void SmiPrint(std::ostream& os) const; // NOLINT
DECLARE_VERIFIER(Smi)
V8_EXPORT_PRIVATE static Smi* const kZero;
static constexpr Smi* const kZero = nullptr;
static const int kMinValue =
(static_cast<unsigned int>(-1)) << (kSmiValueSize - 1);
static const int kMaxValue = -(kMinValue + 1);
......
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