Revision: 25127
Author: [email protected]
Date: Wed Nov 5 07:30:07 2014 UTC
Log: Truncate strings synchronized.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/702743002
https://code.google.com/p/v8/source/detail?r=25127
Modified:
/branches/bleeding_edge/src/objects-inl.h
=======================================
--- /branches/bleeding_edge/src/objects-inl.h Tue Nov 4 11:40:21 2014 UTC
+++ /branches/bleeding_edge/src/objects-inl.h Wed Nov 5 07:30:07 2014 UTC
@@ -4331,8 +4331,10 @@
}
if (instance_type == ONE_BYTE_STRING_TYPE ||
instance_type == ONE_BYTE_INTERNALIZED_STRING_TYPE) {
+ // Strings may get concurrently truncated, hence we have to access its
+ // length synchronized.
return SeqOneByteString::SizeFor(
- reinterpret_cast<SeqOneByteString*>(this)->length());
+ reinterpret_cast<SeqOneByteString*>(this)->synchronized_length());
}
if (instance_type == BYTE_ARRAY_TYPE) {
return reinterpret_cast<ByteArray*>(this)->ByteArraySize();
@@ -4342,8 +4344,10 @@
}
if (instance_type == STRING_TYPE ||
instance_type == INTERNALIZED_STRING_TYPE) {
+ // Strings may get concurrently truncated, hence we have to access its
+ // length synchronized.
return SeqTwoByteString::SizeFor(
- reinterpret_cast<SeqTwoByteString*>(this)->length());
+ reinterpret_cast<SeqTwoByteString*>(this)->synchronized_length());
}
if (instance_type == FIXED_DOUBLE_ARRAY_TYPE) {
return FixedDoubleArray::SizeFor(
--
--
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/d/optout.