# on linux we need these compiler flags to avoid crashes in the v8 test suite
# and avoid dtoa.c strict aliasing issues
if os.environ.get('GCC_VERSION') == '44':
- GCC_EXTRA_CCFLAGS = ['-fno-tree-vrp', '-fno-strict-aliasing']
+ GCC_EXTRA_CCFLAGS = ['-fno-tree-vrp']
GCC_DTOA_EXTRA_CCFLAGS = []
else:
GCC_EXTRA_CCFLAGS = []
'-frerun-cse-after-loop',
'-frename-registers',
'-fomit-frame-pointer',
- '-fno-strict-aliasing',
'-finline-limit=64',
'-DCAN_USE_VFP_INSTRUCTIONS=1',
'-DCAN_USE_ARMV7_INSTRUCTIONS=1',
}
void Iterate(ObjectVisitor* v) {
- v->VisitPointer(BitCast<Object**, FixedArray**>(&cache_));
+ v->VisitPointer(BitCast<Object**>(&cache_));
}
void Debug::Iterate(ObjectVisitor* v) {
- v->VisitPointer(BitCast<Object**, Code**>(&(debug_break_return_)));
- v->VisitPointer(BitCast<Object**, Code**>(&(debug_break_slot_)));
+ v->VisitPointer(BitCast<Object**>(&(debug_break_return_)));
+ v->VisitPointer(BitCast<Object**>(&(debug_break_slot_)));
}
#define ROOT_ACCESSOR(type, name, camel_name) \
static inline Handle<type> name() { \
- return Handle<type>(BitCast<type**, Object**>( \
+ return Handle<type>(BitCast<type**>( \
&Heap::roots_[Heap::k##camel_name##RootIndex])); \
}
ROOT_LIST(ROOT_ACCESSOR)
#define SYMBOL_ACCESSOR(name, str) \
static inline Handle<String> name() { \
- return Handle<String>(BitCast<String**, Object**>( \
+ return Handle<String>(BitCast<String**>( \
&Heap::roots_[Heap::k##name##RootIndex])); \
}
SYMBOL_LIST(SYMBOL_ACCESSOR)
v->VisitPointers(&roots_[0], &roots_[kStrongRootListLength]);
v->Synchronize("strong_root_list");
- v->VisitPointer(BitCast<Object**, String**>(&hidden_symbol_));
+ v->VisitPointer(BitCast<Object**>(&hidden_symbol_));
v->Synchronize("symbol");
Bootstrapper::Iterate(v);
void Simulator::set_fpu_register_double(int fpureg, double value) {
ASSERT((fpureg >= 0) && (fpureg < kNumFPURegisters) && ((fpureg % 2) == 0));
- *v8i::BitCast<double*, int32_t*>(&FPUregisters_[fpureg]) = value;
+ *v8i::BitCast<double*>(&FPUregisters_[fpureg]) = value;
}
double Simulator::get_fpu_register_double(int fpureg) const {
ASSERT((fpureg >= 0) && (fpureg < kNumFPURegisters) && ((fpureg % 2) == 0));
- return *v8i::BitCast<double*, int32_t*>(
- const_cast<int32_t*>(&FPUregisters_[fpureg]));
+ return *v8i::BitCast<double*>(const_cast<int32_t*>(&FPUregisters_[fpureg]));
}
// Raw access to the PC register.
break;
case MFHC1:
fp_out = get_fpu_register_double(fs_reg);
- alu_out = *v8i::BitCast<int32_t*, double*>(&fp_out);
+ alu_out = *v8i::BitCast<int32_t*>(&fp_out);
break;
case MTC1:
case MTHC1:
void Top::Iterate(ObjectVisitor* v, ThreadLocalTop* thread) {
v->VisitPointer(&(thread->pending_exception_));
v->VisitPointer(&(thread->pending_message_obj_));
- v->VisitPointer(
- BitCast<Object**, Script**>(&(thread->pending_message_script_)));
- v->VisitPointer(BitCast<Object**, Context**>(&(thread->context_)));
+ v->VisitPointer(BitCast<Object**>(&(thread->pending_message_script_)));
+ v->VisitPointer(BitCast<Object**>(&(thread->context_)));
v->VisitPointer(&(thread->scheduled_exception_));
for (v8::TryCatch* block = thread->TryCatchHandler();
block != NULL;
block = TRY_CATCH_FROM_ADDRESS(block->next_)) {
- v->VisitPointer(BitCast<Object**, void**>(&(block->exception_)));
- v->VisitPointer(BitCast<Object**, void**>(&(block->message_)));
+ v->VisitPointer(BitCast<Object**>(&(block->exception_)));
+ v->VisitPointer(BitCast<Object**>(&(block->message_)));
}
// Iterate over pointers on native execution stack.
return dest;
}
-} } // namespace v8::internal
+template <class Dest, class Source>
+inline Dest BitCast(Source* const & source) {
+ return BitCast<Dest>(reinterpret_cast<uintptr_t>(source));
+}
+} } // namespace v8::internal
#endif // V8_UTILS_H_
int32_t disp_value = 0;
if (mode == 0x80 || is_baseless) {
// Mode 2 or mode 0 with rbp/r13 as base: Word displacement.
- disp_value = *reinterpret_cast<const int32_t*>(&operand.buf_[disp_offset]);
+ disp_value = *BitCast<const int32_t*>(&operand.buf_[disp_offset]);
} else if (mode == 0x40) {
// Mode 1: Byte displacement.
disp_value = static_cast<signed char>(operand.buf_[disp_offset]);
'conditions': [
[ 'gcc_version==44', {
'cflags': [
- # Avoid gcc 4.4 strict aliasing issues in dtoa.c
- '-fno-strict-aliasing',
# Avoid crashes with gcc 4.4 in the v8 test suite.
'-fno-tree-vrp',
],