Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Unified Diff: src/objects.h

Issue 2381843002: Add Smi::Zero and replace all Smi::FromInt(0) calls (Closed)
Patch Set: Mark Smi::kZero as V8_EXPORT_PRIVATE Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips64/macro-assembler-mips64.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 123d1c229c719b14b1a1b6601ee3e6af8398e474..60ac93428dab054da703ec4287e991c49b8837a5 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1510,6 +1510,7 @@ class Smi: public Object {
void SmiPrint(std::ostream& os) const; // NOLINT
DECLARE_VERIFIER(Smi)
+ V8_EXPORT_PRIVATE static Smi* const kZero;
static const int kMinValue =
(static_cast<unsigned int>(-1)) << (kSmiValueSize - 1);
static const int kMaxValue = -(kMinValue + 1);
@@ -2872,7 +2873,7 @@ class WeakFixedArray : public FixedArray {
inline int Length() const;
inline bool IsEmptySlot(int index) const;
- static Object* Empty() { return Smi::FromInt(0); }
+ static Object* Empty() { return Smi::kZero; }
class Iterator {
public:
@@ -11216,7 +11217,7 @@ class DebugInfo: public Struct {
// Get the number of break points for this function.
int GetBreakPointCount();
- static Smi* uninitialized() { return Smi::FromInt(0); }
+ static Smi* uninitialized() { return Smi::kZero; }
inline bool HasDebugBytecodeArray();
inline bool HasDebugCode();
« no previous file with comments | « src/mips64/macro-assembler-mips64.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698