342 bool _wrote_fields; // Did we write any field?
343 bool _count_invocations; // update and test invocation counter
344 bool _method_data_update; // update method data oop
345 Node* _alloc_with_final; // An allocation node with final field
346
347 // Variables which track Java semantics during bytecode parsing:
348
349 Block* _block; // block currently getting parsed
350 ciBytecodeStream _iter; // stream of this method's bytecodes
351
352 int _blocks_merged; // Progress meter: state merges from BB preds
353 int _blocks_parsed; // Progress meter: BBs actually parsed
354
355 const FastLockNode* _synch_lock; // FastLockNode for synchronized method
356
357 #ifndef PRODUCT
358 int _max_switch_depth; // Debugging SwitchRanges.
359 int _est_switch_depth; // Debugging SwitchRanges.
360 #endif
361
362 // parser for the caller of the method of this object
363 Parse* const _parent;
364
365 public:
366 // Constructor
367 Parse(JVMState* caller, ciMethod* parse_method, float expected_uses, Parse* parent);
368
369 virtual Parse* is_Parse() const { return (Parse*)this; }
370
371 // Accessors.
372 JVMState* caller() const { return _caller; }
373 float expected_uses() const { return _expected_uses; }
374 float prof_factor() const { return _prof_factor; }
375 int depth() const { return _depth; }
376 const TypeFunc* tf() const { return _tf; }
377 // entry_bci() -- see osr_bci, etc.
378
379 ciTypeFlow* flow() const { return _flow; }
380 // blocks() -- see rpo_at, start_block, etc.
381 int block_count() const { return _block_count; }
382
383 GraphKit& exits() { return _exits; }
384 bool wrote_final() const { return _wrote_final; }
385 void set_wrote_final(bool z) { _wrote_final = z; }
386 bool wrote_volatile() const { return _wrote_volatile; }
387 void set_wrote_volatile(bool z) { _wrote_volatile = z; }
407 bool is_normal_parse() const { return _entry_bci == InvocationEntryBci; }
408 bool is_osr_parse() const { return _entry_bci != InvocationEntryBci; }
409 int osr_bci() const { assert(is_osr_parse(),""); return _entry_bci; }
410
411 void set_parse_bci(int bci);
412
413 // Must this parse be aborted?
414 bool failing() { return C->failing(); }
415
416 Block* rpo_at(int rpo) {
417 assert(0 <= rpo && rpo < _block_count, "oob");
418 return &_blocks[rpo];
419 }
420 Block* start_block() {
421 return rpo_at(flow()->start_block()->rpo());
422 }
423 // Can return NULL if the flow pass did not complete a block.
424 Block* successor_for_bci(int bci) {
425 return block()->successor_for_bci(bci);
426 }
427
428 Parse* parent_parser() const { return _parent; }
429
430 private:
431 // Create a JVMS & map for the initial state of this method.
432 SafePointNode* create_entry_map();
433
434 // OSR helpers
435 Node *fetch_interpreter_state(int index, BasicType bt, Node *local_addrs, Node *local_addrs_base);
436 Node* check_interpreter_type(Node* l, const Type* type, SafePointNode* &bad_type_exit);
437 void load_interpreter_state(Node* osr_buf);
438
439 // Functions for managing basic blocks:
440 void init_blocks();
441 void load_state_from(Block* b);
442 void store_state_to(Block* b) { b->record_state(this); }
443
444 // Parse all the basic blocks.
445 void do_all_blocks();
446
447 // Parse the current basic block
448 void do_one_block();
|
342 bool _wrote_fields; // Did we write any field?
343 bool _count_invocations; // update and test invocation counter
344 bool _method_data_update; // update method data oop
345 Node* _alloc_with_final; // An allocation node with final field
346
347 // Variables which track Java semantics during bytecode parsing:
348
349 Block* _block; // block currently getting parsed
350 ciBytecodeStream _iter; // stream of this method's bytecodes
351
352 int _blocks_merged; // Progress meter: state merges from BB preds
353 int _blocks_parsed; // Progress meter: BBs actually parsed
354
355 const FastLockNode* _synch_lock; // FastLockNode for synchronized method
356
357 #ifndef PRODUCT
358 int _max_switch_depth; // Debugging SwitchRanges.
359 int _est_switch_depth; // Debugging SwitchRanges.
360 #endif
361
362 bool _first_return; // true if return is the first to be parsed
363 bool _replaced_nodes_for_exceptions; // needs processing of replaced nodes in exception paths?
364 uint _new_idx; // any node with _idx above were new during this parsing. Used to trim the replaced nodes list.
365
366 public:
367 // Constructor
368 Parse(JVMState* caller, ciMethod* parse_method, float expected_uses);
369
370 virtual Parse* is_Parse() const { return (Parse*)this; }
371
372 // Accessors.
373 JVMState* caller() const { return _caller; }
374 float expected_uses() const { return _expected_uses; }
375 float prof_factor() const { return _prof_factor; }
376 int depth() const { return _depth; }
377 const TypeFunc* tf() const { return _tf; }
378 // entry_bci() -- see osr_bci, etc.
379
380 ciTypeFlow* flow() const { return _flow; }
381 // blocks() -- see rpo_at, start_block, etc.
382 int block_count() const { return _block_count; }
383
384 GraphKit& exits() { return _exits; }
385 bool wrote_final() const { return _wrote_final; }
386 void set_wrote_final(bool z) { _wrote_final = z; }
387 bool wrote_volatile() const { return _wrote_volatile; }
388 void set_wrote_volatile(bool z) { _wrote_volatile = z; }
408 bool is_normal_parse() const { return _entry_bci == InvocationEntryBci; }
409 bool is_osr_parse() const { return _entry_bci != InvocationEntryBci; }
410 int osr_bci() const { assert(is_osr_parse(),""); return _entry_bci; }
411
412 void set_parse_bci(int bci);
413
414 // Must this parse be aborted?
415 bool failing() { return C->failing(); }
416
417 Block* rpo_at(int rpo) {
418 assert(0 <= rpo && rpo < _block_count, "oob");
419 return &_blocks[rpo];
420 }
421 Block* start_block() {
422 return rpo_at(flow()->start_block()->rpo());
423 }
424 // Can return NULL if the flow pass did not complete a block.
425 Block* successor_for_bci(int bci) {
426 return block()->successor_for_bci(bci);
427 }
428
429 private:
430 // Create a JVMS & map for the initial state of this method.
431 SafePointNode* create_entry_map();
432
433 // OSR helpers
434 Node *fetch_interpreter_state(int index, BasicType bt, Node *local_addrs, Node *local_addrs_base);
435 Node* check_interpreter_type(Node* l, const Type* type, SafePointNode* &bad_type_exit);
436 void load_interpreter_state(Node* osr_buf);
437
438 // Functions for managing basic blocks:
439 void init_blocks();
440 void load_state_from(Block* b);
441 void store_state_to(Block* b) { b->record_state(this); }
442
443 // Parse all the basic blocks.
444 void do_all_blocks();
445
446 // Parse the current basic block
447 void do_one_block();
|