void frame::follow_roots() { if (is_interpreted_frame()) { if (has_interpreted_float_marker() && follow_roots_interpreted_float_frame()) return; // Follow the roots of the frame for (oop* p = sp(); p <= temp_addr(0); p++) { MarkSweep::follow_root(p); } MarkSweep::follow_root((oop*)hp_addr()); MarkSweep::follow_root(receiver_addr()); return; } if (is_compiled_frame()) { if (has_compiled_float_marker() && follow_roots_compiled_float_frame()) return; for (oop* p = sp(); p < (oop*)fp(); p++) MarkSweep::follow_root(p); return; } if (is_entry_frame()) { for (oop* p = sp(); p < (oop*)fp(); p++) MarkSweep::follow_root(p); return; } if (is_deoptimized_frame()) { // Expression stack oop* end = (oop*)fp() + frame_real_sender_sp_offset; for (oop* p = sp(); p < end; p++) MarkSweep::follow_root(p); MarkSweep::follow_root((oop*)frame_array_addr()); return; } }
void frame::layout_iterate(FrameLayoutClosure* blk) { if (is_interpreted_frame()){ oop* eos = temp_addr(0); for (oop* p = sp(); p <= eos; p++) blk->do_stack(eos-p, p); blk->do_hp(hp_addr()); blk->do_receiver(receiver_addr()); blk->do_link(link_addr()); blk->do_return_addr(return_addr_addr()); } }
void frame::oop_iterate(OopClosure* blk) { if (is_interpreted_frame()) { if (has_interpreted_float_marker() && oop_iterate_interpreted_float_frame(blk)) return; // lprintf("Frame: fp = %#lx, sp = %#lx]\n", fp(), sp()); for (oop* p = sp(); p <= temp_addr(0); p++) { // lprintf("\t[%#lx]: ", p); // (*p)->short_print(); // lprintf("\n"); blk->do_oop(p); } // lprintf("\t{%#lx}: ", receiver_addr()); // (*receiver_addr())->short_print(); // lprintf("\n"); blk->do_oop(receiver_addr()); return; } if (is_compiled_frame()) { if (has_compiled_float_marker() && oop_iterate_compiled_float_frame(blk)) return; // All oops are [sp..fp[ for (oop* p = sp(); p < (oop*)fp(); p++) { blk->do_oop(p); } return; } if (is_entry_frame()) { // All oops are [sp..fp[ for (oop* p = sp(); p < (oop*)fp(); p++) { blk->do_oop(p); } return; } if (is_deoptimized_frame()) { // Expression stack oop* end = (oop*)fp() + frame_real_sender_sp_offset; // All oops are [sp..end[ for (oop* p = sp(); p < end; p++) { blk->do_oop(p); } blk->do_oop((oop*)frame_array_addr()); return; } }
bool frame::oop_iterate_interpreted_float_frame(OopClosure* blk) { methodOop m = methodOopDesc::methodOop_from_hcode(hp()); // Return if this activation has no floats (the marker is conservative) if (!m->has_float_temporaries()) return false; // Iterator from stack pointer to end of float section oop* end = (oop*) addr_at(m->float_section_start_offset() - m->float_section_size()); for (oop* p = sp(); p <= end; p++) { blk->do_oop(p); } // Skip the float section and magic_value // Iterate from just before the float section to the first temp for (oop* q = (oop*) addr_at(m->float_section_start_offset() + 2); q <= temp_addr(0); q++) { blk->do_oop(q); } // The receiver blk->do_oop(receiver_addr()); return true; }
bool frame::follow_roots_interpreted_float_frame() { methodOop m = methodOop(hp()); assert(m->is_method(), "must be method"); // Return if this activation has no floats (the marker is conservative) if (!m->has_float_temporaries()) return false; // Iterator from stack pointer to end of float section oop* end = (oop*) addr_at(m->float_section_start_offset() - m->float_section_size()); for (oop* p = sp(); p <= end; p++) { MarkSweep::follow_root(p); } // Skip the float section and magic_value // Iterate from just before the float section to the first temp for (oop* q = (oop*) addr_at(m->float_section_start_offset() + 2); q <= temp_addr(0); q++) { MarkSweep::follow_root(q); } // The receiver MarkSweep::follow_root(receiver_addr()); return true; }
void set_receiver(oop recv) { *receiver_addr() = recv; }
// Receiver oop receiver() const { return *receiver_addr(); }
void Connection_Manager::connect_to_sender (void) { if (CORBA::is_nil (this->sender_.in ())) return; ACE_CString flowname = this->sender_name_ + "_" + this->receiver_name_; Endpoint_Addresses* addr = 0; ep_addr_.find (flowname, addr); ACE_CString sender_addr_str; ACE_CString receiver_addr_str; if (addr != 0) { sender_addr_str = addr->sender_addr; receiver_addr_str = addr->receiver_addr; ACE_DEBUG ((LM_DEBUG, "Address Strings %C %C\n", sender_addr_str.c_str (), receiver_addr_str.c_str ())); } ACE_INET_Addr receiver_addr (receiver_addr_str.c_str ()); ACE_INET_Addr sender_addr (sender_addr_str.c_str ()); // Create the forward flow specification to describe the flow. TAO_Forward_FlowSpec_Entry sender_entry (flowname.c_str (), "IN", "USER_DEFINED", "", "UDP", &sender_addr); sender_entry.set_peer_addr (&receiver_addr); // Set the flow specification for the stream between sender and // receiver. AVStreams::flowSpec flow_spec (1); flow_spec.length (1); flow_spec [0] = CORBA::string_dup (sender_entry.entry_to_string ()); if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "Connection_Manager::connect_to_sender Flow Spec Entry %C\n", sender_entry.entry_to_string ())); // Create the stream control for this stream TAO_StreamCtrl* streamctrl = 0; ACE_NEW (streamctrl, TAO_StreamCtrl); // Servant Reference Counting to manage lifetime PortableServer::ServantBase_var safe_streamctrl = streamctrl; // Register streamctrl. AVStreams::StreamCtrl_var streamctrl_object = streamctrl->_this (); // // Since senders terminate the streams, we don't need the streamctrl // for these. // // this->streamctrls_.bind (flowname, // streamctrl_object); // Initialize the QoS AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS); // Connect the sender and receiver devices. CORBA::Boolean result = streamctrl->bind_devs (this->sender_.in (), this->receiver_.in (), the_qos.inout (), flow_spec); if (result == 0) ACE_ERROR ((LM_ERROR, "Streamctrl::bind_devs failed\n")); // Start the data sending. AVStreams::flowSpec start_spec; streamctrl->start (start_spec); }
void Connection_Manager::connect_to_receivers (AVStreams::MMDevice_ptr sender) { // Connect to all receivers that we know about. for (Receivers::iterator iterator = this->receivers_.begin (); iterator != this->receivers_.end (); ++iterator) { // Initialize the QoS AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS); ACE_CString flowname = (*iterator).ext_id_; Endpoint_Addresses* addr = 0; ep_addr_.find (flowname, addr); ACE_CString sender_addr_str; ACE_CString receiver_addr_str; if (addr != 0) { sender_addr_str = addr->sender_addr; receiver_addr_str = addr->receiver_addr; ACE_DEBUG ((LM_DEBUG, "Address Strings %C %C\n", sender_addr_str.c_str (), receiver_addr_str.c_str ())); } else ACE_DEBUG ((LM_DEBUG, "No endpoint address for flowname %C\n", flowname.c_str ())); ACE_INET_Addr receiver_addr (receiver_addr_str.c_str ()); ACE_INET_Addr sender_addr (sender_addr_str.c_str ()); // Create the forward flow specification to describe the flow. TAO_Forward_FlowSpec_Entry sender_entry (flowname.c_str (), "IN", "USER_DEFINED", "", "UDP", &sender_addr); sender_entry.set_peer_addr (&receiver_addr); // Set the flow specification for the stream between receiver // and distributer AVStreams::flowSpec flow_spec (1); flow_spec.length (1); flow_spec [0] = CORBA::string_dup (sender_entry.entry_to_string ()); if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "Connection_Manager::connect_to_receivers Flow Spec Entry %C\n", sender_entry.entry_to_string ())); // Create the stream control for this stream. TAO_StreamCtrl *streamctrl = 0; ACE_NEW (streamctrl, TAO_StreamCtrl); // Servant Reference Counting to manage lifetime PortableServer::ServantBase_var safe_streamctrl = streamctrl; // Register streamctrl. AVStreams::StreamCtrl_var streamctrl_object = streamctrl->_this (); // Bind the flowname and the corresponding stream controller to // the stream controller map this->streamctrls_.bind (flowname, streamctrl_object); // Bind the sender and receiver MMDevices. (void) streamctrl->bind_devs (sender, (*iterator).int_id_.in (), the_qos.inout (), flow_spec); } }