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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
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/instructions.h" | 13 #include "vm/instructions.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 // R10: Arguments descriptor | 22 // R10: Arguments descriptor |
22 // TOS: Return address | 23 // TOS: Return address |
23 // The R10 registers can be destroyed only if there is no slow-path, i.e. | 24 // The R10 registers 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 RBP register should not be modified, because it is used by the profiler. | 26 // The RBP register should not be modified, because it is used by the profiler. |
26 // The PP and THR registers (see constants_x64.h) must be preserved. | 27 // The PP and THR registers (see constants_x64.h) must be preserved. |
(...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2079 __ ret(); | 2080 __ ret(); |
2080 } | 2081 } |
2081 | 2082 |
2082 | 2083 |
2083 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 2084 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
2084 __ LoadIsolate(RAX); | 2085 __ LoadIsolate(RAX); |
2085 __ movq(RAX, Address(RAX, Isolate::current_tag_offset())); | 2086 __ movq(RAX, Address(RAX, Isolate::current_tag_offset())); |
2086 __ ret(); | 2087 __ ret(); |
2087 } | 2088 } |
2088 | 2089 |
| 2090 |
| 2091 void Intrinsifier::Timeline_isDartStreamEnabled(Assembler* assembler) { |
| 2092 if (!FLAG_support_timeline) { |
| 2093 __ LoadObject(RAX, Bool::False()); |
| 2094 __ ret(); |
| 2095 return; |
| 2096 } |
| 2097 Label true_label; |
| 2098 // Load TimelineStream*. |
| 2099 __ movq(RAX, Address(THR, Thread::dart_stream_offset())); |
| 2100 // Load uintptr_t from TimelineStream*. |
| 2101 __ movq(RAX, Address(RAX, TimelineStream::enabled_offset())); |
| 2102 __ cmpq(RAX, Immediate(0)); |
| 2103 __ j(NOT_ZERO, &true_label, Assembler::kNearJump); |
| 2104 // Not enabled. |
| 2105 __ LoadObject(RAX, Bool::False()); |
| 2106 __ ret(); |
| 2107 // Enabled. |
| 2108 __ Bind(&true_label); |
| 2109 __ LoadObject(RAX, Bool::True()); |
| 2110 __ ret(); |
| 2111 } |
| 2112 |
2089 #undef __ | 2113 #undef __ |
2090 | 2114 |
2091 } // namespace dart | 2115 } // namespace dart |
2092 | 2116 |
2093 #endif // defined TARGET_ARCH_X64 | 2117 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |