HInstruction* HGraphBuilder::BuildLoadNamedMonomorphic(HValue* object,
                                                       Handle<String> name,
                                                       Property* expr,
                                                       Handle<Map> map) {
  // Handle a load from a known field.
  ASSERT(!map->is_dictionary_map());
  LookupResult lookup(isolate());
  map->LookupDescriptor(NULL, *name, &lookup);
  if (lookup.IsField()) {
    return BuildLoadNamedField(object, map, &lookup, true);
  }

  // Handle a load of a constant known function.
  if (lookup.IsConstantFunction()) {
    AddInstruction(new(zone()) HCheckNonSmi(object));
    AddInstruction(HCheckMaps::NewWithTransitions(object, map, zone()));
    Handle<JSFunction> function(lookup.GetConstantFunctionFromMap(*map));
    return new(zone()) HConstant(function, Representation::Tagged());
  }

  // No luck, do a generic load.
  return BuildLoadNamedGeneric(object, name, expr);
}
HInstruction* HGraphBuilder::BuildLoadNamedMonomorphic(HValue* object,
                                                       Handle<String> name,
                                                       Property* expr,
                                                       Handle<Map> map) {
   
  ASSERT(!map->is_dictionary_map());
  LookupResult lookup(isolate());
  map->LookupDescriptor(NULL, *name, &lookup);
  if (lookup.IsField()) {
    return BuildLoadNamedField(object, map, &lookup, true);
  }

   
  if (lookup.IsConstantFunction()) {
    AddInstruction(new(zone()) HCheckNonSmi(object));
    AddInstruction(HCheckMaps::NewWithTransitions(object, map, zone()));
    Handle<JSFunction> function(lookup.GetConstantFunctionFromMap(*map));
    return new(zone()) HConstant(function, Representation::Tagged());
  }

   
  return BuildLoadNamedGeneric(object, name, expr);
}