summaryrefslogtreecommitdiff
path: root/deps/v8/src/accessors.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/accessors.h')
-rw-r--r--deps/v8/src/accessors.h109
1 files changed, 55 insertions, 54 deletions
diff --git a/deps/v8/src/accessors.h b/deps/v8/src/accessors.h
index 52420d91de..70e6a9200e 100644
--- a/deps/v8/src/accessors.h
+++ b/deps/v8/src/accessors.h
@@ -17,34 +17,36 @@ namespace internal {
class AccessorInfo;
template <typename T>
class Handle;
+class FieldIndex;
+class JavaScriptFrame;
// The list of accessor descriptors. This is a second-order macro
// taking a macro to be applied to all accessor descriptor names.
-#define ACCESSOR_INFO_LIST(V) \
- V(ArgumentsIterator) \
- V(ArrayLength) \
- V(BoundFunctionLength) \
- V(BoundFunctionName) \
- V(ErrorStack) \
- V(FunctionArguments) \
- V(FunctionCaller) \
- V(FunctionName) \
- V(FunctionLength) \
- V(FunctionPrototype) \
- V(ScriptColumnOffset) \
- V(ScriptCompilationType) \
- V(ScriptContextData) \
- V(ScriptEvalFromScript) \
- V(ScriptEvalFromScriptPosition) \
- V(ScriptEvalFromFunctionName) \
- V(ScriptId) \
- V(ScriptLineOffset) \
- V(ScriptName) \
- V(ScriptSource) \
- V(ScriptType) \
- V(ScriptSourceUrl) \
- V(ScriptSourceMappingUrl) \
- V(StringLength)
+#define ACCESSOR_INFO_LIST(V) \
+ V(arguments_iterator, ArgumentsIterator) \
+ V(array_length, ArrayLength) \
+ V(bound_function_length, BoundFunctionLength) \
+ V(bound_function_name, BoundFunctionName) \
+ V(error_stack, ErrorStack) \
+ V(function_arguments, FunctionArguments) \
+ V(function_caller, FunctionCaller) \
+ V(function_name, FunctionName) \
+ V(function_length, FunctionLength) \
+ V(function_prototype, FunctionPrototype) \
+ V(script_column_offset, ScriptColumnOffset) \
+ V(script_compilation_type, ScriptCompilationType) \
+ V(script_context_data, ScriptContextData) \
+ V(script_eval_from_script, ScriptEvalFromScript) \
+ V(script_eval_from_script_position, ScriptEvalFromScriptPosition) \
+ V(script_eval_from_function_name, ScriptEvalFromFunctionName) \
+ V(script_id, ScriptId) \
+ V(script_line_offset, ScriptLineOffset) \
+ V(script_name, ScriptName) \
+ V(script_source, ScriptSource) \
+ V(script_type, ScriptType) \
+ V(script_source_url, ScriptSourceUrl) \
+ V(script_source_mapping_url, ScriptSourceMappingUrl) \
+ V(string_length, StringLength)
#define ACCESSOR_SETTER_LIST(V) \
V(ArrayLengthSetter) \
@@ -57,45 +59,36 @@ class Handle;
class Accessors : public AllStatic {
public:
- // Accessor descriptors.
-#define ACCESSOR_INFO_DECLARATION(name) \
- static void name##Getter( \
- v8::Local<v8::Name> name, \
- const v8::PropertyCallbackInfo<v8::Value>& info); \
- static Handle<AccessorInfo> name##Info( \
- Isolate* isolate, \
- PropertyAttributes attributes);
- ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION)
-#undef ACCESSOR_INFO_DECLARATION
+#define ACCESSOR_GETTER_DECLARATION(accessor_name, AccessorName) \
+ static void AccessorName##Getter( \
+ v8::Local<v8::Name> name, \
+ const v8::PropertyCallbackInfo<v8::Value>& info);
+ ACCESSOR_INFO_LIST(ACCESSOR_GETTER_DECLARATION)
+#undef ACCESSOR_GETTER_DECLARATION
-#define ACCESSOR_SETTER_DECLARATION(name) \
- static void name(v8::Local<v8::Name> name, v8::Local<v8::Value> value, \
- const v8::PropertyCallbackInfo<v8::Boolean>& info);
+#define ACCESSOR_SETTER_DECLARATION(accessor_name) \
+ static void accessor_name( \
+ v8::Local<v8::Name> name, v8::Local<v8::Value> value, \
+ const v8::PropertyCallbackInfo<v8::Boolean>& info);
ACCESSOR_SETTER_LIST(ACCESSOR_SETTER_DECLARATION)
#undef ACCESSOR_SETTER_DECLARATION
static void ModuleNamespaceEntryGetter(
v8::Local<v8::Name> name,
const v8::PropertyCallbackInfo<v8::Value>& info);
- static Handle<AccessorInfo> ModuleNamespaceEntryInfo(
- Isolate* isolate, Handle<String> name, PropertyAttributes attributes);
-
- enum DescriptorId {
-#define ACCESSOR_INFO_DECLARATION(name) \
- k##name##Getter, \
- k##name##Setter,
- ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION)
-#undef ACCESSOR_INFO_DECLARATION
- descriptorCount
- };
+ static Handle<AccessorInfo> MakeModuleNamespaceEntryInfo(Isolate* isolate,
+ Handle<String> name);
- // Accessor functions called directly from the runtime system.
- static Handle<JSObject> FunctionGetArguments(Handle<JSFunction> object);
+ // Accessor function called directly from the runtime system. Returns the
+ // newly materialized arguments object for the given {frame}. Note that for
+ // optimized frames it is possible to specify an {inlined_jsframe_index}.
+ static Handle<JSObject> FunctionGetArguments(JavaScriptFrame* frame,
+ int inlined_jsframe_index);
// Returns true for properties that are accessors to object fields.
- // If true, *object_offset contains offset of object field.
+ // If true, the matching FieldIndex is returned through |field_index|.
static bool IsJSObjectFieldAccessor(Handle<Map> map, Handle<Name> name,
- int* object_offset);
+ FieldIndex* field_index);
// Create an AccessorInfo. The setter is optional (can be nullptr).
//
@@ -111,7 +104,15 @@ class Accessors : public AllStatic {
static Handle<AccessorInfo> MakeAccessor(
Isolate* isolate, Handle<Name> name, AccessorNameGetterCallback getter,
- AccessorNameBooleanSetterCallback setter, PropertyAttributes attributes);
+ AccessorNameBooleanSetterCallback setter);
+
+ private:
+#define ACCESSOR_INFO_DECLARATION(accessor_name, AccessorName) \
+ static Handle<AccessorInfo> Make##AccessorName##Info(Isolate* isolate);
+ ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION)
+#undef ACCESSOR_INFO_DECLARATION
+
+ friend class Heap;
};
} // namespace internal