-
Notifications
You must be signed in to change notification settings - Fork 139
/
Copy pathMethod.cpp
687 lines (577 loc) · 40.4 KB
/
Method.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
/*******************************************************************************
* Copyright (c) 2000, 2018 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
* distribution and is available at http://eclipse.org/legal/epl-2.0
* or the Apache License, Version 2.0 which accompanies this distribution
* and is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License, v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception [1] and GNU General Public
* License, version 2 with the OpenJDK Assembly Exception [2].
*
* [1] https://www.gnu.org/software/classpath/license.html
* [2] http://openjdk.java.net/legal/assembly-exception.html
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/
#include "compile/Method.hpp"
#include <string.h> // for memchr
#include "compile/Compilation.hpp" // for Compilation
#include "compile/ResolvedMethod.hpp" // for TR_ResolvedMethod
#include "compile/SymbolReferenceTable.hpp" // for SymbolReferenceTable
#include "control/Options.hpp"
#include "control/Options_inlines.hpp"
#include "env/jittypes.h" // for intptrj_t, uintptrj_t
#include "il/SymbolReference.hpp" // for classNameToSignature
#include "il/symbol/ParameterSymbol.hpp" // for ParameterSymbol
#include "il/symbol/ResolvedMethodSymbol.hpp" // for ResolvedMethodSymbol
#include "infra/List.hpp" // for ListAppender
#include "runtime/Runtime.hpp" // for TR_RuntimeHelper
class TR_FrontEnd;
class TR_OpaqueMethodBlock;
class TR_PrexArgInfo;
namespace TR { class IlGeneratorMethodDetails; }
namespace TR { class LabelSymbol; }
bool TR_ResolvedMethod::isDAAMarshallingWrapperMethod()
{
#ifdef J9_PROJECT_SPECIFIC
if (getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeShort ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeShortLength ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeInt ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeIntLength ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeLong ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeLongLength ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeFloat ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeDouble ||
// ByteArray Unmarshalling methods
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readShort ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readShortLength ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readInt ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readIntLength ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readLong ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readLongLength ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readFloat ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readDouble)
{
return true;
}
return false;
#else
return false;
#endif
}
bool TR_ResolvedMethod::isDAAPackedDecimalWrapperMethod()
{
#ifdef J9_PROJECT_SPECIFIC
if (// Byte array utility methods
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUtils_trailingZeros ||
// DAA Packed Decimal arithmetic methods
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_addPackedDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_subtractPackedDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_multiplyPackedDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_dividePackedDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_remainderPackedDecimal ||
// DAA Packed Decimal comparison methods
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_lessThanPackedDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_lessThanOrEqualsPackedDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_greaterThanPackedDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_greaterThanOrEqualsPackedDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_equalsPackedDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_notEqualsPackedDecimal ||
// DAA Packed Decimal shift methods
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_shiftLeftPackedDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_shiftRightPackedDecimal ||
// DAA Packed Decimal check methods
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_checkPackedDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_checkPackedDecimal_2bInlined1 ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_checkPackedDecimal_2bInlined2 ||
// DAA Packed Decimal move method
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_movePackedDecimal ||
// DAA Packed Decimal <-> Integer
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertPackedDecimalToInteger ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertPackedDecimalToInteger_ByteBuffer ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertIntegerToPackedDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertIntegerToPackedDecimal_ByteBuffer ||
// DAA Packed Decimal <-> Long
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertPackedDecimalToLong ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertPackedDecimalToLong_ByteBuffer ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertLongToPackedDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertLongToPackedDecimal_ByteBuffer ||
// DAA External Decimal <-> Integer
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertExternalDecimalToInteger ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertIntegerToExternalDecimal ||
// DAA External Decimal <-> Long
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertExternalDecimalToLong ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertLongToExternalDecimal ||
// DAA Packed Decimal <-> External Decimal
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertPackedDecimalToExternalDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertExternalDecimalToPackedDecimal ||
// DAA Packed Decimal <-> Unicode Decimal
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertPackedDecimalToUnicodeDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertUnicodeDecimalToPackedDecimal ||
// DAA Packed Decimal <-> BigInteger
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertPackedDecimalToBigInteger ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertBigIntegerToPackedDecimal ||
// DAA Packed Decimal <-> BigDecimal
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertPackedDecimalToBigDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertBigDecimalToPackedDecimal ||
// DAA External Decimal <-> BigInteger
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertExternalDecimalToBigInteger ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertBigIntegerToExternalDecimal ||
// DAA External Decimal <-> BigDecimal
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertExternalDecimalToBigDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertBigDecimalToExternalDecimal ||
// DAA Unicode Decimal <-> Integer
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertUnicodeDecimalToInteger ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertIntegerToUnicodeDecimal ||
// DAA Unicode Decimal <-> Long
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertUnicodeDecimalToLong ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertLongToUnicodeDecimal ||
// DAA Unicode Decimal <-> BigInteger
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertUnicodeDecimalToBigInteger ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertBigIntegerToUnicodeDecimal ||
// DAA Unicode Decimal <-> BigDecimal
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertUnicodeDecimalToBigDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertBigDecimalToUnicodeDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_slowSignedPackedToBigDecimal ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_slowBigDecimalToSignedPacked)
{
return true;
}
return false;
#else
return false;
#endif
}
bool TR_ResolvedMethod::isDAAWrapperMethod()
{
#ifdef J9_PROJECT_SPECIFIC
return isDAAMarshallingWrapperMethod() || isDAAPackedDecimalWrapperMethod();
#else
return false;
#endif
}
bool TR_ResolvedMethod::isDAAMarshallingIntrinsicMethod()
{
#ifdef J9_PROJECT_SPECIFIC
if (getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeShort_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeShortLength_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeInt_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeIntLength_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeLong_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeLongLength_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeFloat_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayMarshaller_writeDouble_ ||
// ByteArray Unmarshalling methods
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readShort_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readShortLength_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readInt_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readIntLength_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readLong_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readLongLength_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readFloat_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUnmarshaller_readDouble_)
{
return true;
}
return false;
#else
return false;
#endif
}
bool TR_ResolvedMethod::isDAAPackedDecimalIntrinsicMethod()
{
#ifdef J9_PROJECT_SPECIFIC
if (// Byte array utility methods
getRecognizedMethod() == TR::com_ibm_dataaccess_ByteArrayUtils_trailingZerosQuadWordAtATime_ ||
// DAA Packed Decimal arithmetic methods
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_addPackedDecimal_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_subtractPackedDecimal_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_multiplyPackedDecimal_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_dividePackedDecimal_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_remainderPackedDecimal_ ||
// DAA Packed Decimal comparison methods
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_lessThanPackedDecimal_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_lessThanOrEqualsPackedDecimal_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_greaterThanPackedDecimal_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_greaterThanOrEqualsPackedDecimal_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_equalsPackedDecimal_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_notEqualsPackedDecimal_ ||
// DAA Packed Decimal shift methods
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_shiftLeftPackedDecimal_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_shiftRightPackedDecimal_ ||
// DAA Packed Decimal check method
getRecognizedMethod() == TR::com_ibm_dataaccess_PackedDecimal_checkPackedDecimal_ ||
// DAA Packed Decimal <-> Integer
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertPackedDecimalToInteger_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertPackedDecimalToInteger_ByteBuffer_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertIntegerToPackedDecimal_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertIntegerToPackedDecimal_ByteBuffer_ ||
// DAA Packed Decimal <-> Long
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertPackedDecimalToLong_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertPackedDecimalToLong_ByteBuffer_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertLongToPackedDecimal_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertLongToPackedDecimal_ByteBuffer_ ||
// DAA Packed Decimal <-> External Decimal
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertExternalDecimalToPackedDecimal_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertPackedDecimalToExternalDecimal_ ||
// DAA Packed Decimal <-> Unicode Decimal
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertPackedDecimalToUnicodeDecimal_ ||
getRecognizedMethod() == TR::com_ibm_dataaccess_DecimalData_convertUnicodeDecimalToPackedDecimal_)
{
return true;
}
return false;
#else
return false;
#endif
}
bool TR_ResolvedMethod::isDAAIntrinsicMethod()
{
#ifdef J9_PROJECT_SPECIFIC
return isDAAMarshallingIntrinsicMethod() || isDAAPackedDecimalIntrinsicMethod();
#else
return false;
#endif
}
#define notImplemented(A) TR_ASSERT(0, "TR_Method::%s is undefined", (A) )
uint32_t TR_Method::numberOfExplicitParameters() { notImplemented("numberOfExplicitParameters"); return 0; }
TR::DataType TR_Method::parmType(uint32_t) { notImplemented("parmType"); return TR::NoType; }
TR::ILOpCodes TR_Method::directCallOpCode() { notImplemented("directCallOpCode"); return TR::BadILOp; }
TR::ILOpCodes TR_Method::indirectCallOpCode() { notImplemented("indirectCallOpCode"); return TR::BadILOp; }
TR::DataType TR_Method::returnType() { notImplemented("returnType"); return TR::NoType; }
bool TR_Method::returnTypeIsUnsigned() { notImplemented("returnTypeIsUnsigned"); return TR::NoType;}
uint32_t TR_Method::returnTypeWidth() { notImplemented("returnTypeWidth"); return 0; }
TR::ILOpCodes TR_Method::returnOpCode() { notImplemented("returnOpCode"); return TR::BadILOp; }
uint16_t TR_Method::classNameLength() { notImplemented("classNameLength"); return 0; }
uint16_t TR_Method::nameLength() { notImplemented("nameLength"); return 0; }
uint16_t TR_Method::signatureLength() { notImplemented("signatureLength"); return 0; }
char * TR_Method::classNameChars() { notImplemented("classNameChars"); return 0; }
char * TR_Method::nameChars() { notImplemented("nameChars"); return 0; }
char * TR_Method::signatureChars() { notImplemented("signatureChars"); return 0; }
bool TR_Method::isConstructor() { notImplemented("isConstructor"); return false; }
bool TR_Method::isFinalInObject() { notImplemented("isFinalInObject"); return false; }
const char * TR_Method::signature(TR_Memory *, TR_AllocationKind) { notImplemented("signature"); return 0; }
void TR_Method::setArchetypeSpecimen(bool b) { notImplemented("setArchetypeSpecimen"); }
TR_MethodParameterIterator *
TR_Method::getParameterIterator(TR::Compilation&, TR_ResolvedMethod *)
{
notImplemented("getParameterIterator");
return 0;
}
bool
TR_Method::isBigDecimalMethod(TR::Compilation * comp)
{
notImplemented("isBigDecimalMethod");
return false;
}
bool
TR_Method::isUnsafeCAS(TR::Compilation * comp)
{
notImplemented("isUnsafeCAS");
return false;
}
bool
TR_Method::isUnsafeWithObjectArg(TR::Compilation * comp)
{
notImplemented("isUnsafeWithObjectArg");
return false;
}
bool
TR_Method::isBigDecimalConvertersMethod(TR::Compilation * comp)
{
notImplemented("isBigDecimalConvertersMethod");
return false;
}
#undef notImplemented
#define notImplemented(A) TR_ASSERT(0, "TR_ResolvedMethod::%s is undefined for %p", (A), this )
TR_Method * TR_ResolvedMethod::convertToMethod() { notImplemented("convertToMethod"); return 0; }
uint32_t TR_ResolvedMethod::numberOfParameters() { notImplemented("numberOfParameters"); return 0; }
uint32_t TR_ResolvedMethod::numberOfExplicitParameters() { notImplemented("numberOfExplicitParameters"); return 0; }
TR::DataType TR_ResolvedMethod::parmType(uint32_t) { notImplemented("parmType"); return TR::NoType; }
TR::ILOpCodes TR_ResolvedMethod::directCallOpCode() { notImplemented("directCallOpCode"); return TR::BadILOp; }
TR::ILOpCodes TR_ResolvedMethod::indirectCallOpCode() { notImplemented("indirectCallOpCode"); return TR::BadILOp; }
TR::DataType TR_ResolvedMethod::returnType() { notImplemented("returnType"); return TR::NoType; }
uint32_t TR_ResolvedMethod::returnTypeWidth() { notImplemented("returnTypeWidth"); return 0; }
bool TR_ResolvedMethod::returnTypeIsUnsigned() { notImplemented("returnTypeIsUnsigned"); return 0; }
TR::ILOpCodes TR_ResolvedMethod::returnOpCode() { notImplemented("returnOpCode"); return TR::BadILOp; }
uint16_t TR_ResolvedMethod::classNameLength() { notImplemented("classNameLength"); return 0; }
uint16_t TR_ResolvedMethod::nameLength() { notImplemented("nameLength"); return 0; }
uint16_t TR_ResolvedMethod::signatureLength() { notImplemented("signatureLength"); return 0; }
char * TR_ResolvedMethod::classNameChars() { notImplemented("classNameChars"); return 0; }
char * TR_ResolvedMethod::nameChars() { notImplemented("nameChars"); return 0; }
char * TR_ResolvedMethod::signatureChars() { notImplemented("signatureChars"); return 0; }
bool TR_ResolvedMethod::isConstructor() { notImplemented("isConstructor"); return false; }
bool TR_ResolvedMethod::isStatic() { notImplemented("isStatic"); return false; }
bool TR_ResolvedMethod::isAbstract() { notImplemented("isAbstract"); return false; }
bool TR_ResolvedMethod::isCompilable(TR_Memory *) { notImplemented("isCompilable"); return false; }
bool TR_ResolvedMethod::isInlineable(TR::Compilation *) { notImplemented("isInlineable"); return false; }
bool TR_ResolvedMethod::isNative() { notImplemented("isNative"); return false; }
bool TR_ResolvedMethod::isSynchronized() { notImplemented("isSynchronized"); return false; }
bool TR_ResolvedMethod::isPrivate() { notImplemented("isPrivate"); return false; }
bool TR_ResolvedMethod::isProtected() { notImplemented("isProtected"); return false; }
bool TR_ResolvedMethod::isPublic() { notImplemented("isPublic"); return false; }
bool TR_ResolvedMethod::isFinal() { notImplemented("isFinal"); return false; }
bool TR_ResolvedMethod::isStrictFP() { notImplemented("isStrictFP"); return false; }
bool TR_ResolvedMethod::isInterpreted() { notImplemented("isInterpreted"); return false; }
bool TR_ResolvedMethod::isInterpretedForHeuristics() { notImplemented("isInterpretedForHeuristics"); return false; }
bool TR_ResolvedMethod::hasBackwardBranches() { notImplemented("hasBackwardBranches"); return false; }
bool TR_ResolvedMethod::isObjectConstructor() { notImplemented("isObjectConstructor"); return false; }
bool TR_ResolvedMethod::isNonEmptyObjectConstructor() { notImplemented("isNonEmptyObjectConstructor"); return false; }
bool TR_ResolvedMethod::isCold(TR::Compilation *, bool, TR::ResolvedMethodSymbol * /* = NULL */) { notImplemented("isCold"); return false; }
bool TR_ResolvedMethod::isSubjectToPhaseChange(TR::Compilation *) { notImplemented("isSubjectToPhaseChange"); return false; }
bool TR_ResolvedMethod::isSameMethod(TR_ResolvedMethod *) { notImplemented("isSameMethod"); return false; }
bool TR_ResolvedMethod::isNewInstanceImplThunk() { notImplemented("isNewInstanceImplThunk"); return false; }
bool TR_ResolvedMethod::isJNINative() { notImplemented("isJNINative"); return false; }
bool TR_ResolvedMethod::isJITInternalNative() { notImplemented("isJITInternalNative"); return false; }
//bool TR_ResolvedMethod::isUnsafeWithObjectArg(TR::Compilation *) { notImplemented("isUnsafeWithObjectArg"); return false; }
void * TR_ResolvedMethod::resolvedMethodAddress() { notImplemented("resolvedMethodAddress"); return 0; }
void * TR_ResolvedMethod::startAddressForJittedMethod() { notImplemented("startAddressForJittedMethod"); return 0; }
void * TR_ResolvedMethod::startAddressForJNIMethod(TR::Compilation *) { notImplemented("startAddressForJNIMethod"); return 0; }
void * TR_ResolvedMethod::startAddressForJITInternalNativeMethod() { notImplemented("startAddressForJITInternalNativeMethod"); return 0; }
void * TR_ResolvedMethod::startAddressForInterpreterOfJittedMethod() { notImplemented("startAddressForInterpreterOfJittedMethod"); return 0; }
bool TR_ResolvedMethod::isWarmCallGraphTooBig(uint32_t bcIndex, TR::Compilation *) { notImplemented("isWarmCallGraphTooBig"); return 0; }
void TR_ResolvedMethod::setWarmCallGraphTooBig(uint32_t bcIndex, TR::Compilation *){ notImplemented("setWarmCallGraphTooBig"); return; }
TR_FrontEnd *TR_ResolvedMethod::fe() { notImplemented("fe"); return 0; }
intptrj_t TR_ResolvedMethod::getInvocationCount() { notImplemented("getInvocationCount"); return 0; }
bool TR_ResolvedMethod::setInvocationCount(intptrj_t, intptrj_t) { notImplemented("setInvocationCount"); return false; }
uint16_t TR_ResolvedMethod::numberOfParameterSlots() { notImplemented("numberOfParameterSlots"); return 0; }
uint16_t TR_ResolvedMethod::archetypeArgPlaceholderSlot(TR_Memory *) { notImplemented("numberOfParameterSlots"); return 0; }
uint16_t TR_ResolvedMethod::numberOfTemps() { notImplemented("numberOfTemps"); return 0; }
uint16_t TR_ResolvedMethod::numberOfPendingPushes() { notImplemented("numberOfPendingPushes"); return 0; }
uint8_t * TR_ResolvedMethod::bytecodeStart() { notImplemented("bytecodeStart"); return 0; }
uint32_t TR_ResolvedMethod::maxBytecodeIndex() { notImplemented("maxBytecodeIndex"); return 0; }
void * TR_ResolvedMethod::ramConstantPool() { notImplemented("ramConstantPool"); return 0; }
void * TR_ResolvedMethod::constantPool() { notImplemented("constantPool"); return 0; }
TR::DataType TR_ResolvedMethod::getLDCType(int32_t) { notImplemented("getLDCType"); return TR::NoType; }
bool TR_ResolvedMethod::isClassConstant(int32_t cpIndex) { notImplemented("isClassConstant"); return false; }
bool TR_ResolvedMethod::isStringConstant(int32_t cpIndex) { notImplemented("isStringConstant"); return false; }
bool TR_ResolvedMethod::isMethodTypeConstant(int32_t cpIndex) { notImplemented("isMethodTypeConstant"); return false; }
bool TR_ResolvedMethod::isMethodHandleConstant(int32_t cpIndex) { notImplemented("isMethodHandleConstant"); return false; }
uint32_t TR_ResolvedMethod::intConstant(int32_t) { notImplemented("intConstant"); return 0; }
uint64_t TR_ResolvedMethod::longConstant(int32_t) { notImplemented("longConstant"); return 0; }
float * TR_ResolvedMethod::floatConstant(int32_t) { notImplemented("floatConstant"); return 0; }
double * TR_ResolvedMethod::doubleConstant(int32_t, TR_Memory *) { notImplemented("doubleConstant"); return 0; }
void * TR_ResolvedMethod::stringConstant(int32_t) { notImplemented("stringConstant"); return 0; }
bool TR_ResolvedMethod::isUnresolvedString(int32_t, bool optimizeForAOT) { notImplemented("isUnresolvedString"); return false; }
void * TR_ResolvedMethod::getConstantDynamicTypeFromCP(int32_t cpIndex) { notImplemented("ConstantDynamic"); return 0; }
bool TR_ResolvedMethod::isConstantDynamic(int32_t cpIndex) { notImplemented("ConstantDynamic"); return false; }
bool TR_ResolvedMethod::isUnresolvedConstantDynamic(int32_t cpIndex) { notImplemented("ConstantDynamic"); return false; }
void * TR_ResolvedMethod::dynamicConstant(int32_t cpIndex) { notImplemented("ConstantDynamic"); return 0; }
void * TR_ResolvedMethod::methodTypeConstant(int32_t) { notImplemented("methodTypeConstant"); return 0; }
bool TR_ResolvedMethod::isUnresolvedMethodType(int32_t) { notImplemented("isUnresolvedMethodType"); return false; }
void * TR_ResolvedMethod::methodHandleConstant(int32_t) { notImplemented("methodHandleConstant"); return 0; }
bool TR_ResolvedMethod::isUnresolvedMethodHandle(int32_t) { notImplemented("isUnresolvedMethodHandle"); return false; }
bool TR_ResolvedMethod::isUnresolvedCallSiteTableEntry(int32_t callSiteIndex) { notImplemented("isUnresolvedCallSiteTableEntry"); return false; }
void * TR_ResolvedMethod::callSiteTableEntryAddress(int32_t callSiteIndex) { notImplemented("callSiteTableEntryAddress"); return 0; }
bool TR_ResolvedMethod::isUnresolvedMethodTypeTableEntry(int32_t cpIndex) { notImplemented("isUnresolvedMethodTypeTableEntry"); return false; }
void * TR_ResolvedMethod::methodTypeTableEntryAddress(int32_t cpIndex) { notImplemented("methodTypeTableEntryAddress"); return 0; }
TR_OpaqueClassBlock *TR_ResolvedMethod::getDeclaringClassFromFieldOrStatic(TR::Compilation *comp, int32_t cpIndex) { notImplemented("getDeclaringClassFromFieldOrStatic"); return 0; }
int32_t TR_ResolvedMethod::classCPIndexOfFieldOrStatic(int32_t) { notImplemented("classCPIndexOfFieldOrStatic"); return 0; }
const char * TR_ResolvedMethod::signature(TR_Memory *, TR_AllocationKind) { notImplemented("signature"); return 0; }
const char * TR_ResolvedMethod::externalName(TR_Memory *, TR_AllocationKind) { notImplemented("signature"); return 0; }
char * TR_ResolvedMethod::fieldName (int32_t, TR_Memory *, TR_AllocationKind kind) { notImplemented("fieldName"); return 0; }
char * TR_ResolvedMethod::staticName(int32_t, TR_Memory *, TR_AllocationKind kind) { notImplemented("staticName"); return 0; }
char * TR_ResolvedMethod::localName (uint32_t, uint32_t, TR_Memory *){ /*notImplemented("localName");*/ return 0; }
char * TR_ResolvedMethod::fieldName (int32_t, int32_t &, TR_Memory *, TR_AllocationKind kind){ notImplemented("fieldName"); return 0; }
char * TR_ResolvedMethod::staticName(int32_t, int32_t &, TR_Memory *, TR_AllocationKind kind){ notImplemented("staticName"); return 0; }
char * TR_ResolvedMethod::localName (uint32_t, uint32_t, int32_t&, TR_Memory *){ /*notImplemented("localName");*/ return 0; }
char * TR_ResolvedMethod::fieldNameChars(int32_t, int32_t &) { notImplemented("fieldNameChars"); return 0; }
char * TR_ResolvedMethod::fieldSignatureChars(int32_t, int32_t &) { notImplemented("fieldSignatureChars"); return 0; }
char * TR_ResolvedMethod::staticSignatureChars(int32_t, int32_t &) { notImplemented("staticSignatureChars"); return 0; }
void * & TR_ResolvedMethod::addressOfClassOfMethod() { notImplemented("addressOfClassOfMethod"); return *(void **)0; }
uint32_t TR_ResolvedMethod::vTableSlot(uint32_t) { notImplemented("vTableSlot"); return 0; }
bool TR_ResolvedMethod::virtualMethodIsOverridden() { notImplemented("virtualMethodIsOverridden"); return false; }
void TR_ResolvedMethod::setVirtualMethodIsOverridden() { notImplemented("setVirtualMethodIsOverridden"); }
void * TR_ResolvedMethod::addressContainingIsOverriddenBit() { notImplemented("addressContainingIsOverriddenBit"); return 0; }
int32_t TR_ResolvedMethod::virtualCallSelector(uint32_t) { notImplemented("virtualCallSelector"); return 0; }
uint32_t TR_ResolvedMethod::numberOfExceptionHandlers() { notImplemented("numberOfExceptionHandlers"); return 0; }
uint8_t * TR_ResolvedMethod::allocateException(uint32_t,TR::Compilation*){ notImplemented("allocateException"); return 0; }
int32_t TR_ResolvedMethod::exceptionData(int32_t, int32_t *, int32_t *, int32_t *) { notImplemented("exceptionData"); return 0; }
char * TR_ResolvedMethod::getClassNameFromConstantPool(uint32_t, uint32_t &) { notImplemented("getClassNameFromConstantPool"); return 0; }
bool TR_ResolvedMethod::fieldsAreSame(int32_t, TR_ResolvedMethod *, int32_t, bool &sigSame) { notImplemented("fieldsAreSame"); return false; }
bool TR_ResolvedMethod::staticsAreSame(int32_t, TR_ResolvedMethod *, int32_t, bool &sigSame) { notImplemented("staticsAreSame"); return false; }
char * TR_ResolvedMethod::classNameOfFieldOrStatic(int32_t, int32_t &) { notImplemented("classNameOfFieldOrStatic"); return 0; }
char * TR_ResolvedMethod::classSignatureOfFieldOrStatic(int32_t, int32_t &) { notImplemented("classSignatureOfFieldOrStatic"); return 0; }
char * TR_ResolvedMethod::staticNameChars(int32_t, int32_t &) { notImplemented("staticNameChars"); return 0; }
const char * TR_ResolvedMethod::newInstancePrototypeSignature(TR_Memory *, TR_AllocationKind) { notImplemented("newInstancePrototypeSignature"); return 0; }
bool
TR_ResolvedMethod::getUnresolvedFieldInCP(int32_t)
{
notImplemented("getUnresolvedFieldInCP");
return false;
}
bool
TR_ResolvedMethod::getUnresolvedStaticMethodInCP(int32_t)
{
notImplemented("getUnresolvedStaticMethodInCP");
return false;
}
bool
TR_ResolvedMethod::getUnresolvedSpecialMethodInCP(int32_t)
{
notImplemented("getUnresolvedSpecialMethodInCP");
return false;
}
bool
TR_ResolvedMethod::getUnresolvedVirtualMethodInCP(int32_t)
{
notImplemented("getUnresolvedVirtualMethod");
return false;
}
bool
TR_ResolvedMethod::fieldAttributes(TR::Compilation *, int32_t, uint32_t *, TR::DataType *, bool *, bool *, bool *, bool, bool *, bool)
{
notImplemented("fieldAttributes");
return false;
}
bool
TR_ResolvedMethod::staticAttributes(TR::Compilation *, int32_t, void * *, TR::DataType *, bool *, bool *, bool *, bool, bool *, bool)
{
notImplemented("staticAttributes");
return false;
}
TR_OpaqueClassBlock * TR_ResolvedMethod::containingClass() { notImplemented("containingClass"); return 0; }
TR_OpaqueClassBlock * TR_ResolvedMethod::getClassFromConstantPool(TR::Compilation *, uint32_t, bool) { notImplemented("getClassFromConstantPool"); return 0; }
TR_OpaqueClassBlock * TR_ResolvedMethod::classOfStatic(int32_t, bool) { notImplemented("classOfStatic"); return 0; }
TR_OpaqueClassBlock * TR_ResolvedMethod::classOfMethod() { notImplemented("classOfMethod"); return 0; }
uint32_t TR_ResolvedMethod::classCPIndexOfMethod(uint32_t) { notImplemented("classCpIndexOfMethod"); return 0; }
TR_OpaqueMethodBlock *TR_ResolvedMethod::getNonPersistentIdentifier() { notImplemented("getNonPersistentIdentifier"); return 0; }
TR_OpaqueMethodBlock *TR_ResolvedMethod::getPersistentIdentifier() { notImplemented("getPersistentIdentifier"); return 0; }
TR_OpaqueClassBlock * TR_ResolvedMethod::getResolvedInterfaceMethod(int32_t, uintptrj_t *) { notImplemented("getResolvedInterfaceMethod"); return 0; }
TR_ResolvedMethod * TR_ResolvedMethod::owningMethod() { notImplemented("owningMethod"); return 0; }
void TR_ResolvedMethod::setOwningMethod(TR_ResolvedMethod*) { notImplemented("setOwningMethod"); }
TR_ResolvedMethod * TR_ResolvedMethod::getResolvedStaticMethod (TR::Compilation *, int32_t, bool *) { notImplemented("getResolvedStaticMethod"); return 0; }
TR_ResolvedMethod * TR_ResolvedMethod::getResolvedSpecialMethod(TR::Compilation *, int32_t, bool *) { notImplemented("getResolvedSpecialMethod"); return 0; }
TR_ResolvedMethod * TR_ResolvedMethod::getResolvedVirtualMethod(TR::Compilation *, int32_t, bool, bool *) { notImplemented("getResolvedVirtualMethod"); return 0; }
TR_ResolvedMethod * TR_ResolvedMethod::getResolvedDynamicMethod(TR::Compilation *, int32_t, bool *) { notImplemented("getResolvedDynamicMethod"); return 0; }
TR_ResolvedMethod * TR_ResolvedMethod::getResolvedHandleMethod (TR::Compilation *, int32_t, bool *) { notImplemented("getResolvedHandleMethod"); return 0; }
TR_ResolvedMethod * TR_ResolvedMethod::getResolvedHandleMethodWithSignature(TR::Compilation *, int32_t, char *){notImplemented("getResolvedHandleMethodWithSignature"); return 0; }
uint32_t
TR_ResolvedMethod::getResolvedInterfaceMethodOffset(TR_OpaqueClassBlock *, int32_t)
{
notImplemented("getResolvedInterfaceMethodOffset");
return 0;
}
TR_ResolvedMethod *
TR_ResolvedMethod::getResolvedInterfaceMethod(TR::Compilation *, TR_OpaqueClassBlock *, int32_t)
{
notImplemented("getResolvedInterfaceMethod");
return 0;
}
TR_ResolvedMethod *
TR_ResolvedMethod::getResolvedVirtualMethod(TR::Compilation *, TR_OpaqueClassBlock *, int32_t, bool)
{
notImplemented("getResolvedVirtualMethod");
return 0;
}
void
TR_ResolvedMethod::setMethodHandleLocation(uintptrj_t *location)
{
notImplemented("setMethodHandleLocation");
}
TR::IlGeneratorMethodDetails *
TR_ResolvedMethod::getIlGeneratorMethodDetails()
{
notImplemented("getIlGeneratorMethodDetails");
return 0;
}
TR::SymbolReferenceTable *
TR_ResolvedMethod::_genMethodILForPeeking(TR::ResolvedMethodSymbol *, TR::Compilation *, bool resetVisitCount, TR_PrexArgInfo *argInfo)
{
notImplemented("genMethodILForPeeking");
return 0;
}
TR::ResolvedMethodSymbol* TR_ResolvedMethod::findOrCreateJittedMethodSymbol(TR::Compilation *comp)
{
return comp->createJittedMethodSymbol(this);
}
// This version is suitable for Java
void TR_ResolvedMethod::makeParameterList(TR::ResolvedMethodSymbol *methodSym)
{
if (methodSym->getTempIndex() != -1)
return;
const char *className = classNameChars();
const int classNameLen = classNameLength();
const char *sig = signatureChars();
const int sigLen = signatureLength();
const char *sigEnd = sig + sigLen;
ListAppender<TR::ParameterSymbol> la(&methodSym->getParameterList());
TR::ParameterSymbol *parmSymbol;
int32_t slot;
int32_t ordinal = 0;
if (methodSym->isStatic())
{
slot = 0;
}
else
{
parmSymbol = methodSym->comp()->getSymRefTab()->createParameterSymbol(methodSym, 0, TR::Address);
parmSymbol->setOrdinal(ordinal++);
int32_t len = classNameLen; // len is passed by reference and changes during the call
char * s = classNameToSignature(className, len, methodSym->comp(), heapAlloc);
la.add(parmSymbol);
parmSymbol->setTypeSignature(s, len);
slot = 1;
}
const char *s = sig;
TR_ASSERT(*s == '(', "Bad signature for method: <%s>", s);
++s;
uint32_t parmSlots = numberOfParameterSlots();
for (int32_t parmIndex = 0; slot < parmSlots; ++parmIndex)
{
TR::DataType type = parmType(parmIndex);
int32_t size = methodSym->convertTypeToSize(type);
if (size < 4) type = TR::Int32;
const char *end = s;
// Walk past array dims, if any
while (*end == '[')
{
++end;
}
// Walk to the end of the class name, if this is a class name
if (*end == 'L')
{
// Assume the form is L<classname>; where <classname> is
// at least 1 char and therefore skip the first 2 chars
end += 2;
end = (char *)memchr(end, ';', sigEnd - end);
TR_ASSERT(end != NULL, "Unexpected NULL, expecting to find a parm of the form L<classname>;");
}
// The static_cast<int>(...) is added as a work around for an XLC bug that results in the
// pointer subtraction below getting converted into a 32-bit signed integer subtraction
int len = static_cast<int>(end - s) + 1;
parmSymbol = methodSym->comp()->getSymRefTab()->createParameterSymbol(methodSym, slot, type);
parmSymbol->setOrdinal(ordinal++);
parmSymbol->setTypeSignature(s, len);
s += len;
la.add(parmSymbol);
if (type == TR::Int64 || type == TR::Double)
{
slot += 2;
}
else
{
++slot;
}
}
int32_t lastInterpreterSlot = parmSlots + numberOfTemps();
if ((methodSym->isSynchronised() || methodSym->getResolvedMethod()->isNonEmptyObjectConstructor()) &&
methodSym->comp()->getOption(TR_MimicInterpreterFrameShape))
{
++lastInterpreterSlot;
}
methodSym->setTempIndex(lastInterpreterSlot, methodSym->comp()->fe());
methodSym->setFirstJitTempIndex(methodSym->getTempIndex());
}
TR::SymbolReferenceTable*
TR_ResolvedMethod::genMethodILForPeeking(TR::ResolvedMethodSymbol *methodSymbol, TR::Compilation *comp, bool resetVisitCount, TR_PrexArgInfo *argInfo)
{
if (comp->getOption(TR_EnableHCR))
return NULL;
return _genMethodILForPeeking(methodSymbol, comp, resetVisitCount, argInfo);
}