| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index d587b81fd3461202a807bcdd0b68ab7f25f6d5a4..c93b23c47105f70a630af1cc6cdf3548dde88712 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -5931,23 +5931,6 @@ i::Handle<i::String> NewExternalAsciiStringHandle(i::Isolate* isolate,
|
| }
|
|
|
|
|
| -bool RedirectToExternalString(i::Isolate* isolate,
|
| - i::Handle<i::String> parent,
|
| - i::Handle<i::String> external) {
|
| - if (parent->IsConsString()) {
|
| - i::Handle<i::ConsString> cons = i::Handle<i::ConsString>::cast(parent);
|
| - cons->set_first(*external);
|
| - cons->set_second(isolate->heap()->empty_string());
|
| - } else {
|
| - ASSERT(parent->IsSlicedString());
|
| - i::Handle<i::SlicedString> slice = i::Handle<i::SlicedString>::cast(parent);
|
| - slice->set_parent(*external);
|
| - slice->set_offset(0);
|
| - }
|
| - return true;
|
| -}
|
| -
|
| -
|
| Local<String> v8::String::NewExternal(
|
| v8::String::ExternalStringResource* resource) {
|
| i::Isolate* isolate = i::Isolate::Current();
|
| @@ -5976,23 +5959,9 @@ bool v8::String::MakeExternal(v8::String::ExternalStringResource* resource) {
|
| return false;
|
| }
|
| CHECK(resource && resource->data());
|
| -
|
| - bool result;
|
| - i::Handle<i::String> external;
|
| - if (isolate->heap()->old_pointer_space()->Contains(*obj)) {
|
| - // We do not allow external strings in the old pointer space. Instead of
|
| - // converting the string in-place, we keep the cons/sliced string and
|
| - // point it to a newly-allocated external string.
|
| - external = NewExternalStringHandle(isolate, resource);
|
| - result = RedirectToExternalString(isolate, obj, external);
|
| - } else {
|
| - result = obj->MakeExternal(resource);
|
| - external = obj;
|
| - }
|
| -
|
| - ASSERT(external->IsExternalString());
|
| - if (result && !external->IsInternalizedString()) {
|
| - isolate->heap()->external_string_table()->AddString(*external);
|
| + bool result = obj->MakeExternal(resource);
|
| + if (result && !obj->IsInternalizedString()) {
|
| + isolate->heap()->external_string_table()->AddString(*obj);
|
| }
|
| return result;
|
| }
|
| @@ -6027,23 +5996,9 @@ bool v8::String::MakeExternal(
|
| return false;
|
| }
|
| CHECK(resource && resource->data());
|
| -
|
| - bool result;
|
| - i::Handle<i::String> external;
|
| - if (isolate->heap()->old_pointer_space()->Contains(*obj)) {
|
| - // We do not allow external strings in the old pointer space. Instead of
|
| - // converting the string in-place, we keep the cons/sliced string and
|
| - // point it to a newly-allocated external string.
|
| - external = NewExternalAsciiStringHandle(isolate, resource);
|
| - result = RedirectToExternalString(isolate, obj, external);
|
| - } else {
|
| - result = obj->MakeExternal(resource);
|
| - external = obj;
|
| - }
|
| -
|
| - ASSERT(external->IsExternalString());
|
| - if (result && !external->IsInternalizedString()) {
|
| - isolate->heap()->external_string_table()->AddString(*external);
|
| + bool result = obj->MakeExternal(resource);
|
| + if (result && !obj->IsInternalizedString()) {
|
| + isolate->heap()->external_string_table()->AddString(*obj);
|
| }
|
| return result;
|
| }
|
| @@ -6084,7 +6039,7 @@ Local<v8::Value> v8::NumberObject::New(double value) {
|
| }
|
|
|
|
|
| -double v8::NumberObject::ValueOf() const {
|
| +double v8::NumberObject::NumberValue() const {
|
| i::Isolate* isolate = i::Isolate::Current();
|
| if (IsDeadCheck(isolate, "v8::NumberObject::NumberValue()")) return 0;
|
| LOG_API(isolate, "NumberObject::NumberValue");
|
| @@ -6108,7 +6063,7 @@ Local<v8::Value> v8::BooleanObject::New(bool value) {
|
| }
|
|
|
|
|
| -bool v8::BooleanObject::ValueOf() const {
|
| +bool v8::BooleanObject::BooleanValue() const {
|
| i::Isolate* isolate = i::Isolate::Current();
|
| if (IsDeadCheck(isolate, "v8::BooleanObject::BooleanValue()")) return 0;
|
| LOG_API(isolate, "BooleanObject::BooleanValue");
|
| @@ -6129,7 +6084,7 @@ Local<v8::Value> v8::StringObject::New(Handle<String> value) {
|
| }
|
|
|
|
|
| -Local<v8::String> v8::StringObject::ValueOf() const {
|
| +Local<v8::String> v8::StringObject::StringValue() const {
|
| i::Isolate* isolate = i::Isolate::Current();
|
| if (IsDeadCheck(isolate, "v8::StringObject::StringValue()")) {
|
| return Local<v8::String>();
|
| @@ -6153,7 +6108,7 @@ Local<v8::Value> v8::SymbolObject::New(Isolate* isolate, Handle<Symbol> value) {
|
| }
|
|
|
|
|
| -Local<v8::Symbol> v8::SymbolObject::ValueOf() const {
|
| +Local<v8::Symbol> v8::SymbolObject::SymbolValue() const {
|
| i::Isolate* isolate = i::Isolate::Current();
|
| if (IsDeadCheck(isolate, "v8::SymbolObject::SymbolValue()"))
|
| return Local<v8::Symbol>();
|
| @@ -6182,7 +6137,7 @@ Local<v8::Value> v8::Date::New(double time) {
|
| }
|
|
|
|
|
| -double v8::Date::ValueOf() const {
|
| +double v8::Date::NumberValue() const {
|
| i::Isolate* isolate = i::Isolate::Current();
|
| if (IsDeadCheck(isolate, "v8::Date::NumberValue()")) return 0;
|
| LOG_API(isolate, "Date::NumberValue");
|
|
|