@@ -115,13 +115,6 @@ bool ClassListParser::parse_one_line() {
115
115
_line_len = len;
116
116
}
117
117
118
- // Check if the line is output TRACE_RESOLVE
119
- if (strncmp (_line, LambdaFormInvokers::lambda_form_invoker_tag (),
120
- strlen (LambdaFormInvokers::lambda_form_invoker_tag ())) == 0 ) {
121
- LambdaFormInvokers::append (os::strdup ((const char *)_line, mtInternal));
122
- continue ;
123
- }
124
-
125
118
// valid line
126
119
break ;
127
120
}
@@ -133,6 +126,7 @@ bool ClassListParser::parse_one_line() {
133
126
_source = NULL ;
134
127
_interfaces_specified = false ;
135
128
_indy_items->clear ();
129
+ _lambda_form_line = false ;
136
130
137
131
if (_line[0 ] == ' @' ) {
138
132
return parse_at_tags ();
@@ -185,8 +179,8 @@ bool ClassListParser::parse_one_line() {
185
179
return true ;
186
180
}
187
181
188
- void ClassListParser::split_tokens_by_whitespace () {
189
- int start = 0 ;
182
+ void ClassListParser::split_tokens_by_whitespace (int offset ) {
183
+ int start = offset ;
190
184
int end;
191
185
bool done = false ;
192
186
while (!done) {
@@ -203,19 +197,40 @@ void ClassListParser::split_tokens_by_whitespace() {
203
197
}
204
198
}
205
199
200
+ int ClassListParser::split_at_tag_from_line () {
201
+ _token = _line;
202
+ char * ptr;
203
+ if ((ptr = strchr (_line, ' ' )) == NULL ) {
204
+ error (" Too few items following the @ tag \" %s\" line #%d" , _line, _line_no);
205
+ return 0 ;
206
+ }
207
+ *ptr++ = ' \0 ' ;
208
+ while (*ptr == ' ' || *ptr == ' \t ' ) ptr++;
209
+ return (int )(ptr - _line);
210
+ }
211
+
206
212
bool ClassListParser::parse_at_tags () {
207
213
assert (_line[0 ] == ' @' , " must be" );
208
- split_tokens_by_whitespace ();
209
- if (strcmp (_indy_items->at (0 ), LAMBDA_PROXY_TAG) == 0 ) {
210
- if (_indy_items->length () < 3 ) {
211
- error (" Line with @ tag has too few items \" %s\" line #%d" , _line, _line_no);
214
+ int offset;
215
+ if ((offset = split_at_tag_from_line ()) == 0 ) {
216
+ return false ;
217
+ }
218
+
219
+ if (strcmp (_token, LAMBDA_PROXY_TAG) == 0 ) {
220
+ split_tokens_by_whitespace (offset);
221
+ if (_indy_items->length () < 2 ) {
222
+ error (" Line with @ tag has too few items \" %s\" line #%d" , _token, _line_no);
212
223
return false ;
213
224
}
214
225
// set the class name
215
- _class_name = _indy_items->at (1 );
226
+ _class_name = _indy_items->at (0 );
227
+ return true ;
228
+ } else if (strcmp (_token, LAMBDA_FORM_TAG) == 0 ) {
229
+ LambdaFormInvokers::append (os::strdup ((const char *)(_line + offset), mtInternal));
230
+ _lambda_form_line = true ;
216
231
return true ;
217
232
} else {
218
- error (" Invalid @ tag at the beginning of line \" %s\" line #%d" , _line , _line_no);
233
+ error (" Invalid @ tag at the beginning of line \" %s\" line #%d" , _token , _line_no);
219
234
return false ;
220
235
}
221
236
}
@@ -432,7 +447,7 @@ bool ClassListParser::is_matching_cp_entry(constantPoolHandle &pool, int cp_inde
432
447
CDSIndyInfo cii;
433
448
populate_cds_indy_info (pool, cp_index, &cii, THREAD);
434
449
GrowableArray<const char *>* items = cii.items ();
435
- int indy_info_offset = 2 ;
450
+ int indy_info_offset = 1 ;
436
451
if (_indy_items->length () - indy_info_offset != items->length ()) {
437
452
return false ;
438
453
}
0 commit comments