WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
- ASSERT(!target->IsConsString());
Assembler::set_target_address_at(pc_, host_,
reinterpret_cast<Address>(target),
icache_flush_mode);
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
- ASSERT(!target->IsConsString());
Assembler::set_target_address_at(pc_, host_,
reinterpret_cast<Address>(target),
icache_flush_mode);
}
-Handle<String> Factory::NewFlatConcatString(Handle<String> first,
- Handle<String> second) {
- int total_length = first->length() + second->length();
- if (first->IsOneByteRepresentation() && second->IsOneByteRepresentation()) {
- return ConcatStringContent<uint8_t>(
- NewRawOneByteString(total_length).ToHandleChecked(), first, second);
- } else {
- return ConcatStringContent<uc16>(
- NewRawTwoByteString(total_length).ToHandleChecked(), first, second);
- }
-}
-
-
Handle<String> Factory::NewProperSubString(Handle<String> str,
int begin,
int end) {
MUST_USE_RESULT MaybeHandle<String> NewConsString(Handle<String> left,
Handle<String> right);
- // Create a new sequential string containing the concatenation of the inputs.
- Handle<String> NewFlatConcatString(Handle<String> first,
- Handle<String> second);
-
// Create a new string object which holds a proper substring of a string.
Handle<String> NewProperSubString(Handle<String> str,
int begin,
Handle<String> right_string = c_right->StringValue();
// Prevent possible exception by invalid string length.
if (left_string->length() + right_string->length() < String::kMaxLength) {
- Handle<String> concat = zone->isolate()->factory()->NewFlatConcatString(
+ MaybeHandle<String> concat = zone->isolate()->factory()->NewConsString(
c_left->StringValue(), c_right->StringValue());
- ASSERT(!concat.is_null());
- return HConstant::New(zone, context, concat);
+ return HConstant::New(zone, context, concat.ToHandleChecked());
}
}
}
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
- ASSERT(!target->IsConsString());
Memory::Object_at(pc_) = target;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
CpuFeatures::FlushICache(pc_, sizeof(Address));
}
case CONSTANT: {
Handle<Object> constant(lookup->GetConstant(), isolate());
- // TODO(2803): Don't compute a stub for cons strings because they cannot
- // be embedded into code.
- if (constant->IsConsString()) break;
return compiler.CompileLoadConstant(type, holder, name, constant);
}
case NORMAL:
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
- ASSERT(!target->IsConsString());
Assembler::set_target_address_at(pc_, host_,
reinterpret_cast<Address>(target),
icache_flush_mode);
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
- ASSERT(!target->IsConsString());
Assembler::set_target_address_at(pc_, host_,
reinterpret_cast<Address>(target),
icache_flush_mode);
void StaticMarkingVisitor<StaticVisitor>::VisitEmbeddedPointer(
Heap* heap, RelocInfo* rinfo) {
ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT);
- ASSERT(!rinfo->target_object()->IsConsString());
HeapObject* object = HeapObject::cast(rinfo->target_object());
heap->mark_compact_collector()->RecordRelocSlot(rinfo, object);
// TODO(ulan): It could be better to record slots only for strongly embedded
Handle<Object> value) {
Isolate* isolate = cell->GetIsolate();
Handle<HeapType> old_type(cell->type(), isolate);
- // TODO(2803): Do not track ConsString as constant because they cannot be
- // embedded into code.
- Handle<HeapType> new_type = value->IsConsString() || value->IsTheHole()
- ? HeapType::Any(isolate) : HeapType::Constant(value, isolate);
+ Handle<HeapType> new_type = value->IsTheHole()
+ ? HeapType::Any(isolate)
+ : HeapType::Constant(value, isolate);
if (new_type->Is(old_type)) {
return old_type;
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
- ASSERT(!target->IsConsString());
Memory::Object_at(pc_) = target;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
CpuFeatures::FlushICache(pc_, sizeof(Address));
WriteBarrierMode write_barrier_mode,
ICacheFlushMode icache_flush_mode) {
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
- ASSERT(!target->IsConsString());
Memory::Object_at(pc_) = target;
if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
CpuFeatures::FlushICache(pc_, sizeof(Address));