author | kbarrett |
Wed, 22 Jul 2015 00:37:01 -0400 | |
changeset 31964 | d34ad1715d96 |
parent 29325 | 0e86e64c66e5 |
child 32596 | 8feecdee3156 |
permissions | -rw-r--r-- |
6187 | 1 |
/* |
29325 | 2 |
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. |
6187 | 3 |
* Copyright 2008, 2009, 2010 Red Hat, Inc. |
4 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
5 |
* |
|
6 |
* This code is free software; you can redistribute it and/or modify it |
|
7 |
* under the terms of the GNU General Public License version 2 only, as |
|
8 |
* published by the Free Software Foundation. |
|
9 |
* |
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
14 |
* accompanied this code). |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License version |
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
19 |
* |
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
21 |
* or visit www.oracle.com if you need additional information or have any |
|
22 |
* questions. |
|
23 |
* |
|
24 |
*/ |
|
25 |
||
7397 | 26 |
#include "precompiled.hpp" |
27 |
#include "ci/ciMethod.hpp" |
|
31964 | 28 |
#include "gc/shared/barrierSet.hpp" |
29 |
#include "gc/shared/cardTableModRefBS.hpp" |
|
7397 | 30 |
#include "memory/resourceArea.hpp" |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
31 |
#include "oops/method.hpp" |
7397 | 32 |
#include "runtime/os.hpp" |
33 |
#include "runtime/synchronizer.hpp" |
|
34 |
#include "runtime/thread.hpp" |
|
35 |
#include "shark/llvmHeaders.hpp" |
|
36 |
#include "shark/llvmValue.hpp" |
|
37 |
#include "shark/sharkBuilder.hpp" |
|
38 |
#include "shark/sharkContext.hpp" |
|
39 |
#include "shark/sharkRuntime.hpp" |
|
40 |
#include "utilities/debug.hpp" |
|
6187 | 41 |
|
42 |
using namespace llvm; |
|
43 |
||
44 |
SharkBuilder::SharkBuilder(SharkCodeBuffer* code_buffer) |
|
45 |
: IRBuilder<>(SharkContext::current()), |
|
46 |
_code_buffer(code_buffer) { |
|
47 |
} |
|
48 |
||
49 |
// Helpers for accessing structures |
|
50 |
Value* SharkBuilder::CreateAddressOfStructEntry(Value* base, |
|
51 |
ByteSize offset, |
|
14622 | 52 |
Type* type, |
6187 | 53 |
const char* name) { |
54 |
return CreateBitCast(CreateStructGEP(base, in_bytes(offset)), type, name); |
|
55 |
} |
|
56 |
||
57 |
LoadInst* SharkBuilder::CreateValueOfStructEntry(Value* base, |
|
58 |
ByteSize offset, |
|
14622 | 59 |
Type* type, |
6187 | 60 |
const char* name) { |
61 |
return CreateLoad( |
|
62 |
CreateAddressOfStructEntry( |
|
63 |
base, offset, PointerType::getUnqual(type)), |
|
64 |
name); |
|
65 |
} |
|
66 |
||
67 |
// Helpers for accessing arrays |
|
68 |
||
69 |
LoadInst* SharkBuilder::CreateArrayLength(Value* arrayoop) { |
|
70 |
return CreateValueOfStructEntry( |
|
71 |
arrayoop, in_ByteSize(arrayOopDesc::length_offset_in_bytes()), |
|
72 |
SharkType::jint_type(), "length"); |
|
73 |
} |
|
74 |
||
75 |
Value* SharkBuilder::CreateArrayAddress(Value* arrayoop, |
|
14622 | 76 |
Type* element_type, |
6187 | 77 |
int element_bytes, |
78 |
ByteSize base_offset, |
|
79 |
Value* index, |
|
80 |
const char* name) { |
|
81 |
Value* offset = CreateIntCast(index, SharkType::intptr_type(), false); |
|
82 |
if (element_bytes != 1) |
|
83 |
offset = CreateShl( |
|
84 |
offset, |
|
85 |
LLVMValue::intptr_constant(exact_log2(element_bytes))); |
|
86 |
offset = CreateAdd( |
|
87 |
LLVMValue::intptr_constant(in_bytes(base_offset)), offset); |
|
88 |
||
89 |
return CreateIntToPtr( |
|
90 |
CreateAdd(CreatePtrToInt(arrayoop, SharkType::intptr_type()), offset), |
|
91 |
PointerType::getUnqual(element_type), |
|
92 |
name); |
|
93 |
} |
|
94 |
||
95 |
Value* SharkBuilder::CreateArrayAddress(Value* arrayoop, |
|
96 |
BasicType basic_type, |
|
97 |
ByteSize base_offset, |
|
98 |
Value* index, |
|
99 |
const char* name) { |
|
100 |
return CreateArrayAddress( |
|
101 |
arrayoop, |
|
102 |
SharkType::to_arrayType(basic_type), |
|
103 |
type2aelembytes(basic_type), |
|
104 |
base_offset, index, name); |
|
105 |
} |
|
106 |
||
107 |
Value* SharkBuilder::CreateArrayAddress(Value* arrayoop, |
|
108 |
BasicType basic_type, |
|
109 |
Value* index, |
|
110 |
const char* name) { |
|
111 |
return CreateArrayAddress( |
|
112 |
arrayoop, basic_type, |
|
113 |
in_ByteSize(arrayOopDesc::base_offset_in_bytes(basic_type)), |
|
114 |
index, name); |
|
115 |
} |
|
116 |
||
117 |
// Helpers for creating intrinsics and external functions. |
|
118 |
||
14622 | 119 |
Type* SharkBuilder::make_type(char type, bool void_ok) { |
6187 | 120 |
switch (type) { |
121 |
// Primitive types |
|
122 |
case 'c': |
|
123 |
return SharkType::jbyte_type(); |
|
124 |
case 'i': |
|
125 |
return SharkType::jint_type(); |
|
126 |
case 'l': |
|
127 |
return SharkType::jlong_type(); |
|
128 |
case 'x': |
|
129 |
return SharkType::intptr_type(); |
|
130 |
case 'f': |
|
131 |
return SharkType::jfloat_type(); |
|
132 |
case 'd': |
|
133 |
return SharkType::jdouble_type(); |
|
134 |
||
135 |
// Pointers to primitive types |
|
136 |
case 'C': |
|
137 |
case 'I': |
|
138 |
case 'L': |
|
139 |
case 'X': |
|
140 |
case 'F': |
|
141 |
case 'D': |
|
142 |
return PointerType::getUnqual(make_type(tolower(type), false)); |
|
143 |
||
144 |
// VM objects |
|
145 |
case 'T': |
|
146 |
return SharkType::thread_type(); |
|
147 |
case 'M': |
|
148 |
return PointerType::getUnqual(SharkType::monitor_type()); |
|
149 |
case 'O': |
|
150 |
return SharkType::oop_type(); |
|
14622 | 151 |
case 'K': |
152 |
return SharkType::klass_type(); |
|
6187 | 153 |
|
154 |
// Miscellaneous |
|
155 |
case 'v': |
|
156 |
assert(void_ok, "should be"); |
|
157 |
return SharkType::void_type(); |
|
158 |
case '1': |
|
159 |
return SharkType::bit_type(); |
|
160 |
||
161 |
default: |
|
162 |
ShouldNotReachHere(); |
|
163 |
} |
|
164 |
} |
|
165 |
||
14622 | 166 |
FunctionType* SharkBuilder::make_ftype(const char* params, |
6187 | 167 |
const char* ret) { |
14622 | 168 |
std::vector<Type*> param_types; |
6187 | 169 |
for (const char* c = params; *c; c++) |
170 |
param_types.push_back(make_type(*c, false)); |
|
171 |
||
172 |
assert(strlen(ret) == 1, "should be"); |
|
14622 | 173 |
Type *return_type = make_type(*ret, true); |
6187 | 174 |
|
175 |
return FunctionType::get(return_type, param_types, false); |
|
176 |
} |
|
177 |
||
178 |
// Create an object representing an intrinsic or external function by |
|
179 |
// referencing the symbol by name. This is the LLVM-style approach, |
|
180 |
// but it cannot be used on functions within libjvm.so its symbols |
|
181 |
// are not exported. Note that you cannot make this work simply by |
|
182 |
// exporting the symbols, as some symbols have the same names as |
|
183 |
// symbols in the standard libraries (eg, atan2, fabs) and would |
|
184 |
// obscure them were they visible. |
|
185 |
Value* SharkBuilder::make_function(const char* name, |
|
186 |
const char* params, |
|
187 |
const char* ret) { |
|
188 |
return SharkContext::current().get_external(name, make_ftype(params, ret)); |
|
189 |
} |
|
190 |
||
191 |
// Create an object representing an external function by inlining a |
|
192 |
// function pointer in the code. This is not the LLVM way, but it's |
|
193 |
// the only way to access functions in libjvm.so and functions like |
|
194 |
// __kernel_dmb on ARM which is accessed via an absolute address. |
|
195 |
Value* SharkBuilder::make_function(address func, |
|
196 |
const char* params, |
|
197 |
const char* ret) { |
|
198 |
return CreateIntToPtr( |
|
199 |
LLVMValue::intptr_constant((intptr_t) func), |
|
200 |
PointerType::getUnqual(make_ftype(params, ret))); |
|
201 |
} |
|
202 |
||
203 |
// VM calls |
|
204 |
||
205 |
Value* SharkBuilder::find_exception_handler() { |
|
206 |
return make_function( |
|
207 |
(address) SharkRuntime::find_exception_handler, "TIi", "i"); |
|
208 |
} |
|
209 |
||
210 |
Value* SharkBuilder::monitorenter() { |
|
211 |
return make_function((address) SharkRuntime::monitorenter, "TM", "v"); |
|
212 |
} |
|
213 |
||
214 |
Value* SharkBuilder::monitorexit() { |
|
215 |
return make_function((address) SharkRuntime::monitorexit, "TM", "v"); |
|
216 |
} |
|
217 |
||
218 |
Value* SharkBuilder::new_instance() { |
|
219 |
return make_function((address) SharkRuntime::new_instance, "Ti", "v"); |
|
220 |
} |
|
221 |
||
222 |
Value* SharkBuilder::newarray() { |
|
223 |
return make_function((address) SharkRuntime::newarray, "Tii", "v"); |
|
224 |
} |
|
225 |
||
226 |
Value* SharkBuilder::anewarray() { |
|
227 |
return make_function((address) SharkRuntime::anewarray, "Tii", "v"); |
|
228 |
} |
|
229 |
||
230 |
Value* SharkBuilder::multianewarray() { |
|
231 |
return make_function((address) SharkRuntime::multianewarray, "TiiI", "v"); |
|
232 |
} |
|
233 |
||
234 |
Value* SharkBuilder::register_finalizer() { |
|
235 |
return make_function((address) SharkRuntime::register_finalizer, "TO", "v"); |
|
236 |
} |
|
237 |
||
238 |
Value* SharkBuilder::safepoint() { |
|
239 |
return make_function((address) SafepointSynchronize::block, "T", "v"); |
|
240 |
} |
|
241 |
||
242 |
Value* SharkBuilder::throw_ArithmeticException() { |
|
243 |
return make_function( |
|
244 |
(address) SharkRuntime::throw_ArithmeticException, "TCi", "v"); |
|
245 |
} |
|
246 |
||
247 |
Value* SharkBuilder::throw_ArrayIndexOutOfBoundsException() { |
|
248 |
return make_function( |
|
249 |
(address) SharkRuntime::throw_ArrayIndexOutOfBoundsException, "TCii", "v"); |
|
250 |
} |
|
251 |
||
252 |
Value* SharkBuilder::throw_ClassCastException() { |
|
253 |
return make_function( |
|
254 |
(address) SharkRuntime::throw_ClassCastException, "TCi", "v"); |
|
255 |
} |
|
256 |
||
257 |
Value* SharkBuilder::throw_NullPointerException() { |
|
258 |
return make_function( |
|
259 |
(address) SharkRuntime::throw_NullPointerException, "TCi", "v"); |
|
260 |
} |
|
261 |
||
262 |
// High-level non-VM calls |
|
263 |
||
264 |
Value* SharkBuilder::f2i() { |
|
265 |
return make_function((address) SharedRuntime::f2i, "f", "i"); |
|
266 |
} |
|
267 |
||
268 |
Value* SharkBuilder::f2l() { |
|
269 |
return make_function((address) SharedRuntime::f2l, "f", "l"); |
|
270 |
} |
|
271 |
||
272 |
Value* SharkBuilder::d2i() { |
|
273 |
return make_function((address) SharedRuntime::d2i, "d", "i"); |
|
274 |
} |
|
275 |
||
276 |
Value* SharkBuilder::d2l() { |
|
277 |
return make_function((address) SharedRuntime::d2l, "d", "l"); |
|
278 |
} |
|
279 |
||
280 |
Value* SharkBuilder::is_subtype_of() { |
|
14622 | 281 |
return make_function((address) SharkRuntime::is_subtype_of, "KK", "c"); |
6187 | 282 |
} |
283 |
||
284 |
Value* SharkBuilder::current_time_millis() { |
|
285 |
return make_function((address) os::javaTimeMillis, "", "l"); |
|
286 |
} |
|
287 |
||
288 |
Value* SharkBuilder::sin() { |
|
289 |
return make_function("llvm.sin.f64", "d", "d"); |
|
290 |
} |
|
291 |
||
292 |
Value* SharkBuilder::cos() { |
|
293 |
return make_function("llvm.cos.f64", "d", "d"); |
|
294 |
} |
|
295 |
||
296 |
Value* SharkBuilder::tan() { |
|
297 |
return make_function((address) ::tan, "d", "d"); |
|
298 |
} |
|
299 |
||
300 |
Value* SharkBuilder::atan2() { |
|
301 |
return make_function((address) ::atan2, "dd", "d"); |
|
302 |
} |
|
303 |
||
304 |
Value* SharkBuilder::sqrt() { |
|
305 |
return make_function("llvm.sqrt.f64", "d", "d"); |
|
306 |
} |
|
307 |
||
308 |
Value* SharkBuilder::log() { |
|
309 |
return make_function("llvm.log.f64", "d", "d"); |
|
310 |
} |
|
311 |
||
312 |
Value* SharkBuilder::log10() { |
|
313 |
return make_function("llvm.log10.f64", "d", "d"); |
|
314 |
} |
|
315 |
||
316 |
Value* SharkBuilder::pow() { |
|
317 |
return make_function("llvm.pow.f64", "dd", "d"); |
|
318 |
} |
|
319 |
||
320 |
Value* SharkBuilder::exp() { |
|
321 |
return make_function("llvm.exp.f64", "d", "d"); |
|
322 |
} |
|
323 |
||
324 |
Value* SharkBuilder::fabs() { |
|
325 |
return make_function((address) ::fabs, "d", "d"); |
|
326 |
} |
|
327 |
||
328 |
Value* SharkBuilder::unsafe_field_offset_to_byte_offset() { |
|
329 |
extern jlong Unsafe_field_offset_to_byte_offset(jlong field_offset); |
|
330 |
return make_function((address) Unsafe_field_offset_to_byte_offset, "l", "l"); |
|
331 |
} |
|
332 |
||
333 |
Value* SharkBuilder::osr_migration_end() { |
|
334 |
return make_function((address) SharedRuntime::OSR_migration_end, "C", "v"); |
|
335 |
} |
|
336 |
||
337 |
// Semi-VM calls |
|
338 |
||
339 |
Value* SharkBuilder::throw_StackOverflowError() { |
|
340 |
return make_function((address) ZeroStack::handle_overflow, "T", "v"); |
|
341 |
} |
|
342 |
||
343 |
Value* SharkBuilder::uncommon_trap() { |
|
344 |
return make_function((address) SharkRuntime::uncommon_trap, "Ti", "i"); |
|
345 |
} |
|
346 |
||
347 |
Value* SharkBuilder::deoptimized_entry_point() { |
|
348 |
return make_function((address) CppInterpreter::main_loop, "iT", "v"); |
|
349 |
} |
|
350 |
||
351 |
// Native-Java transition |
|
352 |
||
353 |
Value* SharkBuilder::check_special_condition_for_native_trans() { |
|
354 |
return make_function( |
|
355 |
(address) JavaThread::check_special_condition_for_native_trans, |
|
356 |
"T", "v"); |
|
357 |
} |
|
358 |
||
359 |
Value* SharkBuilder::frame_address() { |
|
360 |
return make_function("llvm.frameaddress", "i", "C"); |
|
361 |
} |
|
362 |
||
363 |
Value* SharkBuilder::memset() { |
|
364 |
// LLVM 2.8 added a fifth isVolatile field for memset |
|
365 |
// introduced with LLVM r100304 |
|
14622 | 366 |
return make_function("llvm.memset.p0i8.i32", "Cciii", "v"); |
6187 | 367 |
} |
368 |
||
369 |
Value* SharkBuilder::unimplemented() { |
|
370 |
return make_function((address) report_unimplemented, "Ci", "v"); |
|
371 |
} |
|
372 |
||
373 |
Value* SharkBuilder::should_not_reach_here() { |
|
374 |
return make_function((address) report_should_not_reach_here, "Ci", "v"); |
|
375 |
} |
|
376 |
||
377 |
Value* SharkBuilder::dump() { |
|
378 |
return make_function((address) SharkRuntime::dump, "Cx", "v"); |
|
379 |
} |
|
380 |
||
381 |
// Public interface to low-level non-VM calls |
|
382 |
||
383 |
CallInst* SharkBuilder::CreateGetFrameAddress() { |
|
384 |
return CreateCall(frame_address(), LLVMValue::jint_constant(0)); |
|
385 |
} |
|
386 |
||
387 |
CallInst* SharkBuilder::CreateMemset(Value* dst, |
|
388 |
Value* value, |
|
389 |
Value* len, |
|
390 |
Value* align) { |
|
391 |
return CreateCall5(memset(), dst, value, len, align, |
|
392 |
LLVMValue::jint_constant(0)); |
|
393 |
} |
|
394 |
||
395 |
CallInst* SharkBuilder::CreateUnimplemented(const char* file, int line) { |
|
396 |
return CreateCall2( |
|
397 |
unimplemented(), |
|
398 |
CreateIntToPtr( |
|
399 |
LLVMValue::intptr_constant((intptr_t) file), |
|
400 |
PointerType::getUnqual(SharkType::jbyte_type())), |
|
401 |
LLVMValue::jint_constant(line)); |
|
402 |
} |
|
403 |
||
404 |
CallInst* SharkBuilder::CreateShouldNotReachHere(const char* file, int line) { |
|
405 |
return CreateCall2( |
|
406 |
should_not_reach_here(), |
|
407 |
CreateIntToPtr( |
|
408 |
LLVMValue::intptr_constant((intptr_t) file), |
|
409 |
PointerType::getUnqual(SharkType::jbyte_type())), |
|
410 |
LLVMValue::jint_constant(line)); |
|
411 |
} |
|
412 |
||
413 |
#ifndef PRODUCT |
|
414 |
CallInst* SharkBuilder::CreateDump(Value* value) { |
|
415 |
const char *name; |
|
416 |
if (value->hasName()) |
|
417 |
// XXX this leaks, but it's only debug code |
|
25949 | 418 |
name = os::strdup(value->getName().str().c_str()); |
6187 | 419 |
else |
420 |
name = "unnamed_value"; |
|
421 |
||
422 |
if (isa<PointerType>(value->getType())) |
|
423 |
value = CreatePtrToInt(value, SharkType::intptr_type()); |
|
424 |
else if (value->getType()-> |
|
425 |
isIntegerTy() |
|
426 |
) |
|
427 |
value = CreateIntCast(value, SharkType::intptr_type(), false); |
|
428 |
else |
|
429 |
Unimplemented(); |
|
430 |
||
431 |
return CreateCall2( |
|
432 |
dump(), |
|
433 |
CreateIntToPtr( |
|
434 |
LLVMValue::intptr_constant((intptr_t) name), |
|
435 |
PointerType::getUnqual(SharkType::jbyte_type())), |
|
436 |
value); |
|
437 |
} |
|
438 |
#endif // PRODUCT |
|
439 |
||
440 |
// HotSpot memory barriers |
|
441 |
||
442 |
void SharkBuilder::CreateUpdateBarrierSet(BarrierSet* bs, Value* field) { |
|
443 |
if (bs->kind() != BarrierSet::CardTableModRef) |
|
444 |
Unimplemented(); |
|
445 |
||
446 |
CreateStore( |
|
31964 | 447 |
LLVMValue::jbyte_constant(CardTableModRefBS::dirty_card_val()), |
6187 | 448 |
CreateIntToPtr( |
449 |
CreateAdd( |
|
450 |
LLVMValue::intptr_constant( |
|
29325 | 451 |
(intptr_t) (barrier_set_cast<CardTableModRefBS>(bs)->byte_map_base)), |
6187 | 452 |
CreateLShr( |
453 |
CreatePtrToInt(field, SharkType::intptr_type()), |
|
454 |
LLVMValue::intptr_constant(CardTableModRefBS::card_shift))), |
|
455 |
PointerType::getUnqual(SharkType::jbyte_type()))); |
|
456 |
} |
|
457 |
||
458 |
// Helpers for accessing the code buffer |
|
459 |
||
460 |
Value* SharkBuilder::code_buffer_address(int offset) { |
|
461 |
return CreateAdd( |
|
462 |
code_buffer()->base_pc(), |
|
463 |
LLVMValue::intptr_constant(offset)); |
|
464 |
} |
|
465 |
||
466 |
Value* SharkBuilder::CreateInlineOop(jobject object, const char* name) { |
|
467 |
return CreateLoad( |
|
468 |
CreateIntToPtr( |
|
469 |
code_buffer_address(code_buffer()->inline_oop(object)), |
|
470 |
PointerType::getUnqual(SharkType::oop_type())), |
|
471 |
name); |
|
472 |
} |
|
473 |
||
14622 | 474 |
Value* SharkBuilder::CreateInlineMetadata(Metadata* metadata, llvm::PointerType* type, const char* name) { |
475 |
assert(metadata != NULL, "inlined metadata must not be NULL"); |
|
18439 | 476 |
assert(metadata->is_metaspace_object(), "sanity check"); |
14622 | 477 |
return CreateLoad( |
478 |
CreateIntToPtr( |
|
479 |
code_buffer_address(code_buffer()->inline_Metadata(metadata)), |
|
480 |
PointerType::getUnqual(type)), |
|
481 |
name); |
|
482 |
} |
|
483 |
||
6187 | 484 |
Value* SharkBuilder::CreateInlineData(void* data, |
485 |
size_t size, |
|
14622 | 486 |
Type* type, |
6187 | 487 |
const char* name) { |
488 |
return CreateIntToPtr( |
|
489 |
code_buffer_address(code_buffer()->inline_data(data, size)), |
|
490 |
type, |
|
491 |
name); |
|
492 |
} |
|
493 |
||
494 |
// Helpers for creating basic blocks. |
|
495 |
||
496 |
BasicBlock* SharkBuilder::GetBlockInsertionPoint() const { |
|
497 |
BasicBlock *cur = GetInsertBlock(); |
|
498 |
||
499 |
// BasicBlock::Create takes an insertBefore argument, so |
|
500 |
// we need to find the block _after_ the current block |
|
501 |
Function::iterator iter = cur->getParent()->begin(); |
|
502 |
Function::iterator end = cur->getParent()->end(); |
|
503 |
while (iter != end) { |
|
504 |
iter++; |
|
505 |
if (&*iter == cur) { |
|
506 |
iter++; |
|
507 |
break; |
|
508 |
} |
|
509 |
} |
|
510 |
||
511 |
if (iter == end) |
|
512 |
return NULL; |
|
513 |
else |
|
514 |
return iter; |
|
515 |
} |
|
516 |
||
517 |
BasicBlock* SharkBuilder::CreateBlock(BasicBlock* ip, const char* name) const { |
|
518 |
return BasicBlock::Create( |
|
519 |
SharkContext::current(), name, GetInsertBlock()->getParent(), ip); |
|
520 |
} |
|
14622 | 521 |
|
522 |
LoadInst* SharkBuilder::CreateAtomicLoad(Value* ptr, unsigned align, AtomicOrdering ordering, SynchronizationScope synchScope, bool isVolatile, const char* name) { |
|
523 |
return Insert(new LoadInst(ptr, name, isVolatile, align, ordering, synchScope), name); |
|
524 |
} |
|
525 |
||
526 |
StoreInst* SharkBuilder::CreateAtomicStore(Value* val, Value* ptr, unsigned align, AtomicOrdering ordering, SynchronizationScope synchScope, bool isVolatile, const char* name) { |
|
527 |
return Insert(new StoreInst(val, ptr, isVolatile, align, ordering, synchScope), name); |
|
528 |
} |