OLD | NEW |
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 |
(...skipping 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2076 void Intrinsifier::OneByteString_equality(Assembler* assembler) { | 2076 void Intrinsifier::OneByteString_equality(Assembler* assembler) { |
2077 StringEquality(assembler, kOneByteStringCid); | 2077 StringEquality(assembler, kOneByteStringCid); |
2078 } | 2078 } |
2079 | 2079 |
2080 | 2080 |
2081 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { | 2081 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { |
2082 StringEquality(assembler, kTwoByteStringCid); | 2082 StringEquality(assembler, kTwoByteStringCid); |
2083 } | 2083 } |
2084 | 2084 |
2085 | 2085 |
2086 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) { | 2086 void Intrinsifier::RegExp_ExecuteMatch(Assembler* assembler) { |
2087 if (FLAG_interpret_irregexp) return; | 2087 if (FLAG_interpret_irregexp) return; |
2088 | 2088 |
2089 static const intptr_t kRegExpParamOffset = 3 * kWordSize; | 2089 static const intptr_t kRegExpParamOffset = 3 * kWordSize; |
2090 static const intptr_t kStringParamOffset = 2 * kWordSize; | 2090 static const intptr_t kStringParamOffset = 2 * kWordSize; |
2091 // start_index smi is located at offset 1. | 2091 // start_index smi is located at offset 1. |
2092 | 2092 |
2093 // Incoming registers: | 2093 // Incoming registers: |
2094 // EAX: Function. (Will be loaded with the specialized matcher function.) | 2094 // EAX: Function. (Will be loaded with the specialized matcher function.) |
2095 // ECX: Unknown. (Must be GC safe on tail call.) | 2095 // ECX: Unknown. (Must be GC safe on tail call.) |
2096 // EDX: Arguments descriptor. (Will be preserved.) | 2096 // EDX: Arguments descriptor. (Will be preserved.) |
2097 | 2097 |
2098 // Load the specialized function pointer into EAX. Leverage the fact the | 2098 // Load the specialized function pointer into EAX. Leverage the fact the |
2099 // string CIDs as well as stored function pointers are in sequence. | 2099 // string CIDs as well as stored function pointers are in sequence. |
2100 __ movl(EBX, Address(ESP, kRegExpParamOffset)); | 2100 __ movl(EBX, Address(ESP, kRegExpParamOffset)); |
2101 __ movl(EDI, Address(ESP, kStringParamOffset)); | 2101 __ movl(EDI, Address(ESP, kStringParamOffset)); |
2102 __ LoadClassId(EDI, EDI); | 2102 __ LoadClassId(EDI, EDI); |
2103 __ SubImmediate(EDI, Immediate(kOneByteStringCid)); | 2103 __ SubImmediate(EDI, Immediate(kOneByteStringCid)); |
2104 __ movl(EAX, FieldAddress(EBX, EDI, TIMES_4, | 2104 __ movl(EAX, FieldAddress(EBX, EDI, TIMES_4, |
2105 JSRegExp::function_offset(kOneByteStringCid))); | 2105 RegExp::function_offset(kOneByteStringCid))); |
2106 | 2106 |
2107 // Registers are now set up for the lazy compile stub. It expects the function | 2107 // Registers are now set up for the lazy compile stub. It expects the function |
2108 // in EAX, the argument descriptor in EDX, and IC-Data in ECX. | 2108 // in EAX, the argument descriptor in EDX, and IC-Data in ECX. |
2109 __ xorl(ECX, ECX); | 2109 __ xorl(ECX, ECX); |
2110 | 2110 |
2111 // Tail-call the function. | 2111 // Tail-call the function. |
2112 __ movl(EDI, FieldAddress(EAX, Function::entry_point_offset())); | 2112 __ movl(EDI, FieldAddress(EAX, Function::entry_point_offset())); |
2113 __ jmp(EDI); | 2113 __ jmp(EDI); |
2114 } | 2114 } |
2115 | 2115 |
(...skipping 26 matching lines...) Expand all Loading... |
2142 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 2142 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
2143 __ LoadIsolate(EAX); | 2143 __ LoadIsolate(EAX); |
2144 __ movl(EAX, Address(EAX, Isolate::current_tag_offset())); | 2144 __ movl(EAX, Address(EAX, Isolate::current_tag_offset())); |
2145 __ ret(); | 2145 __ ret(); |
2146 } | 2146 } |
2147 | 2147 |
2148 #undef __ | 2148 #undef __ |
2149 } // namespace dart | 2149 } // namespace dart |
2150 | 2150 |
2151 #endif // defined TARGET_ARCH_IA32 | 2151 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |