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

Side by Side 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: rebase, enable tests, remove *CodeUnitsAt 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
11 #include "vm/cpu.h" 11 #include "vm/cpu.h"
12 #include "vm/dart_entry.h"
12 #include "vm/flow_graph_compiler.h" 13 #include "vm/flow_graph_compiler.h"
13 #include "vm/object.h" 14 #include "vm/object.h"
14 #include "vm/object_store.h" 15 #include "vm/object_store.h"
16 #include "vm/regexp_assembler.h"
15 #include "vm/symbols.h" 17 #include "vm/symbols.h"
16 18
17 namespace dart { 19 namespace dart {
18 20
19 DECLARE_FLAG(bool, enable_type_checks); 21 DECLARE_FLAG(bool, enable_type_checks);
20 22
21 23
22 #define __ assembler-> 24 #define __ assembler->
23 25
24 26
(...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after
1963 void Intrinsifier::OneByteString_equality(Assembler* assembler) { 1965 void Intrinsifier::OneByteString_equality(Assembler* assembler) {
1964 StringEquality(assembler, kOneByteStringCid); 1966 StringEquality(assembler, kOneByteStringCid);
1965 } 1967 }
1966 1968
1967 1969
1968 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { 1970 void Intrinsifier::TwoByteString_equality(Assembler* assembler) {
1969 StringEquality(assembler, kTwoByteStringCid); 1971 StringEquality(assembler, kTwoByteStringCid);
1970 } 1972 }
1971 1973
1972 1974
1975 #ifndef USE_JSCRE
1976 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) {
1977 static const intptr_t kRegExpParamOffset = + 2 * kWordSize;
1978 static const intptr_t kStringParamOffset = + 1 * kWordSize;
1979 // const Smi& start_index is located at (+ 0 * kWordSize).
1980
1981 // Register assignments are as follows:
1982 // R0: The appropriate specialized matcher function.
1983 // R2: The regexp object.
1984 // R5: Temp.
1985 // R1: Temp, Pointer to the function's code which we then tail-call.
1986
1987 __ ldr(R2, Address(SP, kRegExpParamOffset));
1988 __ ldr(R1, Address(SP, kStringParamOffset));
1989
1990 // Load the specialized function pointer into R0. Leverage the fact the
1991 // string CIDs as well as stored function pointers are in sequence.
1992
1993 __ LoadClassId(R1, R1);
1994 __ AddImmediate(R1, R1, -kOneByteStringCid);
1995 __ add(R1, R2, Operand(R1, LSL, kWordSizeLog2));
1996 __ ldr(R0, FieldAddress(R1, JSRegExp::function_offset(kOneByteStringCid)));
1997
1998 // Registers have been set up for the lazy compile stub at this point.
1999 // It expects the function in R0, the argument descriptor in R4, and
2000 // IC-Data in R5. Explicitly null out IC-Data to ensure its validity.
2001
2002 static const intptr_t arg_count = RegExpMacroAssembler::kParamCount;
2003 __ LoadObject(R4, Array::Handle(ArgumentsDescriptor::New(arg_count)));
2004 __ eor(R5, R5, Operand(R5));
2005
2006 // Tail-call the function.
2007 __ ldr(R1, FieldAddress(R0, Function::instructions_offset()));
2008 __ AddImmediate(R1, Instructions::HeaderSize() - kHeapObjectTag);
2009 __ bx(R1);
2010 }
2011 #endif
2012
2013
1973 // On stack: user tag (+0). 2014 // On stack: user tag (+0).
1974 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { 2015 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
1975 // R1: Isolate. 2016 // R1: Isolate.
1976 Isolate* isolate = Isolate::Current(); 2017 Isolate* isolate = Isolate::Current();
1977 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); 2018 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate));
1978 // R0: Current user tag. 2019 // R0: Current user tag.
1979 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); 2020 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
1980 // R2: UserTag. 2021 // R2: UserTag.
1981 __ ldr(R2, Address(SP, + 0 * kWordSize)); 2022 __ ldr(R2, Address(SP, + 0 * kWordSize));
1982 // Set Isolate::current_tag_. 2023 // Set Isolate::current_tag_.
(...skipping 21 matching lines...) Expand all
2004 Isolate* isolate = Isolate::Current(); 2045 Isolate* isolate = Isolate::Current();
2005 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); 2046 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate));
2006 // Set return value to Isolate::current_tag_. 2047 // Set return value to Isolate::current_tag_.
2007 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); 2048 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
2008 __ Ret(); 2049 __ Ret();
2009 } 2050 }
2010 2051
2011 } // namespace dart 2052 } // namespace dart
2012 2053
2013 #endif // defined TARGET_ARCH_ARM 2054 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698