Revert "Check that ExternalString objects get aligned resources" (r15894).

R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/20703002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15898 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a6a11630
......@@ -779,8 +779,8 @@ static void* DecodeSmiToAligned(i::Object* value, const char* location) {
}
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 @@ Local<String> v8::String::NewExternal(
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 @@ bool v8::String::MakeExternal(v8::String::ExternalStringResource* resource) {
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 @@ Local<String> v8::String::NewExternal(
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 @@ bool v8::String::MakeExternal(
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment