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

Unified Diff: runtime/vm/regexp_assembler_ir.cc

Issue 1305993005: VM: Simplify irregexp entry stub. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: simplify ExecuteMatch Created 5 years, 3 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_assembler_ir.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_assembler_ir.cc
diff --git a/runtime/vm/regexp_assembler_ir.cc b/runtime/vm/regexp_assembler_ir.cc
index 6851926aede6cf78c0fffc6bc0292bb1c10fa896..b86dc9836f2e68971fec6efd79c4e281749da07d 100644
--- a/runtime/vm/regexp_assembler_ir.cc
+++ b/runtime/vm/regexp_assembler_ir.cc
@@ -161,8 +161,10 @@ void IRRegExpMacroAssembler::InitializeLocals() {
index_temp_ = Local(Symbols::index_temp());
result_ = Local(Symbols::result());
- string_param_ = Parameter(Symbols::string_param(), 0);
- start_index_param_ = Parameter(Symbols::start_index_param(), 1);
+ string_param_ = Parameter(Symbols::string_param(),
+ RegExpMacroAssembler::kParamStringIndex);
+ start_index_param_ = Parameter(Symbols::start_index_param(),
+ RegExpMacroAssembler::kParamStartOffsetIndex);
}
@@ -306,19 +308,24 @@ bool IRRegExpMacroAssembler::CanReadUnaligned() {
RawArray* IRRegExpMacroAssembler::Execute(
- const Function& function,
+ const JSRegExp& regexp,
const String& input,
const Smi& start_offset,
Zone* zone) {
+ const intptr_t cid = input.GetClassId();
+ const Function& fun = Function::Handle(regexp.function(cid));
+ ASSERT(!fun.IsNull());
// Create the argument list.
- const Array& args = Array::Handle(Array::New(2));
- args.SetAt(0, input);
- args.SetAt(1, start_offset);
+ const Array& args =
+ Array::Handle(Array::New(RegExpMacroAssembler::kParamCount));
+ args.SetAt(RegExpMacroAssembler::kParamRegExpIndex, regexp);
+ args.SetAt(RegExpMacroAssembler::kParamStringIndex, input);
+ args.SetAt(RegExpMacroAssembler::kParamStartOffsetIndex, start_offset);
// And finally call the generated code.
const Object& retval =
- Object::Handle(zone, DartEntry::InvokeFunction(function, args));
+ Object::Handle(zone, DartEntry::InvokeFunction(fun, args));
if (retval.IsError()) {
const Error& error = Error::Cast(retval);
OS::Print("%s\n", error.ToErrorCString());
« no previous file with comments | « runtime/vm/regexp_assembler_ir.h ('k') | runtime/vm/regexp_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698