Commit 26bb121e authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[cleanup] Adding comments to FunctionTemplateInfo

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: Ia86a3344bbe2a7101b4aa633d80f0dc8141882bb
Reviewed-on: https://chromium-review.googlesource.com/557868Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46434}
parent 7f428d56
......@@ -1354,8 +1354,9 @@ static Local<FunctionTemplate> FunctionTemplateNew(
obj->set_undetectable(false);
obj->set_needs_access_check(false);
obj->set_accept_any_receiver(true);
if (!signature.IsEmpty())
if (!signature.IsEmpty()) {
obj->set_signature(*Utils::OpenHandle(*signature));
}
obj->set_cached_property_name(
cached_property_name.IsEmpty()
? isolate->heap()->the_hole_value()
......
......@@ -7044,39 +7044,87 @@ class TemplateInfo: public Struct {
DISALLOW_IMPLICIT_CONSTRUCTORS(TemplateInfo);
};
// See the api-exposed FunctionTemplate for more information.
class FunctionTemplateInfo: public TemplateInfo {
public:
// Handler invoked when calling an instance of this FunctionTemplateInfo.
// Either CallInfoHandler or Undefined.
DECL_ACCESSORS(call_code, Object)
// ObjectTemplateInfo or Undefined, used for the prototype property of the
// resulting JSFunction instance of this FunctionTemplate.
DECL_ACCESSORS(prototype_template, Object)
// In the case the prototype_template is Undefined we use the
// protoype_provider_template to retrieve the instance prototype. Either
// contains an ObjectTemplateInfo or Undefined.
DECL_ACCESSORS(prototype_provider_template, Object)
// Used to create protoype chains. The parent_template's prototype is set as
// __proto__ of this FunctionTemplate's instance prototype. Is either a
// FunctionTemplateInfo or Undefined.
DECL_ACCESSORS(parent_template, Object)
// Returns an InterceptorInfo or Undefined for named properties.
DECL_ACCESSORS(named_property_handler, Object)
// Returns an InterceptorInfo or Undefined for indexed properties/elements.
DECL_ACCESSORS(indexed_property_handler, Object)
// An ObjectTemplateInfo that is used when instantiating the JSFunction
// associated with this FunctionTemplateInfo. Contains either an
// ObjectTemplateInfo or Undefined. A default instance_template is assigned
// upon first instantiation if it's Undefined.
DECL_ACCESSORS(instance_template, Object)
DECL_ACCESSORS(class_name, Object)
// If the signature is a FunctionTemplateInfo it is used to check whether the
// receiver calling the associated JSFunction is a compatible receiver, i.e.
// it is an instance of the signare FunctionTemplateInfo or any of the
// receiver's prototypes are.
DECL_ACCESSORS(signature, Object)
// Either a CallHandlerInfo or Undefined. If an instance_call_handler is
// provided the instances created from the associated JSFunction are marked as
// callable.
DECL_ACCESSORS(instance_call_handler, Object)
DECL_ACCESSORS(access_check_info, Object)
DECL_ACCESSORS(shared_function_info, Object)
DECL_ACCESSORS(js_function, Object)
// Internal field to store a flag bitfield.
DECL_INT_ACCESSORS(flag)
inline int length() const;
inline void set_length(int value);
// "length" property of the final JSFunction.
DECL_INT_ACCESSORS(length)
// Either the_hole or a private symbol. Used to cache the result on
// the receiver under the the cached_property_name when this
// FunctionTemplateInfo is used as a getter.
DECL_ACCESSORS(cached_property_name, Object)
// Following properties use flag bits.
// Begin flag bits ---------------------
DECL_BOOLEAN_ACCESSORS(hidden_prototype)
DECL_BOOLEAN_ACCESSORS(undetectable)
// If the bit is set, object instances created by this function
// If set, object instances created by this function
// requires access check.
DECL_BOOLEAN_ACCESSORS(needs_access_check)
DECL_BOOLEAN_ACCESSORS(read_only_prototype)
// If set, do not create a prototype property for the associated
// JSFunction. This bit implies that neither the prototype_template nor the
// prototype_provoider_template are instantiated.
DECL_BOOLEAN_ACCESSORS(remove_prototype)
// If set, do not attach a serial number to this FunctionTemplate and thus do
// not keep an instance boilerplate around.
DECL_BOOLEAN_ACCESSORS(do_not_cache)
DECL_BOOLEAN_ACCESSORS(accept_any_receiver)
DECL_ACCESSORS(cached_property_name, Object)
// If not set an access may be performed on calling the associated JSFunction.
DECL_BOOLEAN_ACCESSORS(accept_any_receiver)
// End flag bits ---------------------
DECL_CAST(FunctionTemplateInfo)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment