Verify correctness of external string only if slow asserts are enabled.
authorantonm@chromium.org <antonm@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 20 Oct 2009 09:10:26 +0000 (09:10 +0000)
committerantonm@chromium.org <antonm@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 20 Oct 2009 09:10:26 +0000 (09:10 +0000)
Review URL: http://codereview.chromium.org/294019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3090 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/objects.cc

index ab1d35f..0c9f965 100644 (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();