Skip to content

Commit c9cb94a

Browse files
schuayCommit bot
authored andcommitted
[regexp] Remove IsRegExp intrinsic
The two remaining uses of this intrinsic in debug.js and mirrors.js now simply rely on the runtime function. BUG=v8:5339 Review-Url: https://codereview.chromium.org/2591923003 Cr-Commit-Position: refs/heads/master@{#41892}
1 parent 55fc5c0 commit c9cb94a

22 files changed

Lines changed: 2 additions & 289 deletions

src/compiler/js-intrinsic-lowering.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
4646
return ReduceIsInstanceType(node, JS_ARRAY_TYPE);
4747
case Runtime::kInlineIsTypedArray:
4848
return ReduceIsInstanceType(node, JS_TYPED_ARRAY_TYPE);
49-
case Runtime::kInlineIsRegExp:
50-
return ReduceIsInstanceType(node, JS_REGEXP_TYPE);
5149
case Runtime::kInlineIsJSReceiver:
5250
return ReduceIsJSReceiver(node);
5351
case Runtime::kInlineIsSmi:

src/crankshaft/hydrogen.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11943,16 +11943,6 @@ void HOptimizedGraphBuilder::GenerateIsTypedArray(CallRuntime* call) {
1194311943
}
1194411944

1194511945

11946-
void HOptimizedGraphBuilder::GenerateIsRegExp(CallRuntime* call) {
11947-
DCHECK(call->arguments()->length() == 1);
11948-
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
11949-
HValue* value = Pop();
11950-
HHasInstanceTypeAndBranch* result =
11951-
New<HHasInstanceTypeAndBranch>(value, JS_REGEXP_TYPE);
11952-
return ast_context()->ReturnControl(result, call->id());
11953-
}
11954-
11955-
1195611946
void HOptimizedGraphBuilder::GenerateToInteger(CallRuntime* call) {
1195711947
DCHECK_EQ(1, call->arguments()->length());
1195811948
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));

src/crankshaft/hydrogen.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2156,7 +2156,6 @@ class HOptimizedGraphBuilder : public HGraphBuilder,
21562156
F(IsSmi) \
21572157
F(IsArray) \
21582158
F(IsTypedArray) \
2159-
F(IsRegExp) \
21602159
F(IsJSProxy) \
21612160
F(Call) \
21622161
F(NewObject) \

src/debug/debug.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ Debug.setListener = function(listener, opt_data) {
435435
Debug.findScript = function(func_or_script_name) {
436436
if (IS_FUNCTION(func_or_script_name)) {
437437
return %FunctionGetScript(func_or_script_name);
438-
} else if (IS_REGEXP(func_or_script_name)) {
438+
} else if (%IsRegExp(func_or_script_name)) {
439439
var scripts = this.scripts();
440440
var last_result = null;
441441
var result_count = 0;

src/debug/mirrors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function MakeMirror(value, opt_transient) {
148148
mirror = new DateMirror(value);
149149
} else if (IS_FUNCTION(value)) {
150150
mirror = new FunctionMirror(value);
151-
} else if (IS_REGEXP(value)) {
151+
} else if (%IsRegExp(value)) {
152152
mirror = new RegExpMirror(value);
153153
} else if (IS_ERROR(value)) {
154154
mirror = new ErrorMirror(value);

src/full-codegen/arm/full-codegen-arm.cc

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,28 +2017,6 @@ void FullCodeGenerator::EmitIsTypedArray(CallRuntime* expr) {
20172017
}
20182018

20192019

2020-
void FullCodeGenerator::EmitIsRegExp(CallRuntime* expr) {
2021-
ZoneList<Expression*>* args = expr->arguments();
2022-
DCHECK(args->length() == 1);
2023-
2024-
VisitForAccumulatorValue(args->at(0));
2025-
2026-
Label materialize_true, materialize_false;
2027-
Label* if_true = NULL;
2028-
Label* if_false = NULL;
2029-
Label* fall_through = NULL;
2030-
context()->PrepareTest(&materialize_true, &materialize_false,
2031-
&if_true, &if_false, &fall_through);
2032-
2033-
__ JumpIfSmi(r0, if_false);
2034-
__ CompareObjectType(r0, r1, r1, JS_REGEXP_TYPE);
2035-
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
2036-
Split(eq, if_true, if_false, fall_through);
2037-
2038-
context()->Plug(if_true, if_false);
2039-
}
2040-
2041-
20422020
void FullCodeGenerator::EmitIsJSProxy(CallRuntime* expr) {
20432021
ZoneList<Expression*>* args = expr->arguments();
20442022
DCHECK(args->length() == 1);

src/full-codegen/arm64/full-codegen-arm64.cc

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1968,28 +1968,6 @@ void FullCodeGenerator::EmitIsTypedArray(CallRuntime* expr) {
19681968
}
19691969

19701970

1971-
void FullCodeGenerator::EmitIsRegExp(CallRuntime* expr) {
1972-
ZoneList<Expression*>* args = expr->arguments();
1973-
DCHECK(args->length() == 1);
1974-
1975-
VisitForAccumulatorValue(args->at(0));
1976-
1977-
Label materialize_true, materialize_false;
1978-
Label* if_true = NULL;
1979-
Label* if_false = NULL;
1980-
Label* fall_through = NULL;
1981-
context()->PrepareTest(&materialize_true, &materialize_false,
1982-
&if_true, &if_false, &fall_through);
1983-
1984-
__ JumpIfSmi(x0, if_false);
1985-
__ CompareObjectType(x0, x10, x11, JS_REGEXP_TYPE);
1986-
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
1987-
Split(eq, if_true, if_false, fall_through);
1988-
1989-
context()->Plug(if_true, if_false);
1990-
}
1991-
1992-
19931971
void FullCodeGenerator::EmitIsJSProxy(CallRuntime* expr) {
19941972
ZoneList<Expression*>* args = expr->arguments();
19951973
DCHECK(args->length() == 1);

src/full-codegen/full-codegen.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,6 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> {
402402
F(IsSmi) \
403403
F(IsArray) \
404404
F(IsTypedArray) \
405-
F(IsRegExp) \
406405
F(IsJSProxy) \
407406
F(Call) \
408407
F(NewObject) \

src/full-codegen/ia32/full-codegen-ia32.cc

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,28 +1941,6 @@ void FullCodeGenerator::EmitIsTypedArray(CallRuntime* expr) {
19411941
}
19421942

19431943

1944-
void FullCodeGenerator::EmitIsRegExp(CallRuntime* expr) {
1945-
ZoneList<Expression*>* args = expr->arguments();
1946-
DCHECK(args->length() == 1);
1947-
1948-
VisitForAccumulatorValue(args->at(0));
1949-
1950-
Label materialize_true, materialize_false;
1951-
Label* if_true = NULL;
1952-
Label* if_false = NULL;
1953-
Label* fall_through = NULL;
1954-
context()->PrepareTest(&materialize_true, &materialize_false,
1955-
&if_true, &if_false, &fall_through);
1956-
1957-
__ JumpIfSmi(eax, if_false);
1958-
__ CmpObjectType(eax, JS_REGEXP_TYPE, ebx);
1959-
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
1960-
Split(equal, if_true, if_false, fall_through);
1961-
1962-
context()->Plug(if_true, if_false);
1963-
}
1964-
1965-
19661944
void FullCodeGenerator::EmitIsJSProxy(CallRuntime* expr) {
19671945
ZoneList<Expression*>* args = expr->arguments();
19681946
DCHECK(args->length() == 1);

src/full-codegen/mips/full-codegen-mips.cc

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,28 +2041,6 @@ void FullCodeGenerator::EmitIsTypedArray(CallRuntime* expr) {
20412041
}
20422042

20432043

2044-
void FullCodeGenerator::EmitIsRegExp(CallRuntime* expr) {
2045-
ZoneList<Expression*>* args = expr->arguments();
2046-
DCHECK(args->length() == 1);
2047-
2048-
VisitForAccumulatorValue(args->at(0));
2049-
2050-
Label materialize_true, materialize_false;
2051-
Label* if_true = NULL;
2052-
Label* if_false = NULL;
2053-
Label* fall_through = NULL;
2054-
context()->PrepareTest(&materialize_true, &materialize_false,
2055-
&if_true, &if_false, &fall_through);
2056-
2057-
__ JumpIfSmi(v0, if_false);
2058-
__ GetObjectType(v0, a1, a1);
2059-
PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
2060-
Split(eq, a1, Operand(JS_REGEXP_TYPE), if_true, if_false, fall_through);
2061-
2062-
context()->Plug(if_true, if_false);
2063-
}
2064-
2065-
20662044
void FullCodeGenerator::EmitIsJSProxy(CallRuntime* expr) {
20672045
ZoneList<Expression*>* args = expr->arguments();
20682046
DCHECK(args->length() == 1);

0 commit comments

Comments
 (0)