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

Unified Diff: src/objects.cc

Issue 2398413002: [regexp] Extract code to regexp-utils.{h,cc} (Closed)
Patch Set: Move IsRegExp to RegExpUtils as well 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
« no previous file with comments | « src/objects.h ('k') | src/regexp/regexp-utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index bbde851fb70d7dbfeeac8f1593a3433e4dfed8f8..7c44efd33c4f8e3264293008b8a06504da15fb38 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1977,26 +1977,6 @@ Object* GetSimpleHash(Object* object) {
} // namespace
-Maybe<bool> Object::IsRegExp(Isolate* isolate, Handle<Object> object) {
- if (!object->IsJSReceiver()) return Just(false);
-
- Handle<JSReceiver> receiver = Handle<JSReceiver>::cast(object);
-
- if (isolate->regexp_function()->initial_map() == receiver->map()) {
- // Fast-path for unmodified JSRegExp instances.
- return Just(true);
- }
-
- Handle<Object> match;
- ASSIGN_RETURN_ON_EXCEPTION_VALUE(
- isolate, match,
- JSObject::GetProperty(receiver, isolate->factory()->match_symbol()),
- Nothing<bool>());
-
- if (!match->IsUndefined(isolate)) return Just(match->BooleanValue());
- return Just(object->IsJSRegExp());
-}
-
Object* Object::GetHash() {
Object* hash = GetSimpleHash(this);
if (hash->IsSmi()) return hash;
« no previous file with comments | « src/objects.h ('k') | src/regexp/regexp-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698