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

Unified Diff: include/v8.h

Issue 527603002: Use the "enum hack" to fix the SmiTagging constants. (Closed) Base URL: git@github.com:v8/v8.git@master
Patch Set: Addressed comment Created 6 years, 4 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 | « no previous file | src/compiler/change-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index cbe8edd59b59349f1492d68853c21ca79f9f122b..e3cd10fa8d690cca9ddf4ed5b8fdbc4a1f366f67 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5606,8 +5606,9 @@ V8_INLINE internal::Object* IntToSmi(int value) {
// Smi constants for 32-bit systems.
template <> struct SmiTagging<4> {
- static const int kSmiShiftSize = 0;
- static const int kSmiValueSize = 31;
+ enum { kSmiShiftSize = 0, kSmiValueSize = 31 };
+ static int SmiShiftSize() { return kSmiShiftSize; }
+ static int SmiValueSize() { return kSmiValueSize; }
V8_INLINE static int SmiToInt(const internal::Object* value) {
int shift_bits = kSmiTagSize + kSmiShiftSize;
// Throw away top 32 bits and shift down (requires >> to be sign extending).
@@ -5634,8 +5635,9 @@ template <> struct SmiTagging<4> {
// Smi constants for 64-bit systems.
template <> struct SmiTagging<8> {
- static const int kSmiShiftSize = 31;
- static const int kSmiValueSize = 32;
+ enum { kSmiShiftSize = 31, kSmiValueSize = 32 };
+ static int SmiShiftSize() { return kSmiShiftSize; }
+ static int SmiValueSize() { return kSmiValueSize; }
V8_INLINE static int SmiToInt(const internal::Object* value) {
int shift_bits = kSmiTagSize + kSmiShiftSize;
// Shift down and throw away top 32 bits.
« no previous file with comments | « no previous file | src/compiler/change-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698