390 |
390 |
391 return new (loader_data, size, false, THREAD) MethodData(method(), size, CHECK_NULL); |
391 return new (loader_data, size, false, THREAD) MethodData(method(), size, CHECK_NULL); |
392 } |
392 } |
393 |
393 |
394 int MethodData::bytecode_cell_count(Bytecodes::Code code) { |
394 int MethodData::bytecode_cell_count(Bytecodes::Code code) { |
|
395 #if defined(COMPILER1) && !defined(COMPILER2) |
|
396 return no_profile_data; |
|
397 #else |
395 switch (code) { |
398 switch (code) { |
396 case Bytecodes::_checkcast: |
399 case Bytecodes::_checkcast: |
397 case Bytecodes::_instanceof: |
400 case Bytecodes::_instanceof: |
398 case Bytecodes::_aastore: |
401 case Bytecodes::_aastore: |
399 if (TypeProfileCasts) { |
402 if (TypeProfileCasts) { |
436 case Bytecodes::_lookupswitch: |
439 case Bytecodes::_lookupswitch: |
437 case Bytecodes::_tableswitch: |
440 case Bytecodes::_tableswitch: |
438 return variable_cell_count; |
441 return variable_cell_count; |
439 } |
442 } |
440 return no_profile_data; |
443 return no_profile_data; |
|
444 #endif |
441 } |
445 } |
442 |
446 |
443 // Compute the size of the profiling information corresponding to |
447 // Compute the size of the profiling information corresponding to |
444 // the current bytecode. |
448 // the current bytecode. |
445 int MethodData::compute_data_size(BytecodeStream* stream) { |
449 int MethodData::compute_data_size(BytecodeStream* stream) { |
507 |
511 |
508 // Initialize an individual data segment. Returns the size of |
512 // Initialize an individual data segment. Returns the size of |
509 // the segment in bytes. |
513 // the segment in bytes. |
510 int MethodData::initialize_data(BytecodeStream* stream, |
514 int MethodData::initialize_data(BytecodeStream* stream, |
511 int data_index) { |
515 int data_index) { |
|
516 #if defined(COMPILER1) && !defined(COMPILER2) |
|
517 return 0; |
|
518 #else |
512 int cell_count = -1; |
519 int cell_count = -1; |
513 int tag = DataLayout::no_tag; |
520 int tag = DataLayout::no_tag; |
514 DataLayout* data_layout = data_layout_at(data_index); |
521 DataLayout* data_layout = data_layout_at(data_index); |
515 Bytecodes::Code c = stream->code(); |
522 Bytecodes::Code c = stream->code(); |
516 switch (c) { |
523 switch (c) { |
585 return DataLayout::compute_size_in_bytes(cell_count); |
592 return DataLayout::compute_size_in_bytes(cell_count); |
586 } else { |
593 } else { |
587 assert(!bytecode_has_profile(c), "agree w/ !BHP"); |
594 assert(!bytecode_has_profile(c), "agree w/ !BHP"); |
588 return 0; |
595 return 0; |
589 } |
596 } |
|
597 #endif |
590 } |
598 } |
591 |
599 |
592 // Get the data at an arbitrary (sort of) data index. |
600 // Get the data at an arbitrary (sort of) data index. |
593 ProfileData* MethodData::data_at(int data_index) const { |
601 ProfileData* MethodData::data_at(int data_index) const { |
594 if (out_of_bounds(data_index)) { |
602 if (out_of_bounds(data_index)) { |