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

Unified Diff: runtime/vm/regexp.cc

Issue 1870343002: - Refactor Symbol allocation to expect a thread parameter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review feedback. Created 4 years, 8 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 | « runtime/vm/regexp.h ('k') | runtime/vm/regexp_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/regexp.cc
diff --git a/runtime/vm/regexp.cc b/runtime/vm/regexp.cc
index 62fab5aafd0f9be89455f123b35eb346afd40ec3..f119a256fb00ba6e7c80a278aaed515ecce380dc 100644
--- a/runtime/vm/regexp.cc
+++ b/runtime/vm/regexp.cc
@@ -5244,7 +5244,7 @@ RegExpEngine::CompilationResult RegExpEngine::CompileBytecode(
}
-static void CreateSpecializedFunction(Zone* zone,
+static void CreateSpecializedFunction(Thread* thread, Zone* zone,
const RegExp& regexp,
intptr_t specialization_cid,
const Object& owner) {
@@ -5252,7 +5252,7 @@ static void CreateSpecializedFunction(Zone* zone,
Function& fn = Function::Handle(zone, Function::New(
// Append the regexp pattern to the function name.
- String::Handle(zone, Symbols::New(
+ String::Handle(zone, Symbols::New(thread,
String::Handle(zone, String::Concat(
String::Handle(zone, String::Concat(
Symbols::ColonMatcher(),
@@ -5297,10 +5297,11 @@ static void CreateSpecializedFunction(Zone* zone,
}
-RawRegExp* RegExpEngine::CreateRegExp(Zone* zone,
- const String& pattern,
- bool multi_line,
- bool ignore_case) {
+RawRegExp* RegExpEngine::CreateRegExp(Thread* thread,
+ const String& pattern,
+ bool multi_line,
+ bool ignore_case) {
+ Zone* zone = thread->zone();
const RegExp& regexp = RegExp::Handle(RegExp::New());
regexp.set_pattern(pattern);
@@ -5319,13 +5320,15 @@ RawRegExp* RegExpEngine::CreateRegExp(Zone* zone,
if (!FLAG_interpret_irregexp) {
const Library& lib = Library::Handle(zone, Library::CoreLibrary());
- const Class& owner = Class::Handle(
- zone, lib.LookupClass(Symbols::RegExp()));
-
- CreateSpecializedFunction(zone, regexp, kOneByteStringCid, owner);
- CreateSpecializedFunction(zone, regexp, kTwoByteStringCid, owner);
- CreateSpecializedFunction(zone, regexp, kExternalOneByteStringCid, owner);
- CreateSpecializedFunction(zone, regexp, kExternalTwoByteStringCid, owner);
+ const Class& owner = Class::Handle(zone,
+ lib.LookupClass(Symbols::RegExp()));
+
+ CreateSpecializedFunction(thread, zone, regexp, kOneByteStringCid, owner);
+ CreateSpecializedFunction(thread, zone, regexp, kTwoByteStringCid, owner);
+ CreateSpecializedFunction(thread, zone,
+ regexp, kExternalOneByteStringCid, owner);
+ CreateSpecializedFunction(thread, zone,
+ regexp, kExternalTwoByteStringCid, owner);
}
return regexp.raw();
« no previous file with comments | « runtime/vm/regexp.h ('k') | runtime/vm/regexp_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698