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

Side by Side Diff: src/api-arguments.h

Issue 1923893002: [counters] Annotate v8 with more runtime call counters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merging master Created 4 years, 7 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 | « src/api.cc ('k') | src/api-arguments.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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_API_ARGUMENTS_H_ 5 #ifndef V8_API_ARGUMENTS_H_
6 #define V8_API_ARGUMENTS_H_ 6 #define V8_API_ARGUMENTS_H_
7 7
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/isolate.h" 9 #include "src/isolate.h"
10 #include "src/tracing/trace-event.h" 10 #include "src/tracing/trace-event.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 Handle<JSObject> Call(IndexedPropertyEnumeratorCallback f); 109 Handle<JSObject> Call(IndexedPropertyEnumeratorCallback f);
110 110
111 #define FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME(F) \ 111 #define FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME(F) \
112 F(AccessorNameGetterCallback, "get", v8::Value, Object) \ 112 F(AccessorNameGetterCallback, "get", v8::Value, Object) \
113 F(GenericNamedPropertyQueryCallback, "has", v8::Integer, Object) \ 113 F(GenericNamedPropertyQueryCallback, "has", v8::Integer, Object) \
114 F(GenericNamedPropertyDeleterCallback, "delete", v8::Boolean, Object) 114 F(GenericNamedPropertyDeleterCallback, "delete", v8::Boolean, Object)
115 115
116 #define WRITE_CALL_1_NAME(Function, type, ApiReturn, InternalReturn) \ 116 #define WRITE_CALL_1_NAME(Function, type, ApiReturn, InternalReturn) \
117 Handle<InternalReturn> Call(Function f, Handle<Name> name) { \ 117 Handle<InternalReturn> Call(Function f, Handle<Name> name) { \
118 Isolate* isolate = this->isolate(); \ 118 Isolate* isolate = this->isolate(); \
119 RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Function); \
119 VMState<EXTERNAL> state(isolate); \ 120 VMState<EXTERNAL> state(isolate); \
120 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \ 121 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
121 PropertyCallbackInfo<ApiReturn> info(begin()); \ 122 PropertyCallbackInfo<ApiReturn> info(begin()); \
122 LOG(isolate, \ 123 LOG(isolate, \
123 ApiNamedPropertyAccess("interceptor-named-" type, holder(), *name)); \ 124 ApiNamedPropertyAccess("interceptor-named-" type, holder(), *name)); \
124 f(v8::Utils::ToLocal(name), info); \ 125 f(v8::Utils::ToLocal(name), info); \
125 return GetReturnValue<InternalReturn>(isolate); \ 126 return GetReturnValue<InternalReturn>(isolate); \
126 } 127 }
127 128
128 FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME(WRITE_CALL_1_NAME) 129 FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME(WRITE_CALL_1_NAME)
129 130
130 #undef FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME 131 #undef FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME
131 #undef WRITE_CALL_1_NAME 132 #undef WRITE_CALL_1_NAME
132 133
133 #define FOR_EACH_CALLBACK_TABLE_MAPPING_1_INDEX(F) \ 134 #define FOR_EACH_CALLBACK_TABLE_MAPPING_1_INDEX(F) \
134 F(IndexedPropertyGetterCallback, "get", v8::Value, Object) \ 135 F(IndexedPropertyGetterCallback, "get", v8::Value, Object) \
135 F(IndexedPropertyQueryCallback, "has", v8::Integer, Object) \ 136 F(IndexedPropertyQueryCallback, "has", v8::Integer, Object) \
136 F(IndexedPropertyDeleterCallback, "delete", v8::Boolean, Object) 137 F(IndexedPropertyDeleterCallback, "delete", v8::Boolean, Object)
137 138
138 #define WRITE_CALL_1_INDEX(Function, type, ApiReturn, InternalReturn) \ 139 #define WRITE_CALL_1_INDEX(Function, type, ApiReturn, InternalReturn) \
139 Handle<InternalReturn> Call(Function f, uint32_t index) { \ 140 Handle<InternalReturn> Call(Function f, uint32_t index) { \
140 Isolate* isolate = this->isolate(); \ 141 Isolate* isolate = this->isolate(); \
142 RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Function); \
141 VMState<EXTERNAL> state(isolate); \ 143 VMState<EXTERNAL> state(isolate); \
142 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \ 144 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
143 PropertyCallbackInfo<ApiReturn> info(begin()); \ 145 PropertyCallbackInfo<ApiReturn> info(begin()); \
144 LOG(isolate, ApiIndexedPropertyAccess("interceptor-indexed-" type, \ 146 LOG(isolate, ApiIndexedPropertyAccess("interceptor-indexed-" type, \
145 holder(), index)); \ 147 holder(), index)); \
146 f(index, info); \ 148 f(index, info); \
147 return GetReturnValue<InternalReturn>(isolate); \ 149 return GetReturnValue<InternalReturn>(isolate); \
148 } 150 }
149 151
150 FOR_EACH_CALLBACK_TABLE_MAPPING_1_INDEX(WRITE_CALL_1_INDEX) 152 FOR_EACH_CALLBACK_TABLE_MAPPING_1_INDEX(WRITE_CALL_1_INDEX)
151 153
152 #undef FOR_EACH_CALLBACK_TABLE_MAPPING_1_INDEX 154 #undef FOR_EACH_CALLBACK_TABLE_MAPPING_1_INDEX
153 #undef WRITE_CALL_1_INDEX 155 #undef WRITE_CALL_1_INDEX
154 156
155 Handle<Object> Call(GenericNamedPropertySetterCallback f, Handle<Name> name, 157 Handle<Object> Call(GenericNamedPropertySetterCallback f, Handle<Name> name,
156 Handle<Object> value) { 158 Handle<Object> value) {
157 Isolate* isolate = this->isolate(); 159 Isolate* isolate = this->isolate();
160 RuntimeCallTimerScope timer(
161 isolate, &RuntimeCallStats::GenericNamedPropertySetterCallback);
158 VMState<EXTERNAL> state(isolate); 162 VMState<EXTERNAL> state(isolate);
159 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); 163 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
160 PropertyCallbackInfo<v8::Value> info(begin()); 164 PropertyCallbackInfo<v8::Value> info(begin());
161 LOG(isolate, 165 LOG(isolate,
162 ApiNamedPropertyAccess("interceptor-named-set", holder(), *name)); 166 ApiNamedPropertyAccess("interceptor-named-set", holder(), *name));
163 f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info); 167 f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info);
164 return GetReturnValue<Object>(isolate); 168 return GetReturnValue<Object>(isolate);
165 } 169 }
166 170
167 Handle<Object> Call(IndexedPropertySetterCallback f, uint32_t index, 171 Handle<Object> Call(IndexedPropertySetterCallback f, uint32_t index,
168 Handle<Object> value) { 172 Handle<Object> value) {
169 Isolate* isolate = this->isolate(); 173 Isolate* isolate = this->isolate();
174 RuntimeCallTimerScope timer(
175 isolate, &RuntimeCallStats::IndexedPropertySetterCallback);
170 VMState<EXTERNAL> state(isolate); 176 VMState<EXTERNAL> state(isolate);
171 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); 177 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
172 PropertyCallbackInfo<v8::Value> info(begin()); 178 PropertyCallbackInfo<v8::Value> info(begin());
173 LOG(isolate, 179 LOG(isolate,
174 ApiIndexedPropertyAccess("interceptor-indexed-set", holder(), index)); 180 ApiIndexedPropertyAccess("interceptor-indexed-set", holder(), index));
175 f(index, v8::Utils::ToLocal(value), info); 181 f(index, v8::Utils::ToLocal(value), info);
176 return GetReturnValue<Object>(isolate); 182 return GetReturnValue<Object>(isolate);
177 } 183 }
178 184
179 void Call(AccessorNameSetterCallback f, Handle<Name> name, 185 void Call(AccessorNameSetterCallback f, Handle<Name> name,
180 Handle<Object> value) { 186 Handle<Object> value) {
181 Isolate* isolate = this->isolate(); 187 Isolate* isolate = this->isolate();
188 RuntimeCallTimerScope timer(isolate,
189 &RuntimeCallStats::AccessorNameSetterCallback);
182 VMState<EXTERNAL> state(isolate); 190 VMState<EXTERNAL> state(isolate);
183 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); 191 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
184 PropertyCallbackInfo<void> info(begin()); 192 PropertyCallbackInfo<void> info(begin());
185 LOG(isolate, 193 LOG(isolate,
186 ApiNamedPropertyAccess("interceptor-named-set", holder(), *name)); 194 ApiNamedPropertyAccess("interceptor-named-set", holder(), *name));
187 f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info); 195 f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info);
188 } 196 }
189 197
190 private: 198 private:
191 inline JSObject* holder() { 199 inline JSObject* holder() {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 252
245 private: 253 private:
246 internal::Object** argv_; 254 internal::Object** argv_;
247 int argc_; 255 int argc_;
248 }; 256 };
249 257
250 } // namespace internal 258 } // namespace internal
251 } // namespace v8 259 } // namespace v8
252 260
253 #endif // V8_API_ARGUMENTS_H_ 261 #endif // V8_API_ARGUMENTS_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/api-arguments.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698