| 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_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/dart_entry.h" |
| 12 #include "vm/flow_graph_compiler.h" | 12 #include "vm/flow_graph_compiler.h" |
| 13 #include "vm/object.h" | 13 #include "vm/object.h" |
| 14 #include "vm/object_store.h" | 14 #include "vm/object_store.h" |
| 15 #include "vm/regexp_assembler.h" | 15 #include "vm/regexp_assembler.h" |
| 16 #include "vm/symbols.h" | 16 #include "vm/symbols.h" |
| 17 #include "vm/timeline.h" |
| 17 | 18 |
| 18 namespace dart { | 19 namespace dart { |
| 19 | 20 |
| 20 // When entering intrinsics code: | 21 // When entering intrinsics code: |
| 21 // S4: Arguments descriptor | 22 // S4: Arguments descriptor |
| 22 // RA: Return address | 23 // RA: Return address |
| 23 // The S4 register can be destroyed only if there is no slow-path, i.e. | 24 // The S4 register can be destroyed only if there is no slow-path, i.e. |
| 24 // if the intrinsified method always executes a return. | 25 // if the intrinsified method always executes a return. |
| 25 // The FP register should not be modified, because it is used by the profiler. | 26 // The FP register should not be modified, because it is used by the profiler. |
| 26 // The PP and THR registers (see constants_mips.h) must be preserved. | 27 // The PP and THR registers (see constants_mips.h) must be preserved. |
| (...skipping 2174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2201 __ delay_slot()->lw(V0, Address(V0, Isolate::default_tag_offset())); | 2202 __ delay_slot()->lw(V0, Address(V0, Isolate::default_tag_offset())); |
| 2202 } | 2203 } |
| 2203 | 2204 |
| 2204 | 2205 |
| 2205 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 2206 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
| 2206 __ LoadIsolate(V0); | 2207 __ LoadIsolate(V0); |
| 2207 __ Ret(); | 2208 __ Ret(); |
| 2208 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); | 2209 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); |
| 2209 } | 2210 } |
| 2210 | 2211 |
| 2212 |
| 2213 void Intrinsifier::Timeline_isDartStreamEnabled(Assembler* assembler) { |
| 2214 Label true_label; |
| 2215 // Load TimelineStream*. |
| 2216 __ lw(V0, Address(THR, Thread::dart_stream_offset())); |
| 2217 // Load uintptr_t from TimelineStream*. |
| 2218 __ lw(V0, Address(V0, TimelineStream::enabled_offset())); |
| 2219 __ bne(V0, ZR, &true_label); |
| 2220 // Not enabled. |
| 2221 __ LoadObject(V0, Bool::False()); |
| 2222 __ Ret(); |
| 2223 // Enabled. |
| 2224 __ Bind(&true_label); |
| 2225 __ LoadObject(V0, Bool::True()); |
| 2226 __ Ret(); |
| 2227 } |
| 2228 |
| 2211 } // namespace dart | 2229 } // namespace dart |
| 2212 | 2230 |
| 2213 #endif // defined TARGET_ARCH_MIPS | 2231 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |