OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/thread.h" | 5 #include "vm/thread.h" |
6 | 6 |
7 #include "vm/dart_api_state.h" | 7 #include "vm/dart_api_state.h" |
8 #include "vm/growable_array.h" | 8 #include "vm/growable_array.h" |
9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
10 #include "vm/lockers.h" | 10 #include "vm/lockers.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 #undef DEFAULT_INIT | 80 #undef DEFAULT_INIT |
81 | 81 |
82 // We cannot initialize the VM constants here for the vm isolate thread | 82 // We cannot initialize the VM constants here for the vm isolate thread |
83 // due to boot strapping issues. | 83 // due to boot strapping issues. |
84 if ((Dart::vm_isolate() != NULL) && (isolate != Dart::vm_isolate())) { | 84 if ((Dart::vm_isolate() != NULL) && (isolate != Dart::vm_isolate())) { |
85 InitVMConstants(); | 85 InitVMConstants(); |
86 } | 86 } |
87 } | 87 } |
88 | 88 |
89 | 89 |
90 static const struct ALIGN16 { | |
91 uint64_t a; | |
92 uint64_t b; | |
93 } double_negate_constant = | |
94 {0x8000000000000000LL, 0x8000000000000000LL}; | |
95 | |
96 static const struct ALIGN16 { | |
97 uint64_t a; | |
98 uint64_t b; | |
99 } double_abs_constant = | |
100 {0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFFLL}; | |
101 | |
102 static const struct ALIGN16 { | |
103 uint32_t a; | |
104 uint32_t b; | |
105 uint32_t c; | |
106 uint32_t d; | |
107 } float_not_constant = | |
108 { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; | |
109 | |
110 static const struct ALIGN16 { | |
111 uint32_t a; | |
112 uint32_t b; | |
113 uint32_t c; | |
114 uint32_t d; | |
115 } float_negate_constant = | |
116 { 0x80000000, 0x80000000, 0x80000000, 0x80000000 }; | |
117 | |
118 static const struct ALIGN16 { | |
119 uint32_t a; | |
120 uint32_t b; | |
121 uint32_t c; | |
122 uint32_t d; | |
123 } float_absolute_constant = | |
124 { 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF }; | |
125 | |
126 static const struct ALIGN16 { | |
127 uint32_t a; | |
128 uint32_t b; | |
129 uint32_t c; | |
130 uint32_t d; | |
131 } float_zerow_constant = | |
132 { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000 }; | |
133 | |
134 | |
135 void Thread::InitVMConstants() { | 90 void Thread::InitVMConstants() { |
136 #define ASSERT_VM_HEAP(type_name, member_name, init_expr, default_init_value) \ | 91 #define ASSERT_VM_HEAP(type_name, member_name, init_expr, default_init_value) \ |
137 ASSERT((init_expr)->IsOldObject()); | 92 ASSERT((init_expr)->IsOldObject()); |
138 CACHED_VM_OBJECTS_LIST(ASSERT_VM_HEAP) | 93 CACHED_VM_OBJECTS_LIST(ASSERT_VM_HEAP) |
139 #undef ASSERT_VM_HEAP | 94 #undef ASSERT_VM_HEAP |
140 | 95 |
141 #define INIT_VALUE(type_name, member_name, init_expr, default_init_value) \ | 96 #define INIT_VALUE(type_name, member_name, init_expr, default_init_value) \ |
142 ASSERT(member_name == default_init_value); \ | 97 ASSERT(member_name == default_init_value); \ |
143 member_name = (init_expr); | 98 member_name = (init_expr); |
144 CACHED_CONSTANTS_LIST(INIT_VALUE) | 99 CACHED_CONSTANTS_LIST(INIT_VALUE) |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 | 404 |
450 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { | 405 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { |
451 if (thread() != NULL) { | 406 if (thread() != NULL) { |
452 OSThread* os_thread = thread()->os_thread(); | 407 OSThread* os_thread = thread()->os_thread(); |
453 ASSERT(os_thread != NULL); | 408 ASSERT(os_thread != NULL); |
454 os_thread->EnableThreadInterrupts(); | 409 os_thread->EnableThreadInterrupts(); |
455 } | 410 } |
456 } | 411 } |
457 | 412 |
458 } // namespace dart | 413 } // namespace dart |
OLD | NEW |