Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: src/builtins/builtins-object.cc

Issue 2395453002: [stubs] Add String and JSReceiver instance type predicates (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/builtins/builtins-object.cc
diff --git a/src/builtins/builtins-object.cc b/src/builtins/builtins-object.cc
index 918eb7ef5c4119518449137a2beff7d458afc4b4..bec4e1244e5181e99a792b8761d0bf214a7004a0 100644
--- a/src/builtins/builtins-object.cc
+++ b/src/builtins/builtins-object.cc
@@ -230,10 +230,8 @@ void IsString(CodeStubAssembler* assembler, compiler::Node* object,
{
Node* instance_type = assembler->LoadInstanceType(object);
- assembler->Branch(
- assembler->Int32LessThan(
- instance_type, assembler->Int32Constant(FIRST_NONSTRING_TYPE)),
- if_string, if_notstring);
+ assembler->Branch(assembler->IsStringInstanceType(instance_type), if_string,
+ if_notstring);
}
}
@@ -259,10 +257,8 @@ void ReturnIfPrimitive(CodeStubAssembler* assembler,
CodeStubAssembler::Label* return_string,
CodeStubAssembler::Label* return_boolean,
CodeStubAssembler::Label* return_number) {
- assembler->GotoIf(
- assembler->Int32LessThan(instance_type,
- assembler->Int32Constant(FIRST_NONSTRING_TYPE)),
- return_string);
+ assembler->GotoIf(assembler->IsStringInstanceType(instance_type),
+ return_string);
assembler->GotoIf(assembler->Word32Equal(
instance_type, assembler->Int32Constant(ODDBALL_TYPE)),

Powered by Google App Engine
This is Rietveld 408576698