Revision: 15898
Author:   [email protected]
Date:     Fri Jul 26 03:40:00 2013
Log: Revert "Check that ExternalString objects get aligned resources" (r15894).

[email protected]

Review URL: https://codereview.chromium.org/20703002
http://code.google.com/p/v8/source/detail?r=15898

Modified:
 /branches/bleeding_edge/src/api.cc

=======================================
--- /branches/bleeding_edge/src/api.cc  Fri Jul 26 02:02:34 2013
+++ /branches/bleeding_edge/src/api.cc  Fri Jul 26 03:40:00 2013
@@ -779,8 +779,8 @@
 }


-static i::Smi* EncodeAlignedAsSmi(const void* value, const char* location) { - i::Smi* smi = const_cast<i::Smi*>(reinterpret_cast<const i::Smi*>(value));
+static i::Smi* EncodeAlignedAsSmi(void* value, const char* location) {
+  i::Smi* smi = reinterpret_cast<i::Smi*>(value);
   ApiCheck(smi->IsSmi(), location, "Pointer is not aligned");
   return smi;
 }
@@ -5937,10 +5937,6 @@
   LOG_API(isolate, "String::NewExternal");
   ENTER_V8(isolate);
   CHECK(resource && resource->data());
-  // Resource pointers need to look like Smis since ExternalString objects
- // are sometimes put into old pointer space (see i::String::MakeExternal).
-  CHECK(EncodeAlignedAsSmi(resource, "v8::String::NewExternal()"));
-  CHECK(EncodeAlignedAsSmi(resource->data(), "v8::String::NewExternal()"));
   i::Handle<i::String> result = NewExternalStringHandle(isolate, resource);
   isolate->heap()->external_string_table()->AddString(*result);
   return Utils::ToLocal(result);
@@ -5962,10 +5958,6 @@
     return false;
   }
   CHECK(resource && resource->data());
-  // Resource pointers need to look like Smis since ExternalString objects
- // are sometimes put into old pointer space (see i::String::MakeExternal).
-  CHECK(EncodeAlignedAsSmi(resource, "v8::String::MakeExternal()"));
- CHECK(EncodeAlignedAsSmi(resource->data(), "v8::String::MakeExternal()"));
   bool result = obj->MakeExternal(resource);
   if (result && !obj->IsInternalizedString()) {
     isolate->heap()->external_string_table()->AddString(*obj);
@@ -5981,10 +5973,6 @@
   LOG_API(isolate, "String::NewExternal");
   ENTER_V8(isolate);
   CHECK(resource && resource->data());
-  // Resource pointers need to look like Smis since ExternalString objects
- // are sometimes put into old pointer space (see i::String::MakeExternal).
-  CHECK(EncodeAlignedAsSmi(resource, "v8::String::NewExternal()"));
-  CHECK(EncodeAlignedAsSmi(resource->data(), "v8::String::NewExternal()"));
i::Handle<i::String> result = NewExternalAsciiStringHandle(isolate, resource);
   isolate->heap()->external_string_table()->AddString(*result);
   return Utils::ToLocal(result);
@@ -6007,10 +5995,6 @@
     return false;
   }
   CHECK(resource && resource->data());
-  // Resource pointers need to look like Smis since ExternalString objects
- // are sometimes put into old pointer space (see i::String::MakeExternal).
-  CHECK(EncodeAlignedAsSmi(resource, "v8::String::MakeExternal()"));
- CHECK(EncodeAlignedAsSmi(resource->data(), "v8::String::MakeExternal()"));
   bool result = obj->MakeExternal(resource);
   if (result && !obj->IsInternalizedString()) {
     isolate->heap()->external_string_table()->AddString(*obj);

--
--
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.


Reply via email to