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

Side by Side Diff: src/objects.h

Issue 2396353002: Revert "Add Smi::Zero and replace all Smi::FromInt(0) calls" (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « src/mips64/macro-assembler-mips64.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1503 DCHECK_EQ(result, value >= kMinValue && value <= kMaxValue); 1503 DCHECK_EQ(result, value >= kMinValue && value <= kMaxValue);
1504 return result; 1504 return result;
1505 } 1505 }
1506 1506
1507 DECLARE_CAST(Smi) 1507 DECLARE_CAST(Smi)
1508 1508
1509 // Dispatched behavior. 1509 // Dispatched behavior.
1510 void SmiPrint(std::ostream& os) const; // NOLINT 1510 void SmiPrint(std::ostream& os) const; // NOLINT
1511 DECLARE_VERIFIER(Smi) 1511 DECLARE_VERIFIER(Smi)
1512 1512
1513 static Smi* const kZero;
1514 static const int kMinValue = 1513 static const int kMinValue =
1515 (static_cast<unsigned int>(-1)) << (kSmiValueSize - 1); 1514 (static_cast<unsigned int>(-1)) << (kSmiValueSize - 1);
1516 static const int kMaxValue = -(kMinValue + 1); 1515 static const int kMaxValue = -(kMinValue + 1);
1517 1516
1518 private: 1517 private:
1519 DISALLOW_IMPLICIT_CONSTRUCTORS(Smi); 1518 DISALLOW_IMPLICIT_CONSTRUCTORS(Smi);
1520 }; 1519 };
1521 1520
1522 1521
1523 // Heap objects typically have a map pointer in their first word. However, 1522 // Heap objects typically have a map pointer in their first word. However,
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
2866 }; 2865 };
2867 2866
2868 template <class CompactionCallback> 2867 template <class CompactionCallback>
2869 void Compact(); 2868 void Compact();
2870 2869
2871 inline Object* Get(int index) const; 2870 inline Object* Get(int index) const;
2872 inline void Clear(int index); 2871 inline void Clear(int index);
2873 inline int Length() const; 2872 inline int Length() const;
2874 2873
2875 inline bool IsEmptySlot(int index) const; 2874 inline bool IsEmptySlot(int index) const;
2876 static Object* Empty() { return Smi::kZero; } 2875 static Object* Empty() { return Smi::FromInt(0); }
2877 2876
2878 class Iterator { 2877 class Iterator {
2879 public: 2878 public:
2880 explicit Iterator(Object* maybe_array) : list_(NULL) { Reset(maybe_array); } 2879 explicit Iterator(Object* maybe_array) : list_(NULL) { Reset(maybe_array); }
2881 void Reset(Object* maybe_array); 2880 void Reset(Object* maybe_array);
2882 2881
2883 template <class T> 2882 template <class T>
2884 inline T* Next(); 2883 inline T* Next();
2885 2884
2886 private: 2885 private:
(...skipping 8318 matching lines...) Expand 10 before | Expand all | Expand 10 after
11205 static void SetBreakPoint(Handle<DebugInfo> debug_info, int source_position, 11204 static void SetBreakPoint(Handle<DebugInfo> debug_info, int source_position,
11206 Handle<Object> break_point_object); 11205 Handle<Object> break_point_object);
11207 // Get the break point objects for a source position. 11206 // Get the break point objects for a source position.
11208 Handle<Object> GetBreakPointObjects(int source_position); 11207 Handle<Object> GetBreakPointObjects(int source_position);
11209 // Find the break point info holding this break point object. 11208 // Find the break point info holding this break point object.
11210 static Handle<Object> FindBreakPointInfo(Handle<DebugInfo> debug_info, 11209 static Handle<Object> FindBreakPointInfo(Handle<DebugInfo> debug_info,
11211 Handle<Object> break_point_object); 11210 Handle<Object> break_point_object);
11212 // Get the number of break points for this function. 11211 // Get the number of break points for this function.
11213 int GetBreakPointCount(); 11212 int GetBreakPointCount();
11214 11213
11215 static Smi* uninitialized() { return Smi::kZero; } 11214 static Smi* uninitialized() { return Smi::FromInt(0); }
11216 11215
11217 inline bool HasDebugBytecodeArray(); 11216 inline bool HasDebugBytecodeArray();
11218 inline bool HasDebugCode(); 11217 inline bool HasDebugCode();
11219 11218
11220 inline BytecodeArray* OriginalBytecodeArray(); 11219 inline BytecodeArray* OriginalBytecodeArray();
11221 inline BytecodeArray* DebugBytecodeArray(); 11220 inline BytecodeArray* DebugBytecodeArray();
11222 inline Code* DebugCode(); 11221 inline Code* DebugCode();
11223 11222
11224 DECLARE_CAST(DebugInfo) 11223 DECLARE_CAST(DebugInfo)
11225 11224
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
11402 } 11401 }
11403 return value; 11402 return value;
11404 } 11403 }
11405 }; 11404 };
11406 11405
11407 11406
11408 } // NOLINT, false-positive due to second-order macros. 11407 } // NOLINT, false-positive due to second-order macros.
11409 } // NOLINT, false-positive due to second-order macros. 11408 } // NOLINT, false-positive due to second-order macros.
11410 11409
11411 #endif // V8_OBJECTS_H_ 11410 #endif // V8_OBJECTS_H_
OLDNEW
« 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