| 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 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2023 // Tail-call the function. | 2023 // Tail-call the function. |
| 2024 __ ldr(R1, FieldAddress(R0, Function::instructions_offset())); | 2024 __ ldr(R1, FieldAddress(R0, Function::instructions_offset())); |
| 2025 __ AddImmediate(R1, Instructions::HeaderSize() - kHeapObjectTag); | 2025 __ AddImmediate(R1, Instructions::HeaderSize() - kHeapObjectTag); |
| 2026 __ bx(R1); | 2026 __ bx(R1); |
| 2027 } | 2027 } |
| 2028 | 2028 |
| 2029 | 2029 |
| 2030 // On stack: user tag (+0). | 2030 // On stack: user tag (+0). |
| 2031 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { | 2031 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { |
| 2032 // R1: Isolate. | 2032 // R1: Isolate. |
| 2033 Isolate* isolate = Isolate::Current(); | 2033 __ LoadIsolate(R1); |
| 2034 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); | |
| 2035 // R0: Current user tag. | 2034 // R0: Current user tag. |
| 2036 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | 2035 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
| 2037 // R2: UserTag. | 2036 // R2: UserTag. |
| 2038 __ ldr(R2, Address(SP, + 0 * kWordSize)); | 2037 __ ldr(R2, Address(SP, + 0 * kWordSize)); |
| 2039 // Set Isolate::current_tag_. | 2038 // Set Isolate::current_tag_. |
| 2040 __ str(R2, Address(R1, Isolate::current_tag_offset())); | 2039 __ str(R2, Address(R1, Isolate::current_tag_offset())); |
| 2041 // R2: UserTag's tag. | 2040 // R2: UserTag's tag. |
| 2042 __ ldr(R2, FieldAddress(R2, UserTag::tag_offset())); | 2041 __ ldr(R2, FieldAddress(R2, UserTag::tag_offset())); |
| 2043 // Set Isolate::user_tag_. | 2042 // Set Isolate::user_tag_. |
| 2044 __ str(R2, Address(R1, Isolate::user_tag_offset())); | 2043 __ str(R2, Address(R1, Isolate::user_tag_offset())); |
| 2045 __ Ret(); | 2044 __ Ret(); |
| 2046 } | 2045 } |
| 2047 | 2046 |
| 2048 | 2047 |
| 2049 void Intrinsifier::UserTag_defaultTag(Assembler* assembler) { | 2048 void Intrinsifier::UserTag_defaultTag(Assembler* assembler) { |
| 2050 Isolate* isolate = Isolate::Current(); | 2049 __ LoadIsolate(R0); |
| 2051 // Set return value to default tag address. | 2050 __ ldr(R0, Address(R0, Isolate::default_tag_offset())); |
| 2052 __ LoadImmediate(R0, | |
| 2053 reinterpret_cast<uword>(isolate) + Isolate::default_tag_offset()); | |
| 2054 __ ldr(R0, Address(R0, 0)); | |
| 2055 __ Ret(); | 2051 __ Ret(); |
| 2056 } | 2052 } |
| 2057 | 2053 |
| 2058 | 2054 |
| 2059 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 2055 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
| 2060 // R1: Default tag address. | 2056 __ LoadIsolate(R0); |
| 2061 Isolate* isolate = Isolate::Current(); | 2057 __ ldr(R0, Address(R0, Isolate::current_tag_offset())); |
| 2062 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); | |
| 2063 // Set return value to Isolate::current_tag_. | |
| 2064 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | |
| 2065 __ Ret(); | 2058 __ Ret(); |
| 2066 } | 2059 } |
| 2067 | 2060 |
| 2068 } // namespace dart | 2061 } // namespace dart |
| 2069 | 2062 |
| 2070 #endif // defined TARGET_ARCH_ARM | 2063 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |