Verify correctness of external string only if slow asserts are enabled.

Review URL: http://codereview.chromium.org/294019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3090 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
antonm@chromium.org 2009-10-20 09:10:26 +00:00
parent 390fd2a3b8
commit 99445fc211

View File

@ -751,7 +751,7 @@ Object* String::TryFlatten() {
bool String::MakeExternal(v8::String::ExternalStringResource* resource) {
#ifdef DEBUG
{ // NOLINT (presubmit.py gets confused about if and braces)
if (FLAG_enable_slow_asserts) {
// Assert that the resource and the string are equivalent.
ASSERT(static_cast<size_t>(this->length()) == resource->length());
SmartPointer<uc16> smart_chars = this->ToWideCString();
@ -794,7 +794,7 @@ bool String::MakeExternal(v8::String::ExternalStringResource* resource) {
bool String::MakeExternal(v8::String::ExternalAsciiStringResource* resource) {
#ifdef DEBUG
{ // NOLINT (presubmit.py gets confused about if and braces)
if (FLAG_enable_slow_asserts) {
// Assert that the resource and the string are equivalent.
ASSERT(static_cast<size_t>(this->length()) == resource->length());
SmartPointer<char> smart_chars = this->ToCString();