Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Unified Diff: src/objects-inl.h

Issue 2625073002: Revert of Internalize strings in-place (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects-debug.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 2097aea50458dba5823e7ca767858929e741b70b..b56efe305bf70b6cec639af606a1cc0faaa3df22 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -272,11 +272,6 @@
bool HeapObject::IsConsString() const {
if (!IsString()) return false;
return StringShape(String::cast(this)).IsCons();
-}
-
-bool HeapObject::IsThinString() const {
- if (!IsString()) return false;
- return StringShape(String::cast(this)).IsThin();
}
bool HeapObject::IsSlicedString() const {
@@ -702,7 +697,6 @@
CAST_ACCESSOR(Struct)
CAST_ACCESSOR(Symbol)
CAST_ACCESSOR(TemplateInfo)
-CAST_ACCESSOR(ThinString)
CAST_ACCESSOR(Uint16x8)
CAST_ACCESSOR(Uint32x4)
CAST_ACCESSOR(Uint8x16)
@@ -847,10 +841,6 @@
bool StringShape::IsCons() {
return (type_ & kStringRepresentationMask) == kConsStringTag;
-}
-
-bool StringShape::IsThin() {
- return (type_ & kStringRepresentationMask) == kThinStringTag;
}
bool StringShape::IsSliced() {
@@ -3729,19 +3719,10 @@
Handle<String> String::Flatten(Handle<String> string, PretenureFlag pretenure) {
- if (string->IsConsString()) {
- Handle<ConsString> cons = Handle<ConsString>::cast(string);
- if (cons->IsFlat()) {
- string = handle(cons->first());
- } else {
- return SlowFlatten(cons, pretenure);
- }
- }
- if (string->IsThinString()) {
- string = handle(Handle<ThinString>::cast(string)->actual());
- DCHECK(!string->IsConsString());
- }
- return string;
+ if (!string->IsConsString()) return string;
+ Handle<ConsString> cons = Handle<ConsString>::cast(string);
+ if (cons->IsFlat()) return handle(cons->first());
+ return SlowFlatten(cons, pretenure);
}
@@ -3762,9 +3743,6 @@
case kSlicedStringTag | kOneByteStringTag:
case kSlicedStringTag | kTwoByteStringTag:
return SlicedString::cast(this)->SlicedStringGet(index);
- case kThinStringTag | kOneByteStringTag:
- case kThinStringTag | kTwoByteStringTag:
- return ThinString::cast(this)->ThinStringGet(index);
default:
break;
}
@@ -3796,7 +3774,6 @@
DCHECK(this->IsFlat());
DCHECK(StringShape(this).IsIndirect());
STATIC_ASSERT(ConsString::kFirstOffset == SlicedString::kParentOffset);
- STATIC_ASSERT(ConsString::kFirstOffset == ThinString::kActualOffset);
const int kUnderlyingOffset = SlicedString::kParentOffset;
return String::cast(READ_FIELD(this, kUnderlyingOffset));
}
@@ -3848,11 +3825,6 @@
case kConsStringTag | kTwoByteStringTag:
return ConsString::cast(string);
- case kThinStringTag | kOneByteStringTag:
- case kThinStringTag | kTwoByteStringTag:
- string = ThinString::cast(string)->actual();
- continue;
-
default:
UNREACHABLE();
return NULL;
@@ -3984,7 +3956,6 @@
CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kSecondOffset, value, mode);
}
-ACCESSORS(ThinString, actual, String, kActualOffset);
bool ExternalString::is_short() {
InstanceType type = map()->instance_type();
« no previous file with comments | « src/objects-debug.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698