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

Side by Side Diff: runtime/vm/intrinsifier_mips.cc

Issue 539153002: Port and integrate the irregexp engine from V8 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed Ivan's comments. Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | runtime/vm/intrinsifier_x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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/dart_entry.h"
11 #include "vm/flow_graph_compiler.h" 12 #include "vm/flow_graph_compiler.h"
12 #include "vm/object.h" 13 #include "vm/object.h"
13 #include "vm/object_store.h" 14 #include "vm/object_store.h"
15 #include "vm/regexp_assembler.h"
14 #include "vm/symbols.h" 16 #include "vm/symbols.h"
15 17
16 namespace dart { 18 namespace dart {
17 19
18 DECLARE_FLAG(bool, enable_type_checks); 20 DECLARE_FLAG(bool, enable_type_checks);
19 21
20 #define __ assembler-> 22 #define __ assembler->
21 23
22 24
23 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; } 25 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; }
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1662 1664
1663 void Intrinsifier::OneByteString_equality(Assembler* assembler) { 1665 void Intrinsifier::OneByteString_equality(Assembler* assembler) {
1664 StringEquality(assembler, kOneByteStringCid); 1666 StringEquality(assembler, kOneByteStringCid);
1665 } 1667 }
1666 1668
1667 1669
1668 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { 1670 void Intrinsifier::TwoByteString_equality(Assembler* assembler) {
1669 StringEquality(assembler, kTwoByteStringCid); 1671 StringEquality(assembler, kTwoByteStringCid);
1670 } 1672 }
1671 1673
1674
1675 #ifndef USE_JSCRE
1676 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) {
1677 static const intptr_t kRegExpParamOffset = + 2 * kWordSize;
1678 static const intptr_t kStringParamOffset = + 1 * kWordSize;
1679 // const Smi& start_index is located at (+ 0 * kWordSize).
1680
1681 // Register assignments are as follows:
1682 // T0: The appropriate specialized matcher function.
1683 // T1: The regexp object.
1684 // T2: Temp.
1685 // T3: Temp, Pointer to the function's code which we then tail-call.
1686
1687 __ lw(T1, Address(SP, kRegExpParamOffset));
1688 __ lw(T3, Address(SP, kStringParamOffset));
1689
1690 // Load the specialized function pointer into T0. Leverage the fact the
1691 // string CIDs as well as stored function pointers are in sequence.
1692
1693 __ LoadClassId(T2, T3);
1694 __ AddImmediate(T2, -kOneByteStringCid);
1695 __ sll(T2, T2, kWordSizeLog2);
1696 __ addu(T2, T2, T1);
1697 __ lw(T0, FieldAddress(T2, JSRegExp::function_offset(kOneByteStringCid)));
1698
1699 // Registers have been set up for the lazy compile stub at this point.
1700 // It expects the function in T0, the argument descriptor in S4, and
1701 // IC-Data in S5. Explicitly null out IC-Data to ensure its validity.
1702
1703 static const intptr_t arg_count = RegExpMacroAssembler::kParamCount;
1704 __ LoadObject(S4, Array::Handle(ArgumentsDescriptor::New(arg_count)));
1705 __ xor_(S5, S5, S5);
1706
1707 // Tail-call the function.
1708 __ lw(T3, FieldAddress(T0, Function::instructions_offset()));
1709 __ AddImmediate(T3, Instructions::HeaderSize() - kHeapObjectTag);
1710 __ jr(T3);
1711 }
1712 #endif
1713
1714
1672 // On stack: user tag (+0). 1715 // On stack: user tag (+0).
1673 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { 1716 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
1674 // T1: Isolate. 1717 // T1: Isolate.
1675 Isolate* isolate = Isolate::Current(); 1718 Isolate* isolate = Isolate::Current();
1676 __ LoadImmediate(T1, reinterpret_cast<uword>(isolate)); 1719 __ LoadImmediate(T1, reinterpret_cast<uword>(isolate));
1677 // V0: Current user tag. 1720 // V0: Current user tag.
1678 __ lw(V0, Address(T1, Isolate::current_tag_offset())); 1721 __ lw(V0, Address(T1, Isolate::current_tag_offset()));
1679 // T2: UserTag. 1722 // T2: UserTag.
1680 __ lw(T2, Address(SP, + 0 * kWordSize)); 1723 __ lw(T2, Address(SP, + 0 * kWordSize));
1681 // Set Isolate::current_tag_. 1724 // Set Isolate::current_tag_.
(...skipping 22 matching lines...) Expand all
1704 Isolate* isolate = Isolate::Current(); 1747 Isolate* isolate = Isolate::Current();
1705 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); 1748 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate));
1706 // Set return value. 1749 // Set return value.
1707 __ Ret(); 1750 __ Ret();
1708 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); 1751 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset()));
1709 } 1752 }
1710 1753
1711 } // namespace dart 1754 } // namespace dart
1712 1755
1713 #endif // defined TARGET_ARCH_MIPS 1756 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_ia32.cc ('k') | runtime/vm/intrinsifier_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698