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

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: 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 | « 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..e9fd7400d03a6933a37d103c376099cb8067abbe 100644
--- a/src/compiler/change-lowering.cc
+++ b/src/compiler/change-lowering.cc
@@ -50,28 +50,16 @@ 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() ? SmiTagging<4>::SmiValueSize()
+ : SmiTagging<8>::SmiValueSize();
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() ? SmiTagging<4>::SmiShiftSize()
+ : SmiTagging<8>::SmiShiftSize();
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