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

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

Issue 1201383002: Port irregexp bytecode compiler and interpreter from V8 r24065. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
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 // The intrinsic code below is executed before a method has built its frame. 5 // The intrinsic code below is executed before a method has built its frame.
6 // The return address is on the stack and the arguments below it. 6 // The return address is on the stack and the arguments below it.
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved.
8 // Each intrinsification method returns true if the corresponding 8 // Each intrinsification method returns true if the corresponding
9 // Dart method was intrinsified. 9 // Dart method was intrinsified.
10 10
11 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. 11 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
12 #if defined(TARGET_ARCH_IA32) 12 #if defined(TARGET_ARCH_IA32)
13 13
14 #include "vm/intrinsifier.h" 14 #include "vm/intrinsifier.h"
15 15
16 #include "vm/assembler.h" 16 #include "vm/assembler.h"
17 #include "vm/dart_entry.h" 17 #include "vm/dart_entry.h"
18 #include "vm/flow_graph_compiler.h" 18 #include "vm/flow_graph_compiler.h"
19 #include "vm/object.h" 19 #include "vm/object.h"
20 #include "vm/object_store.h" 20 #include "vm/object_store.h"
21 #include "vm/os.h" 21 #include "vm/os.h"
22 #include "vm/regexp_assembler.h" 22 #include "vm/regexp_assembler.h"
23 #include "vm/symbols.h" 23 #include "vm/symbols.h"
24 24
25 namespace dart { 25 namespace dart {
26 26
27 DECLARE_FLAG(bool, interpret_irregexp);
28
27 // When entering intrinsics code: 29 // When entering intrinsics code:
28 // ECX: IC Data 30 // ECX: IC Data
29 // EDX: Arguments descriptor 31 // EDX: Arguments descriptor
30 // TOS: Return address 32 // TOS: Return address
31 // The ECX, EDX registers can be destroyed only if there is no slow-path, i.e. 33 // The ECX, EDX registers can be destroyed only if there is no slow-path, i.e.
32 // if the intrinsified method always executes a return. 34 // if the intrinsified method always executes a return.
33 // The EBP register should not be modified, because it is used by the profiler. 35 // The EBP register should not be modified, because it is used by the profiler.
34 36
35 #define __ assembler-> 37 #define __ assembler->
36 38
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after
2045 StringEquality(assembler, kOneByteStringCid); 2047 StringEquality(assembler, kOneByteStringCid);
2046 } 2048 }
2047 2049
2048 2050
2049 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { 2051 void Intrinsifier::TwoByteString_equality(Assembler* assembler) {
2050 StringEquality(assembler, kTwoByteStringCid); 2052 StringEquality(assembler, kTwoByteStringCid);
2051 } 2053 }
2052 2054
2053 2055
2054 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) { 2056 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) {
2057 if (FLAG_interpret_irregexp) return;
2058
2055 static const intptr_t kRegExpParamOffset = 3 * kWordSize; 2059 static const intptr_t kRegExpParamOffset = 3 * kWordSize;
2056 static const intptr_t kStringParamOffset = 2 * kWordSize; 2060 static const intptr_t kStringParamOffset = 2 * kWordSize;
2057 // start_index smi is located at offset 1. 2061 // start_index smi is located at offset 1.
2058 2062
2059 // Incoming registers: 2063 // Incoming registers:
2060 // EAX: Function. (Will be loaded with the specialized matcher function.) 2064 // EAX: Function. (Will be loaded with the specialized matcher function.)
2061 // ECX: Unknown. (Must be GC safe on tail call.) 2065 // ECX: Unknown. (Must be GC safe on tail call.)
2062 // EDX: Arguments descriptor. (Will be preserved.) 2066 // EDX: Arguments descriptor. (Will be preserved.)
2063 2067
2064 // Load the specialized function pointer into EAX. Leverage the fact the 2068 // Load the specialized function pointer into EAX. Leverage the fact the
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2124 Isolate::current_tag_offset()); 2128 Isolate::current_tag_offset());
2125 // Set return value to Isolate::current_tag_. 2129 // Set return value to Isolate::current_tag_.
2126 __ movl(EAX, current_tag_addr); 2130 __ movl(EAX, current_tag_addr);
2127 __ ret(); 2131 __ ret();
2128 } 2132 }
2129 2133
2130 #undef __ 2134 #undef __
2131 } // namespace dart 2135 } // namespace dart
2132 2136
2133 #endif // defined TARGET_ARCH_IA32 2137 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698