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

Unified Diff: src/compiler/change-lowering.cc

Issue 527603002: Use the "enum hack" to fix the SmiTagging constants. (Closed) Base URL: git@github.com:v8/v8.git@master
Patch Set: fix typo 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 | « include/v8.h ('k') | test/compiler-unittests/change-lowering-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/change-lowering.cc
diff --git a/src/compiler/change-lowering.cc b/src/compiler/change-lowering.cc
index c2805bb0a329b463536b0deef8edadc6fa567d47..da01c92d4d7ee4c9ae5024c7768fcf4e7394c18c 100644
--- a/src/compiler/change-lowering.cc
+++ b/src/compiler/change-lowering.cc
@@ -50,28 +50,18 @@ Node* ChangeLowering::HeapNumberValueIndexConstant() {
Node* ChangeLowering::SmiMaxValueConstant() {
- // TODO(turbofan): Work-around for weird GCC 4.6 linker issue:
- // src/compiler/change-lowering.cc:46: undefined reference to
- // `v8::internal::SmiTagging<4u>::kSmiValueSize'
- // src/compiler/change-lowering.cc:46: undefined reference to
- // `v8::internal::SmiTagging<8u>::kSmiValueSize'
- STATIC_ASSERT(SmiTagging<4>::kSmiValueSize == 31);
- STATIC_ASSERT(SmiTagging<8>::kSmiValueSize == 32);
- const int smi_value_size = machine()->is64() ? 32 : 31;
+ const int smi_value_size =
+ machine()->is32() ? static_cast<int>(SmiTagging<4>::kSmiValueSize)
Jarin 2014/09/01 06:20:21 You might want to define a static method GetSmiVal
rossberg 2014/09/01 09:51:48 +1
+ : static_cast<int>(SmiTagging<8>::kSmiValueSize);
return jsgraph()->Int32Constant(
-(static_cast<int>(0xffffffffu << (smi_value_size - 1)) + 1));
}
Node* ChangeLowering::SmiShiftBitsConstant() {
- // TODO(turbofan): Work-around for weird GCC 4.6 linker issue:
- // src/compiler/change-lowering.cc:46: undefined reference to
- // `v8::internal::SmiTagging<4u>::kSmiShiftSize'
- // src/compiler/change-lowering.cc:46: undefined reference to
- // `v8::internal::SmiTagging<8u>::kSmiShiftSize'
- STATIC_ASSERT(SmiTagging<4>::kSmiShiftSize == 0);
- STATIC_ASSERT(SmiTagging<8>::kSmiShiftSize == 31);
- const int smi_shift_size = machine()->is64() ? 31 : 0;
+ const int smi_shift_size =
+ machine()->is32() ? static_cast<int>(SmiTagging<4>::kSmiShiftSize)
+ : static_cast<int>(SmiTagging<8>::kSmiShiftSize);
return jsgraph()->Int32Constant(smi_shift_size + kSmiTagSize);
}
« no previous file with comments | « include/v8.h ('k') | test/compiler-unittests/change-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698