- // nasty hack because we can't union non-POD types
- m_fibers[0] = reinterpret_cast<void*>(reinterpret_cast<ptrdiff_t>(finalizer));
- m_fibers[1] = context;
- Heap::heap(this)->reportExtraMemoryCost(value.cost());
+ unsigned index = 0;
+ appendStringInConstruct(index, u1);
+ appendStringInConstruct(index, u2);
+ ASSERT(index <= s_maxInternalRopeLength);
+ }
+
+ // This constructor constructs a new string by concatenating u1, u2 & u3.
+ JSString(JSGlobalData* globalData, const UString& u1, const UString& u2, const UString& u3)
+ : JSCell(*globalData, globalData->stringStructure.get())
+ , m_length(u1.length() + u2.length() + u3.length())
+ , m_fiberCount(s_maxInternalRopeLength)
+ {
+ unsigned index = 0;
+ appendStringInConstruct(index, u1);
+ appendStringInConstruct(index, u2);
+ appendStringInConstruct(index, u3);
+ ASSERT(index <= s_maxInternalRopeLength);