| 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 #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" |
| (...skipping 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1984 if (FLAG_use_jscre) { | 1984 if (FLAG_use_jscre) { |
| 1985 return; | 1985 return; |
| 1986 } | 1986 } |
| 1987 static const intptr_t kRegExpParamOffset = 2 * kWordSize; | 1987 static const intptr_t kRegExpParamOffset = 2 * kWordSize; |
| 1988 static const intptr_t kStringParamOffset = 1 * kWordSize; | 1988 static const intptr_t kStringParamOffset = 1 * kWordSize; |
| 1989 // start_index smi is located at offset 0. | 1989 // start_index smi is located at offset 0. |
| 1990 | 1990 |
| 1991 // Incoming registers: | 1991 // Incoming registers: |
| 1992 // R0: Function. (Will be reloaded with the specialized matcher function.) | 1992 // R0: Function. (Will be reloaded with the specialized matcher function.) |
| 1993 // R4: Arguments descriptor. (Will be preserved.) | 1993 // R4: Arguments descriptor. (Will be preserved.) |
| 1994 // R5: IC-Data. (Will be preserved.) | 1994 // R5: Unknown. (Must be GC safe on tail call.) |
| 1995 | 1995 |
| 1996 // Load the specialized function pointer into R0. Leverage the fact the | 1996 // Load the specialized function pointer into R0. Leverage the fact the |
| 1997 // string CIDs as well as stored function pointers are in sequence. | 1997 // string CIDs as well as stored function pointers are in sequence. |
| 1998 __ ldr(R2, Address(SP, kRegExpParamOffset)); | 1998 __ ldr(R2, Address(SP, kRegExpParamOffset)); |
| 1999 __ ldr(R1, Address(SP, kStringParamOffset)); | 1999 __ ldr(R1, Address(SP, kStringParamOffset)); |
| 2000 __ LoadClassId(R1, R1); | 2000 __ LoadClassId(R1, R1); |
| 2001 __ AddImmediate(R1, R1, -kOneByteStringCid); | 2001 __ AddImmediate(R1, R1, -kOneByteStringCid); |
| 2002 __ add(R1, R2, Operand(R1, LSL, kWordSizeLog2)); | 2002 __ add(R1, R2, Operand(R1, LSL, kWordSizeLog2)); |
| 2003 __ ldr(R0, FieldAddress(R1, JSRegExp::function_offset(kOneByteStringCid))); | 2003 __ ldr(R0, FieldAddress(R1, JSRegExp::function_offset(kOneByteStringCid))); |
| 2004 | 2004 |
| 2005 // Registers are now set up for the lazy compile stub. It expects the function | 2005 // Registers are now set up for the lazy compile stub. It expects the function |
| 2006 // in R0, the argument descriptor in R4, and IC-Data in R5. | 2006 // in R0, the argument descriptor in R4, and IC-Data in R5. |
| 2007 static const intptr_t arg_count = RegExpMacroAssembler::kParamCount; | 2007 static const intptr_t arg_count = RegExpMacroAssembler::kParamCount; |
| 2008 __ LoadObject(R4, Array::Handle(ArgumentsDescriptor::New(arg_count))); | 2008 __ LoadObject(R4, Array::Handle(ArgumentsDescriptor::New(arg_count))); |
| 2009 __ eor(R5, R5, Operand(R5)); |
| 2009 | 2010 |
| 2010 // Tail-call the function. | 2011 // Tail-call the function. |
| 2011 __ ldr(R1, FieldAddress(R0, Function::instructions_offset())); | 2012 __ ldr(R1, FieldAddress(R0, Function::instructions_offset())); |
| 2012 __ AddImmediate(R1, Instructions::HeaderSize() - kHeapObjectTag); | 2013 __ AddImmediate(R1, Instructions::HeaderSize() - kHeapObjectTag); |
| 2013 __ bx(R1); | 2014 __ bx(R1); |
| 2014 } | 2015 } |
| 2015 | 2016 |
| 2016 | 2017 |
| 2017 // On stack: user tag (+0). | 2018 // On stack: user tag (+0). |
| 2018 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { | 2019 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 2048 Isolate* isolate = Isolate::Current(); | 2049 Isolate* isolate = Isolate::Current(); |
| 2049 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); | 2050 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); |
| 2050 // Set return value to Isolate::current_tag_. | 2051 // Set return value to Isolate::current_tag_. |
| 2051 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | 2052 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
| 2052 __ Ret(); | 2053 __ Ret(); |
| 2053 } | 2054 } |
| 2054 | 2055 |
| 2055 } // namespace dart | 2056 } // namespace dart |
| 2056 | 2057 |
| 2057 #endif // defined TARGET_ARCH_ARM | 2058 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |