[runtime] Remove the obsolete %_StringCharAt intrinsic.
This intrinsic (and the matching runtime entry) are no longer used by now and can thereby be removed. BUG=v8:5049 Review-Url: https://codereview.chromium.org/2016993003 Cr-Commit-Position: refs/heads/master@{#36540}
This commit is contained in:
parent
91c88644dc
commit
b2fd2ded16
@ -12671,20 +12671,6 @@ void HOptimizedGraphBuilder::GenerateStringCharFromCode(CallRuntime* call) {
|
||||
}
|
||||
|
||||
|
||||
// Fast support for string.charAt(n) and string[n].
|
||||
void HOptimizedGraphBuilder::GenerateStringCharAt(CallRuntime* call) {
|
||||
DCHECK(call->arguments()->length() == 2);
|
||||
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
|
||||
CHECK_ALIVE(VisitForValue(call->arguments()->at(1)));
|
||||
HValue* index = Pop();
|
||||
HValue* string = Pop();
|
||||
HInstruction* char_code = BuildStringCharCodeAt(string, index);
|
||||
AddInstruction(char_code);
|
||||
HInstruction* result = NewUncasted<HStringCharFromCode>(char_code);
|
||||
return ast_context()->ReturnInstruction(result, call->id());
|
||||
}
|
||||
|
||||
|
||||
// Fast support for SubString.
|
||||
void HOptimizedGraphBuilder::GenerateSubString(CallRuntime* call) {
|
||||
DCHECK_EQ(3, call->arguments()->length());
|
||||
|
@ -2267,7 +2267,6 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
|
||||
F(NewObject) \
|
||||
F(ValueOf) \
|
||||
F(StringCharFromCode) \
|
||||
F(StringCharAt) \
|
||||
F(OneByteSeqStringSetChar) \
|
||||
F(TwoByteSeqStringSetChar) \
|
||||
F(ToInteger) \
|
||||
|
@ -3031,53 +3031,6 @@ void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK(args->length() == 2);
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForAccumulatorValue(args->at(1));
|
||||
|
||||
Register object = r1;
|
||||
Register index = r0;
|
||||
Register scratch = r3;
|
||||
Register result = r0;
|
||||
|
||||
PopOperand(object);
|
||||
|
||||
Label need_conversion;
|
||||
Label index_out_of_range;
|
||||
Label done;
|
||||
StringCharAtGenerator generator(object,
|
||||
index,
|
||||
scratch,
|
||||
result,
|
||||
&need_conversion,
|
||||
&need_conversion,
|
||||
&index_out_of_range,
|
||||
STRING_INDEX_IS_NUMBER);
|
||||
generator.GenerateFast(masm_);
|
||||
__ jmp(&done);
|
||||
|
||||
__ bind(&index_out_of_range);
|
||||
// When the index is out of range, the spec requires us to return
|
||||
// the empty string.
|
||||
__ LoadRoot(result, Heap::kempty_stringRootIndex);
|
||||
__ jmp(&done);
|
||||
|
||||
__ bind(&need_conversion);
|
||||
// Move smi zero into the result register, which will trigger
|
||||
// conversion.
|
||||
__ mov(result, Operand(Smi::FromInt(0)));
|
||||
__ jmp(&done);
|
||||
|
||||
NopRuntimeCallHelper call_helper;
|
||||
generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(result);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCall(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_LE(2, args->length());
|
||||
|
@ -2936,52 +2936,6 @@ void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK(args->length() == 2);
|
||||
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForAccumulatorValue(args->at(1));
|
||||
|
||||
Register object = x1;
|
||||
Register index = x0;
|
||||
Register result = x0;
|
||||
|
||||
PopOperand(object);
|
||||
|
||||
Label need_conversion;
|
||||
Label index_out_of_range;
|
||||
Label done;
|
||||
StringCharAtGenerator generator(object,
|
||||
index,
|
||||
x3,
|
||||
result,
|
||||
&need_conversion,
|
||||
&need_conversion,
|
||||
&index_out_of_range,
|
||||
STRING_INDEX_IS_NUMBER);
|
||||
generator.GenerateFast(masm_);
|
||||
__ B(&done);
|
||||
|
||||
__ Bind(&index_out_of_range);
|
||||
// When the index is out of range, the spec requires us to return
|
||||
// the empty string.
|
||||
__ LoadRoot(result, Heap::kempty_stringRootIndex);
|
||||
__ B(&done);
|
||||
|
||||
__ Bind(&need_conversion);
|
||||
// Move smi zero into the result register, which will trigger conversion.
|
||||
__ Mov(result, Smi::FromInt(0));
|
||||
__ B(&done);
|
||||
|
||||
NopRuntimeCallHelper call_helper;
|
||||
generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper);
|
||||
|
||||
__ Bind(&done);
|
||||
context()->Plug(result);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCall(CallRuntime* expr) {
|
||||
ASM_LOCATION("FullCodeGenerator::EmitCall");
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
|
@ -512,7 +512,6 @@ class FullCodeGenerator: public AstVisitor {
|
||||
F(NewObject) \
|
||||
F(ValueOf) \
|
||||
F(StringCharFromCode) \
|
||||
F(StringCharAt) \
|
||||
F(OneByteSeqStringSetChar) \
|
||||
F(TwoByteSeqStringSetChar) \
|
||||
F(IsJSReceiver) \
|
||||
|
@ -2925,54 +2925,6 @@ void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK(args->length() == 2);
|
||||
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForAccumulatorValue(args->at(1));
|
||||
|
||||
Register object = ebx;
|
||||
Register index = eax;
|
||||
Register scratch = edx;
|
||||
Register result = eax;
|
||||
|
||||
PopOperand(object);
|
||||
|
||||
Label need_conversion;
|
||||
Label index_out_of_range;
|
||||
Label done;
|
||||
StringCharAtGenerator generator(object,
|
||||
index,
|
||||
scratch,
|
||||
result,
|
||||
&need_conversion,
|
||||
&need_conversion,
|
||||
&index_out_of_range,
|
||||
STRING_INDEX_IS_NUMBER);
|
||||
generator.GenerateFast(masm_);
|
||||
__ jmp(&done);
|
||||
|
||||
__ bind(&index_out_of_range);
|
||||
// When the index is out of range, the spec requires us to return
|
||||
// the empty string.
|
||||
__ Move(result, Immediate(isolate()->factory()->empty_string()));
|
||||
__ jmp(&done);
|
||||
|
||||
__ bind(&need_conversion);
|
||||
// Move smi zero into the result register, which will trigger
|
||||
// conversion.
|
||||
__ Move(result, Immediate(Smi::FromInt(0)));
|
||||
__ jmp(&done);
|
||||
|
||||
NopRuntimeCallHelper call_helper;
|
||||
generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(result);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCall(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_LE(2, args->length());
|
||||
|
@ -3048,55 +3048,6 @@ void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK(args->length() == 2);
|
||||
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForAccumulatorValue(args->at(1));
|
||||
__ mov(a0, result_register());
|
||||
|
||||
Register object = a1;
|
||||
Register index = a0;
|
||||
Register scratch = a3;
|
||||
Register result = v0;
|
||||
|
||||
PopOperand(object);
|
||||
|
||||
Label need_conversion;
|
||||
Label index_out_of_range;
|
||||
Label done;
|
||||
StringCharAtGenerator generator(object,
|
||||
index,
|
||||
scratch,
|
||||
result,
|
||||
&need_conversion,
|
||||
&need_conversion,
|
||||
&index_out_of_range,
|
||||
STRING_INDEX_IS_NUMBER);
|
||||
generator.GenerateFast(masm_);
|
||||
__ jmp(&done);
|
||||
|
||||
__ bind(&index_out_of_range);
|
||||
// When the index is out of range, the spec requires us to return
|
||||
// the empty string.
|
||||
__ LoadRoot(result, Heap::kempty_stringRootIndex);
|
||||
__ jmp(&done);
|
||||
|
||||
__ bind(&need_conversion);
|
||||
// Move smi zero into the result register, which will trigger
|
||||
// conversion.
|
||||
__ li(result, Operand(Smi::FromInt(0)));
|
||||
__ jmp(&done);
|
||||
|
||||
NopRuntimeCallHelper call_helper;
|
||||
generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(result);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCall(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_LE(2, args->length());
|
||||
|
@ -3048,55 +3048,6 @@ void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK(args->length() == 2);
|
||||
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForAccumulatorValue(args->at(1));
|
||||
__ mov(a0, result_register());
|
||||
|
||||
Register object = a1;
|
||||
Register index = a0;
|
||||
Register scratch = a3;
|
||||
Register result = v0;
|
||||
|
||||
PopOperand(object);
|
||||
|
||||
Label need_conversion;
|
||||
Label index_out_of_range;
|
||||
Label done;
|
||||
StringCharAtGenerator generator(object,
|
||||
index,
|
||||
scratch,
|
||||
result,
|
||||
&need_conversion,
|
||||
&need_conversion,
|
||||
&index_out_of_range,
|
||||
STRING_INDEX_IS_NUMBER);
|
||||
generator.GenerateFast(masm_);
|
||||
__ jmp(&done);
|
||||
|
||||
__ bind(&index_out_of_range);
|
||||
// When the index is out of range, the spec requires us to return
|
||||
// the empty string.
|
||||
__ LoadRoot(result, Heap::kempty_stringRootIndex);
|
||||
__ jmp(&done);
|
||||
|
||||
__ bind(&need_conversion);
|
||||
// Move smi zero into the result register, which will trigger
|
||||
// conversion.
|
||||
__ li(result, Operand(Smi::FromInt(0)));
|
||||
__ jmp(&done);
|
||||
|
||||
NopRuntimeCallHelper call_helper;
|
||||
generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(result);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCall(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_LE(2, args->length());
|
||||
|
@ -3021,48 +3021,6 @@ void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK(args->length() == 2);
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForAccumulatorValue(args->at(1));
|
||||
|
||||
Register object = r4;
|
||||
Register index = r3;
|
||||
Register scratch = r6;
|
||||
Register result = r3;
|
||||
|
||||
PopOperand(object);
|
||||
|
||||
Label need_conversion;
|
||||
Label index_out_of_range;
|
||||
Label done;
|
||||
StringCharAtGenerator generator(object, index, scratch, result,
|
||||
&need_conversion, &need_conversion,
|
||||
&index_out_of_range, STRING_INDEX_IS_NUMBER);
|
||||
generator.GenerateFast(masm_);
|
||||
__ b(&done);
|
||||
|
||||
__ bind(&index_out_of_range);
|
||||
// When the index is out of range, the spec requires us to return
|
||||
// the empty string.
|
||||
__ LoadRoot(result, Heap::kempty_stringRootIndex);
|
||||
__ b(&done);
|
||||
|
||||
__ bind(&need_conversion);
|
||||
// Move smi zero into the result register, which will trigger
|
||||
// conversion.
|
||||
__ LoadSmiLiteral(result, Smi::FromInt(0));
|
||||
__ b(&done);
|
||||
|
||||
NopRuntimeCallHelper call_helper;
|
||||
generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(result);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCall(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_LE(2, args->length());
|
||||
|
@ -2947,47 +2947,6 @@ void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) {
|
||||
context()->Plug(result);
|
||||
}
|
||||
|
||||
void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK(args->length() == 2);
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForAccumulatorValue(args->at(1));
|
||||
|
||||
Register object = r3;
|
||||
Register index = r2;
|
||||
Register scratch = r5;
|
||||
Register result = r2;
|
||||
|
||||
PopOperand(object);
|
||||
|
||||
Label need_conversion;
|
||||
Label index_out_of_range;
|
||||
Label done;
|
||||
StringCharAtGenerator generator(object, index, scratch, result,
|
||||
&need_conversion, &need_conversion,
|
||||
&index_out_of_range, STRING_INDEX_IS_NUMBER);
|
||||
generator.GenerateFast(masm_);
|
||||
__ b(&done);
|
||||
|
||||
__ bind(&index_out_of_range);
|
||||
// When the index is out of range, the spec requires us to return
|
||||
// the empty string.
|
||||
__ LoadRoot(result, Heap::kempty_stringRootIndex);
|
||||
__ b(&done);
|
||||
|
||||
__ bind(&need_conversion);
|
||||
// Move smi zero into the result register, which will trigger
|
||||
// conversion.
|
||||
__ LoadSmiLiteral(result, Smi::FromInt(0));
|
||||
__ b(&done);
|
||||
|
||||
NopRuntimeCallHelper call_helper;
|
||||
generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(result);
|
||||
}
|
||||
|
||||
void FullCodeGenerator::EmitCall(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_LE(2, args->length());
|
||||
|
@ -2911,54 +2911,6 @@ void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK(args->length() == 2);
|
||||
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForAccumulatorValue(args->at(1));
|
||||
|
||||
Register object = rbx;
|
||||
Register index = rax;
|
||||
Register scratch = rdx;
|
||||
Register result = rax;
|
||||
|
||||
PopOperand(object);
|
||||
|
||||
Label need_conversion;
|
||||
Label index_out_of_range;
|
||||
Label done;
|
||||
StringCharAtGenerator generator(object,
|
||||
index,
|
||||
scratch,
|
||||
result,
|
||||
&need_conversion,
|
||||
&need_conversion,
|
||||
&index_out_of_range,
|
||||
STRING_INDEX_IS_NUMBER);
|
||||
generator.GenerateFast(masm_);
|
||||
__ jmp(&done);
|
||||
|
||||
__ bind(&index_out_of_range);
|
||||
// When the index is out of range, the spec requires us to return
|
||||
// the empty string.
|
||||
__ LoadRoot(result, Heap::kempty_stringRootIndex);
|
||||
__ jmp(&done);
|
||||
|
||||
__ bind(&need_conversion);
|
||||
// Move smi zero into the result register, which will trigger
|
||||
// conversion.
|
||||
__ Move(result, Smi::FromInt(0));
|
||||
__ jmp(&done);
|
||||
|
||||
NopRuntimeCallHelper call_helper;
|
||||
generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(result);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCall(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_LE(2, args->length());
|
||||
|
@ -2917,54 +2917,6 @@ void FullCodeGenerator::EmitStringCharCodeAt(CallRuntime* expr) {
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK(args->length() == 2);
|
||||
|
||||
VisitForStackValue(args->at(0));
|
||||
VisitForAccumulatorValue(args->at(1));
|
||||
|
||||
Register object = ebx;
|
||||
Register index = eax;
|
||||
Register scratch = edx;
|
||||
Register result = eax;
|
||||
|
||||
PopOperand(object);
|
||||
|
||||
Label need_conversion;
|
||||
Label index_out_of_range;
|
||||
Label done;
|
||||
StringCharAtGenerator generator(object,
|
||||
index,
|
||||
scratch,
|
||||
result,
|
||||
&need_conversion,
|
||||
&need_conversion,
|
||||
&index_out_of_range,
|
||||
STRING_INDEX_IS_NUMBER);
|
||||
generator.GenerateFast(masm_);
|
||||
__ jmp(&done);
|
||||
|
||||
__ bind(&index_out_of_range);
|
||||
// When the index is out of range, the spec requires us to return
|
||||
// the empty string.
|
||||
__ Move(result, Immediate(isolate()->factory()->empty_string()));
|
||||
__ jmp(&done);
|
||||
|
||||
__ bind(&need_conversion);
|
||||
// Move smi zero into the result register, which will trigger
|
||||
// conversion.
|
||||
__ Move(result, Immediate(Smi::FromInt(0)));
|
||||
__ jmp(&done);
|
||||
|
||||
NopRuntimeCallHelper call_helper;
|
||||
generator.GenerateSlow(masm_, NOT_PART_OF_IC_HANDLER, call_helper);
|
||||
|
||||
__ bind(&done);
|
||||
context()->Plug(result);
|
||||
}
|
||||
|
||||
|
||||
void FullCodeGenerator::EmitCall(CallRuntime* expr) {
|
||||
ZoneList<Expression*>* args = expr->arguments();
|
||||
DCHECK_LE(2, args->length());
|
||||
|
@ -1255,18 +1255,6 @@ RUNTIME_FUNCTION(Runtime_StringCharFromCode) {
|
||||
return isolate->heap()->empty_string();
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_StringCharAt) {
|
||||
SealHandleScope shs(isolate);
|
||||
DCHECK(args.length() == 2);
|
||||
if (!args[0]->IsString()) return Smi::FromInt(0);
|
||||
if (!args[1]->IsNumber()) return Smi::FromInt(0);
|
||||
if (std::isinf(args.number_at(1))) return isolate->heap()->empty_string();
|
||||
Object* code = __RT_impl_Runtime_StringCharCodeAtRT(args, isolate);
|
||||
if (code->IsNaN()) return isolate->heap()->empty_string();
|
||||
return __RT_impl_Runtime_StringCharFromCode(Arguments(1, &code), isolate);
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_ExternalStringGetChar) {
|
||||
SealHandleScope shs(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
|
@ -843,7 +843,6 @@ namespace internal {
|
||||
F(StringNotEqual, 2, 1) \
|
||||
F(FlattenString, 1, 1) \
|
||||
F(StringCharFromCode, 1, 1) \
|
||||
F(StringCharAt, 2, 1) \
|
||||
F(ExternalStringGetChar, 2, 1) \
|
||||
F(OneByteSeqStringGetChar, 2, 1) \
|
||||
F(OneByteSeqStringSetChar, 3, 1) \
|
||||
|
@ -151,15 +151,6 @@ TEST(StringAdd) {
|
||||
}
|
||||
|
||||
|
||||
TEST(StringCharAt) {
|
||||
FunctionTester T("(function(a,b) { return %_StringCharAt(a,b); })", flags);
|
||||
|
||||
T.CheckCall(T.Val("e"), T.Val("huge fan!"), T.Val(3));
|
||||
T.CheckCall(T.Val("f"), T.Val("\xE2\x9D\x8A fan!"), T.Val(2));
|
||||
T.CheckCall(T.Val(""), T.Val("not a fan!"), T.Val(23));
|
||||
}
|
||||
|
||||
|
||||
TEST(StringCharCodeAt) {
|
||||
FunctionTester T("(function(a,b) { return %_StringCharCodeAt(a,b); })",
|
||||
flags);
|
||||
|
Loading…
Reference in New Issue
Block a user