Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: include/v8.h

Issue 242050: Changed structure of accessor arguments passing to allow accessor (Closed)
Patch Set: Tuned Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/arguments.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. 1 // Copyright 2007-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 template <class T> class Handle; 123 template <class T> class Handle;
124 template <class T> class Local; 124 template <class T> class Local;
125 template <class T> class Persistent; 125 template <class T> class Persistent;
126 class FunctionTemplate; 126 class FunctionTemplate;
127 class ObjectTemplate; 127 class ObjectTemplate;
128 class Data; 128 class Data;
129 129
130 namespace internal { 130 namespace internal {
131 131
132 class Object; 132 class Object;
133 class Arguments;
133 134
134 } 135 }
135 136
136 137
137 // --- W e a k H a n d l e s 138 // --- W e a k H a n d l e s
138 139
139 140
140 /** 141 /**
141 * A weak reference callback function. 142 * A weak reference callback function.
142 * 143 *
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 int length_; 1402 int length_;
1402 }; 1403 };
1403 1404
1404 1405
1405 /** 1406 /**
1406 * The information passed to an accessor callback about the context 1407 * The information passed to an accessor callback about the context
1407 * of the property access. 1408 * of the property access.
1408 */ 1409 */
1409 class V8EXPORT AccessorInfo { 1410 class V8EXPORT AccessorInfo {
1410 public: 1411 public:
1411 inline AccessorInfo(Local<Object> self, 1412 inline AccessorInfo(internal::Object** args)
1412 Local<Value> data, 1413 : args_(args) { }
1413 Local<Object> holder)
1414 : self_(self), data_(data), holder_(holder) { }
1415 inline Local<Value> Data() const; 1414 inline Local<Value> Data() const;
1416 inline Local<Object> This() const; 1415 inline Local<Object> This() const;
1417 inline Local<Object> Holder() const; 1416 inline Local<Object> Holder() const;
1418 private: 1417 private:
1419 Local<Object> self_; 1418 internal::Object** args_;
1420 Local<Value> data_;
1421 Local<Object> holder_;
1422 }; 1419 };
1423 1420
1424 1421
1425 typedef Handle<Value> (*InvocationCallback)(const Arguments& args); 1422 typedef Handle<Value> (*InvocationCallback)(const Arguments& args);
1426 1423
1427 typedef int (*LookupCallback)(Local<Object> self, Local<String> name); 1424 typedef int (*LookupCallback)(Local<Object> self, Local<String> name);
1428 1425
1429 /** 1426 /**
1430 * Accessor[Getter|Setter] are used as callback functions when 1427 * Accessor[Getter|Setter] are used as callback functions when
1431 * setting|getting a particular property. See objectTemplate::SetAccessor. 1428 * setting|getting a particular property. See objectTemplate::SetAccessor.
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
2863 bool Arguments::IsConstructCall() const { 2860 bool Arguments::IsConstructCall() const {
2864 return is_construct_call_; 2861 return is_construct_call_;
2865 } 2862 }
2866 2863
2867 2864
2868 int Arguments::Length() const { 2865 int Arguments::Length() const {
2869 return length_; 2866 return length_;
2870 } 2867 }
2871 2868
2872 2869
2873 Local<Value> AccessorInfo::Data() const {
2874 return data_;
2875 }
2876
2877
2878 Local<Object> AccessorInfo::This() const {
2879 return self_;
2880 }
2881
2882
2883 Local<Object> AccessorInfo::Holder() const {
2884 return holder_;
2885 }
2886
2887
2888 template <class T> 2870 template <class T>
2889 Local<T> HandleScope::Close(Handle<T> value) { 2871 Local<T> HandleScope::Close(Handle<T> value) {
2890 internal::Object** before = reinterpret_cast<internal::Object**>(*value); 2872 internal::Object** before = reinterpret_cast<internal::Object**>(*value);
2891 internal::Object** after = RawClose(before); 2873 internal::Object** after = RawClose(before);
2892 return Local<T>(reinterpret_cast<T*>(after)); 2874 return Local<T>(reinterpret_cast<T*>(after));
2893 } 2875 }
2894 2876
2895 Handle<Value> ScriptOrigin::ResourceName() const { 2877 Handle<Value> ScriptOrigin::ResourceName() const {
2896 return resource_name_; 2878 return resource_name_;
2897 } 2879 }
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
3075 3057
3076 3058
3077 External* External::Cast(v8::Value* value) { 3059 External* External::Cast(v8::Value* value) {
3078 #ifdef V8_ENABLE_CHECKS 3060 #ifdef V8_ENABLE_CHECKS
3079 CheckCast(value); 3061 CheckCast(value);
3080 #endif 3062 #endif
3081 return static_cast<External*>(value); 3063 return static_cast<External*>(value);
3082 } 3064 }
3083 3065
3084 3066
3067 Local<Value> AccessorInfo::Data() const {
3068 return Local<Value>(reinterpret_cast<Value*>(&args_[-3]));
3069 }
3070
3071
3072 Local<Object> AccessorInfo::This() const {
3073 return Local<Object>(reinterpret_cast<Object*>(&args_[0]));
3074 }
3075
3076
3077 Local<Object> AccessorInfo::Holder() const {
3078 return Local<Object>(reinterpret_cast<Object*>(&args_[-1]));
3079 }
3080
3081
3085 /** 3082 /**
3086 * \example shell.cc 3083 * \example shell.cc
3087 * A simple shell that takes a list of expressions on the 3084 * A simple shell that takes a list of expressions on the
3088 * command-line and executes them. 3085 * command-line and executes them.
3089 */ 3086 */
3090 3087
3091 3088
3092 /** 3089 /**
3093 * \example process.cc 3090 * \example process.cc
3094 */ 3091 */
3095 3092
3096 3093
3097 } // namespace v8 3094 } // namespace v8
3098 3095
3099 3096
3100 #undef V8EXPORT 3097 #undef V8EXPORT
3101 #undef V8EXPORT_INLINE 3098 #undef V8EXPORT_INLINE
3102 #undef TYPE_CHECK 3099 #undef TYPE_CHECK
3103 3100
3104 3101
3105 #endif // V8_H_ 3102 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/arguments.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698