Revision: 17223
Author: [email protected]
Date: Tue Oct 15 16:12:25 2013 UTC
Log: Properly export uin32_bias double constant.
This makes LoadUint32 snapshot safe.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/27156004
http://code.google.com/p/v8/source/detail?r=17223
Modified:
/branches/bleeding_edge/src/assembler.cc
/branches/bleeding_edge/src/assembler.h
/branches/bleeding_edge/src/code-stubs.cc
/branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc
/branches/bleeding_edge/src/serialize.cc
=======================================
--- /branches/bleeding_edge/src/assembler.cc Mon Oct 14 12:41:28 2013 UTC
+++ /branches/bleeding_edge/src/assembler.cc Tue Oct 15 16:12:25 2013 UTC
@@ -98,6 +98,7 @@
double negative_infinity;
double canonical_non_hole_nan;
double the_hole_nan;
+ double uint32_bias;
};
static DoubleConstant double_constants;
@@ -908,6 +909,8 @@
double_constants.canonical_non_hole_nan = OS::nan_value();
double_constants.the_hole_nan = BitCast<double>(kHoleNanInt64);
double_constants.negative_infinity = -V8_INFINITY;
+ double_constants.uint32_bias =
+ static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1;
math_exp_data_mutex = new Mutex();
}
@@ -1339,6 +1342,12 @@
Redirect(isolate,
FUNCTION_ADDR(HeapProfiler::RecordObjectAllocationFromMasm)));
}
+
+
+ExternalReference ExternalReference::address_of_uint32_bias() {
+ return ExternalReference(
+ reinterpret_cast<void*>(&double_constants.uint32_bias));
+}
#ifndef V8_INTERPRETED_REGEXP
=======================================
--- /branches/bleeding_edge/src/assembler.h Mon Oct 14 12:41:28 2013 UTC
+++ /branches/bleeding_edge/src/assembler.h Tue Oct 15 16:12:25 2013 UTC
@@ -813,6 +813,7 @@
static ExternalReference address_of_negative_infinity();
static ExternalReference address_of_canonical_non_hole_nan();
static ExternalReference address_of_the_hole_nan();
+ static ExternalReference address_of_uint32_bias();
static ExternalReference math_sin_double_function(Isolate* isolate);
static ExternalReference math_cos_double_function(Isolate* isolate);
=======================================
--- /branches/bleeding_edge/src/code-stubs.cc Fri Oct 11 15:13:12 2013 UTC
+++ /branches/bleeding_edge/src/code-stubs.cc Tue Oct 15 16:12:25 2013 UTC
@@ -473,6 +473,7 @@
Generate(Token::SHR, INT32, SMI, SMI, OVERWRITE_RIGHT, isolate);
Generate(Token::SHR, NUMBER, SMI, SMI, NO_OVERWRITE, isolate);
Generate(Token::SHR, NUMBER, SMI, SMI, OVERWRITE_LEFT, isolate);
+ Generate(Token::SHR, NUMBER, SMI, INT32, OVERWRITE_RIGHT, isolate);
Generate(Token::SHR, SMI, SMI, SMI, NO_OVERWRITE, isolate);
Generate(Token::SHR, SMI, SMI, SMI, OVERWRITE_LEFT, isolate);
Generate(Token::SHR, SMI, SMI, SMI, OVERWRITE_RIGHT, isolate);
=======================================
--- /branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc Tue Oct 15
15:04:29 2013 UTC
+++ /branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc Tue Oct 15
16:12:25 2013 UTC
@@ -443,21 +443,16 @@
}
bind(&done);
}
-
-
-
-static double kUint32Bias =
- static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1;
void MacroAssembler::LoadUint32(XMMRegister dst,
Register src,
XMMRegister scratch) {
- ASSERT(!Serializer::enabled());
Label done;
cmp(src, Immediate(0));
- movdbl(scratch,
- Operand(reinterpret_cast<int32_t>(&kUint32Bias),
RelocInfo::NONE32));
+ ExternalReference uint32_bias =
+ ExternalReference::address_of_uint32_bias();
+ movdbl(scratch, Operand::StaticVariable(uint32_bias));
Cvtsi2sd(dst, src);
j(not_sign, &done, Label::kNear);
addsd(dst, scratch);
@@ -466,13 +461,14 @@
void MacroAssembler::LoadUint32NoSSE2(Register src) {
- ASSERT(!Serializer::enabled());
Label done;
push(src);
fild_s(Operand(esp, 0));
cmp(src, Immediate(0));
j(not_sign, &done, Label::kNear);
- fld_d(Operand(reinterpret_cast<int32_t>(&kUint32Bias),
RelocInfo::NONE32));
+ ExternalReference uint32_bias =
+ ExternalReference::address_of_uint32_bias();
+ fld_d(Operand::StaticVariable(uint32_bias));
faddp(1);
bind(&done);
add(esp, Immediate(kPointerSize));
=======================================
--- /branches/bleeding_edge/src/serialize.cc Mon Oct 14 12:41:28 2013 UTC
+++ /branches/bleeding_edge/src/serialize.cc Tue Oct 15 16:12:25 2013 UTC
@@ -585,6 +585,10 @@
UNCLASSIFIED,
64,
"HeapProfiler::RecordObjectAllocationFromMasm");
+ Add(ExternalReference::address_of_uint32_bias().address(),
+ UNCLASSIFIED,
+ 65,
+ "uint32_bias");
// Add a small set of deopt entry addresses to encoder without
generating the
// deopt table code, which isn't possible at deserialization time.
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.