Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index e7a5c23259d53b93c691533028c5687a5c9be964..69a7c756a5c96637ff6d023c0a5ebca5d418fa95 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -3046,6 +3046,17 @@ bool Name::Equals(Name* other) { |
} |
+bool Name::Equals(Handle<Name> one, Handle<Name> two) { |
+ if (one.is_identical_to(two)) return true; |
+ if ((one->IsInternalizedString() && two->IsInternalizedString()) || |
+ one->IsSymbol() || two->IsSymbol()) { |
+ return false; |
+ } |
+ return String::SlowEquals(Handle<String>::cast(one), |
+ Handle<String>::cast(two)); |
+} |
+ |
+ |
ACCESSORS(Symbol, name, Object, kNameOffset) |
ACCESSORS(Symbol, flags, Smi, kFlagsOffset) |
BOOL_ACCESSORS(Symbol, flags, is_private, kPrivateBit) |
@@ -3060,6 +3071,15 @@ bool String::Equals(String* other) { |
} |
+bool String::Equals(Handle<String> one, Handle<String> two) { |
+ if (one.is_identical_to(two)) return true; |
+ if (one->IsInternalizedString() && two->IsInternalizedString()) { |
+ return false; |
+ } |
+ return SlowEquals(one, two); |
+} |
+ |
+ |
Handle<String> String::Flatten(Handle<String> string, PretenureFlag pretenure) { |
if (!string->IsConsString()) return string; |
Handle<ConsString> cons = Handle<ConsString>::cast(string); |
@@ -3068,22 +3088,6 @@ Handle<String> String::Flatten(Handle<String> string, PretenureFlag pretenure) { |
} |
-MaybeObject* String::TryFlatten(PretenureFlag pretenure) { |
- if (!StringShape(this).IsCons()) return this; |
- ConsString* cons = ConsString::cast(this); |
- if (cons->IsFlat()) return cons->first(); |
- return SlowTryFlatten(pretenure); |
-} |
- |
- |
-String* String::TryFlattenGetString(PretenureFlag pretenure) { |
- MaybeObject* flat = TryFlatten(pretenure); |
- Object* successfully_flattened; |
- if (!flat->ToObject(&successfully_flattened)) return this; |
- return String::cast(successfully_flattened); |
-} |
- |
- |
uint16_t String::Get(int index) { |
ASSERT(index >= 0 && index < length()); |
switch (StringShape(this).full_representation_tag()) { |