Version 2.2.11
Fix crash bug in liveedit on 64 bit.
Use 'full compiler' when debugging is active. This should increase
the density of possible break points, making single step more fine
grained. This will only take effect for functions compiled after
debugging has been started, so recompilation of all functions is
required to get the full effect. IA32 and x64 only for now.
Misc. fixes to the Solaris build.
Add new flags --print-cumulative-gc-stat and --trace-gc-nvp.
Add filtering of CPU profiles by security context.
Fix crash bug on ARM when running without VFP2 or VFP3.
Incremental performance improvements in all backends.
Review URL: http://codereview.chromium.org/2084017
git-svn-id: http://v8.googlecode.com/svn/trunk@4701 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/objects-inl.h b/src/objects-inl.h
index ad15104..d82d73e 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1691,13 +1691,19 @@
Object* String::TryFlatten(PretenureFlag pretenure) {
- // We don't need to flatten strings that are already flat. Since this code
- // is inlined, it can be helpful in the flat case to not call out to Flatten.
- if (IsFlat()) return this;
+ if (!StringShape(this).IsCons()) return this;
+ ConsString* cons = ConsString::cast(this);
+ if (cons->second()->length() == 0) return cons->first();
return SlowTryFlatten(pretenure);
}
+String* String::TryFlattenGetString(PretenureFlag pretenure) {
+ Object* flat = TryFlatten(pretenure);
+ return flat->IsFailure() ? this : String::cast(flat);
+}
+
+
uint16_t String::Get(int index) {
ASSERT(index >= 0 && index < length());
switch (StringShape(this).full_representation_tag()) {