×

Dynamic generation of wrapper classes to implement call-by-value semantics

  • US 8,881,099 B2
  • Filed: 09/10/2004
  • Issued: 11/04/2014
  • Est. Priority Date: 09/10/2004
  • Status: Active Grant
First Claim
Patent Images

1. A method for supporting method invoking between software objects, comprising:

  • receiving a request, from a first software object in a first software module on a virtual machine, to access a second software object in a second software module on the virtual machine, wherein the request contains a method invocation using a parameter object and call-by-value semantics, wherein the parameter object is located in the first software module in the virtual machine;

    performing introspection on the second software object to identify one or more interfaces for communicating therewith;

    dynamically generating a wrapper object for the second software object on the virtual machine where the first software module and the second software module are collocated, wherein the wrapper object is configured to communicate with the second software object based on the one or more identified interfaces, wherein the dynamically generated wrapper object operates tointercept communication between the first and second software objects, andoptimize the parameter object based on the type thereof, wherein the optimization includesdetermining if the parameter object is immutable, and if it is, passing a reference of the parameter object to the second software object, so that the second software object can access the parameter object in the software module,determining if the parameter object is mutable and can be cloned, and if it is, creating a clone thereof and passing the clone to the second software object, anddetermining if the parameter object is mutable but cannot be cloned, and if it cannot be cloned, serializing the parameter object and passing the serialized object to the second software object; and

    providing the first software object with a reference to the wrapper object, instead of a direct reference to the second software object, so that the first software object accesses the second software object using the wrapper object.

View all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×