Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: runtime/vm/thread.cc

Issue 1488403002: Precompilation/x64: Load float vector constants via Thread. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/thread.h ('k') | runtime/vm/unit_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
90 void Thread::InitVMConstants() { 135 void Thread::InitVMConstants() {
91 #define ASSERT_VM_HEAP(type_name, member_name, init_expr, default_init_value) \ 136 #define ASSERT_VM_HEAP(type_name, member_name, init_expr, default_init_value) \
92 ASSERT((init_expr)->IsOldObject()); 137 ASSERT((init_expr)->IsOldObject());
93 CACHED_VM_OBJECTS_LIST(ASSERT_VM_HEAP) 138 CACHED_VM_OBJECTS_LIST(ASSERT_VM_HEAP)
94 #undef ASSERT_VM_HEAP 139 #undef ASSERT_VM_HEAP
95 140
96 #define INIT_VALUE(type_name, member_name, init_expr, default_init_value) \ 141 #define INIT_VALUE(type_name, member_name, init_expr, default_init_value) \
97 ASSERT(member_name == default_init_value); \ 142 ASSERT(member_name == default_init_value); \
98 member_name = (init_expr); 143 member_name = (init_expr);
99 CACHED_CONSTANTS_LIST(INIT_VALUE) 144 CACHED_CONSTANTS_LIST(INIT_VALUE)
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 449
405 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { 450 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() {
406 if (thread() != NULL) { 451 if (thread() != NULL) {
407 OSThread* os_thread = thread()->os_thread(); 452 OSThread* os_thread = thread()->os_thread();
408 ASSERT(os_thread != NULL); 453 ASSERT(os_thread != NULL);
409 os_thread->EnableThreadInterrupts(); 454 os_thread->EnableThreadInterrupts();
410 } 455 }
411 } 456 }
412 457
413 } // namespace dart 458 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/thread.h ('k') | runtime/vm/unit_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698