| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_ACCESSORS_H_ | 5 #ifndef V8_ACCESSORS_H_ |
| 6 #define V8_ACCESSORS_H_ | 6 #define V8_ACCESSORS_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 MUST_USE_RESULT static MaybeHandle<Object> FunctionSetPrototype( | 71 MUST_USE_RESULT static MaybeHandle<Object> FunctionSetPrototype( |
| 72 Handle<JSFunction> object, Handle<Object> value); | 72 Handle<JSFunction> object, Handle<Object> value); |
| 73 static Handle<Object> FunctionGetArguments(Handle<JSFunction> object); | 73 static Handle<Object> FunctionGetArguments(Handle<JSFunction> object); |
| 74 | 74 |
| 75 // Accessor infos. | 75 // Accessor infos. |
| 76 static Handle<AccessorInfo> MakeModuleExport( | 76 static Handle<AccessorInfo> MakeModuleExport( |
| 77 Handle<String> name, int index, PropertyAttributes attributes); | 77 Handle<String> name, int index, PropertyAttributes attributes); |
| 78 | 78 |
| 79 // Returns true for properties that are accessors to object fields. | 79 // Returns true for properties that are accessors to object fields. |
| 80 // If true, *object_offset contains offset of object field. | 80 // If true, *object_offset contains offset of object field. |
| 81 template <class T> | 81 static bool IsJSObjectFieldAccessor(Handle<Map> map, Handle<Name> name, |
| 82 static bool IsJSObjectFieldAccessor(typename T::TypeHandle type, | |
| 83 Handle<Name> name, | |
| 84 int* object_offset); | 82 int* object_offset); |
| 85 | 83 |
| 86 static Handle<AccessorInfo> MakeAccessor( | 84 static Handle<AccessorInfo> MakeAccessor( |
| 87 Isolate* isolate, | 85 Isolate* isolate, |
| 88 Handle<Name> name, | 86 Handle<Name> name, |
| 89 AccessorNameGetterCallback getter, | 87 AccessorNameGetterCallback getter, |
| 90 AccessorNameSetterCallback setter, | 88 AccessorNameSetterCallback setter, |
| 91 PropertyAttributes attributes); | 89 PropertyAttributes attributes); |
| 92 | 90 |
| 93 static Handle<ExecutableAccessorInfo> CloneAccessor( | 91 static Handle<ExecutableAccessorInfo> CloneAccessor( |
| 94 Isolate* isolate, | 92 Isolate* isolate, |
| 95 Handle<ExecutableAccessorInfo> accessor); | 93 Handle<ExecutableAccessorInfo> accessor); |
| 96 | 94 |
| 97 | 95 |
| 98 private: | 96 private: |
| 99 // Helper functions. | 97 // Helper functions. |
| 100 static Handle<Object> FlattenNumber(Isolate* isolate, Handle<Object> value); | 98 static Handle<Object> FlattenNumber(Isolate* isolate, Handle<Object> value); |
| 101 }; | 99 }; |
| 102 | 100 |
| 103 } } // namespace v8::internal | 101 } } // namespace v8::internal |
| 104 | 102 |
| 105 #endif // V8_ACCESSORS_H_ | 103 #endif // V8_ACCESSORS_H_ |
| OLD | NEW |