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

Unified Diff: runtime/vm/intrinsifier_arm.cc

Issue 683433003: Integrate the Irregexp Regular Expression Engine. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: more comments Created 6 years, 1 month 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/intermediate_language_x64.cc ('k') | runtime/vm/intrinsifier_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intrinsifier_arm.cc
diff --git a/runtime/vm/intrinsifier_arm.cc b/runtime/vm/intrinsifier_arm.cc
index d921f98c339432f9831a03d38fda4123b8f06c31..342c284652b99cc322c90750898106d7e8df8c71 100644
--- a/runtime/vm/intrinsifier_arm.cc
+++ b/runtime/vm/intrinsifier_arm.cc
@@ -9,9 +9,11 @@
#include "vm/assembler.h"
#include "vm/cpu.h"
+#include "vm/dart_entry.h"
#include "vm/flow_graph_compiler.h"
#include "vm/object.h"
#include "vm/object_store.h"
+#include "vm/regexp_assembler.h"
#include "vm/symbols.h"
namespace dart {
@@ -1978,6 +1980,40 @@ void Intrinsifier::TwoByteString_equality(Assembler* assembler) {
}
+void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) {
+ if (FLAG_use_jscre) {
+ return;
+ }
+ static const intptr_t kRegExpParamOffset = 2 * kWordSize;
+ static const intptr_t kStringParamOffset = 1 * kWordSize;
+ // start_index smi is located at offset 0.
+
+ // Incoming registers:
+ // R0: Function. (Will be reloaded with the specialized matcher function.)
+ // R4: Arguments descriptor. (Will be preserved.)
+ // R5: IC-Data. (Will be preserved.)
+
+ // Load the specialized function pointer into R0. Leverage the fact the
+ // string CIDs as well as stored function pointers are in sequence.
+ __ ldr(R2, Address(SP, kRegExpParamOffset));
+ __ ldr(R1, Address(SP, kStringParamOffset));
+ __ LoadClassId(R1, R1);
+ __ AddImmediate(R1, R1, -kOneByteStringCid);
+ __ add(R1, R2, Operand(R1, LSL, kWordSizeLog2));
+ __ ldr(R0, FieldAddress(R1, JSRegExp::function_offset(kOneByteStringCid)));
+
+ // Registers are now set up for the lazy compile stub. It expects the function
+ // in R0, the argument descriptor in R4, and IC-Data in R5.
+ static const intptr_t arg_count = RegExpMacroAssembler::kParamCount;
+ __ LoadObject(R4, Array::Handle(ArgumentsDescriptor::New(arg_count)));
+
+ // Tail-call the function.
+ __ ldr(R1, FieldAddress(R0, Function::instructions_offset()));
+ __ AddImmediate(R1, Instructions::HeaderSize() - kHeapObjectTag);
+ __ bx(R1);
+}
+
+
// On stack: user tag (+0).
void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
// R1: Isolate.
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/intrinsifier_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698