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 "include/v8.h" | 8 #include "include/v8.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 V(ScriptLineEnds) \ | 37 V(ScriptLineEnds) \ |
38 V(ScriptLineOffset) \ | 38 V(ScriptLineOffset) \ |
39 V(ScriptName) \ | 39 V(ScriptName) \ |
40 V(ScriptSource) \ | 40 V(ScriptSource) \ |
41 V(ScriptType) \ | 41 V(ScriptType) \ |
42 V(ScriptSourceUrl) \ | 42 V(ScriptSourceUrl) \ |
43 V(ScriptSourceMappingUrl) \ | 43 V(ScriptSourceMappingUrl) \ |
44 V(ScriptIsEmbedderDebugScript) \ | 44 V(ScriptIsEmbedderDebugScript) \ |
45 V(StringLength) | 45 V(StringLength) |
46 | 46 |
| 47 #define ACCESSOR_SETTER_LIST(V) \ |
| 48 V(ReconfigureToDataProperty) \ |
| 49 V(ObservedReconfigureToDataProperty) \ |
| 50 V(ArrayLengthSetter) \ |
| 51 V(FunctionPrototypeSetter) |
| 52 |
47 // Accessors contains all predefined proxy accessors. | 53 // Accessors contains all predefined proxy accessors. |
48 | 54 |
49 class Accessors : public AllStatic { | 55 class Accessors : public AllStatic { |
50 public: | 56 public: |
51 // Accessor descriptors. | 57 // Accessor descriptors. |
52 #define ACCESSOR_INFO_DECLARATION(name) \ | 58 #define ACCESSOR_INFO_DECLARATION(name) \ |
53 static void name##Getter( \ | 59 static void name##Getter( \ |
54 v8::Local<v8::Name> name, \ | 60 v8::Local<v8::Name> name, \ |
55 const v8::PropertyCallbackInfo<v8::Value>& info); \ | 61 const v8::PropertyCallbackInfo<v8::Value>& info); \ |
56 static void name##Setter( \ | |
57 v8::Local<v8::Name> name, \ | |
58 v8::Local<v8::Value> value, \ | |
59 const v8::PropertyCallbackInfo<void>& info); \ | |
60 static Handle<AccessorInfo> name##Info( \ | 62 static Handle<AccessorInfo> name##Info( \ |
61 Isolate* isolate, \ | 63 Isolate* isolate, \ |
62 PropertyAttributes attributes); | 64 PropertyAttributes attributes); |
63 ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION) | 65 ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION) |
64 #undef ACCESSOR_INFO_DECLARATION | 66 #undef ACCESSOR_INFO_DECLARATION |
65 | 67 |
| 68 #define ACCESSOR_SETTER_DECLARATION(name) \ |
| 69 static void name(v8::Local<v8::Name> name, v8::Local<v8::Value> value, \ |
| 70 const v8::PropertyCallbackInfo<void>& info); |
| 71 ACCESSOR_SETTER_LIST(ACCESSOR_SETTER_DECLARATION) |
| 72 #undef ACCESSOR_SETTER_DECLARATION |
| 73 |
66 enum DescriptorId { | 74 enum DescriptorId { |
67 #define ACCESSOR_INFO_DECLARATION(name) \ | 75 #define ACCESSOR_INFO_DECLARATION(name) \ |
68 k##name##Getter, \ | 76 k##name##Getter, \ |
69 k##name##Setter, | 77 k##name##Setter, |
70 ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION) | 78 ACCESSOR_INFO_LIST(ACCESSOR_INFO_DECLARATION) |
71 #undef ACCESSOR_INFO_DECLARATION | 79 #undef ACCESSOR_INFO_DECLARATION |
72 descriptorCount | 80 descriptorCount |
73 }; | 81 }; |
74 | 82 |
75 // Accessor functions called directly from the runtime system. | 83 // Accessor functions called directly from the runtime system. |
(...skipping 23 matching lines...) Expand all Loading... |
99 Handle<Name> name, | 107 Handle<Name> name, |
100 AccessorNameGetterCallback getter, | 108 AccessorNameGetterCallback getter, |
101 AccessorNameSetterCallback setter, | 109 AccessorNameSetterCallback setter, |
102 PropertyAttributes attributes); | 110 PropertyAttributes attributes); |
103 }; | 111 }; |
104 | 112 |
105 } // namespace internal | 113 } // namespace internal |
106 } // namespace v8 | 114 } // namespace v8 |
107 | 115 |
108 #endif // V8_ACCESSORS_H_ | 116 #endif // V8_ACCESSORS_H_ |
OLD | NEW |