OLD | NEW |
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 #include "src/api-arguments.h" | 5 #include "src/api-arguments.h" |
6 | 6 |
7 #include "src/tracing/trace-event.h" | 7 #include "src/tracing/trace-event.h" |
8 #include "src/vm-state-inl.h" | 8 #include "src/vm-state-inl.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 &tracing::TraceEventStatsTable::GenericNamedPropertySetterCallback); | 73 &tracing::TraceEventStatsTable::GenericNamedPropertySetterCallback); |
74 VMState<EXTERNAL> state(isolate); | 74 VMState<EXTERNAL> state(isolate); |
75 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); | 75 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); |
76 PropertyCallbackInfo<v8::Value> info(begin()); | 76 PropertyCallbackInfo<v8::Value> info(begin()); |
77 LOG(isolate, | 77 LOG(isolate, |
78 ApiNamedPropertyAccess("interceptor-named-set", holder(), *name)); | 78 ApiNamedPropertyAccess("interceptor-named-set", holder(), *name)); |
79 f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info); | 79 f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info); |
80 return GetReturnValue<Object>(isolate); | 80 return GetReturnValue<Object>(isolate); |
81 } | 81 } |
82 | 82 |
83 Handle<Object> PropertyCallbackArguments::Call( | |
84 GenericNamedPropertyDefinerCallback f, Handle<Name> name, | |
85 const v8::PropertyDescriptor& desc) { | |
86 Isolate* isolate = this->isolate(); | |
87 RuntimeCallTimerScope timer( | |
88 isolate, &RuntimeCallStats::GenericNamedPropertyDefinerCallback); | |
89 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( | |
90 isolate, | |
91 &tracing::TraceEventStatsTable::GenericNamedPropertyDefinerCallback); | |
92 VMState<EXTERNAL> state(isolate); | |
93 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); | |
94 PropertyCallbackInfo<v8::Value> info(begin()); | |
95 LOG(isolate, | |
96 ApiNamedPropertyAccess("interceptor-named-define", holder(), *name)); | |
97 f(v8::Utils::ToLocal(name), desc, info); | |
98 return GetReturnValue<Object>(isolate); | |
99 } | |
100 | |
101 Handle<Object> PropertyCallbackArguments::Call(IndexedPropertySetterCallback f, | 83 Handle<Object> PropertyCallbackArguments::Call(IndexedPropertySetterCallback f, |
102 uint32_t index, | 84 uint32_t index, |
103 Handle<Object> value) { | 85 Handle<Object> value) { |
104 Isolate* isolate = this->isolate(); | 86 Isolate* isolate = this->isolate(); |
105 RuntimeCallTimerScope timer(isolate, | 87 RuntimeCallTimerScope timer(isolate, |
106 &RuntimeCallStats::IndexedPropertySetterCallback); | 88 &RuntimeCallStats::IndexedPropertySetterCallback); |
107 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( | 89 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( |
108 isolate, &tracing::TraceEventStatsTable::IndexedPropertySetterCallback); | 90 isolate, &tracing::TraceEventStatsTable::IndexedPropertySetterCallback); |
109 VMState<EXTERNAL> state(isolate); | 91 VMState<EXTERNAL> state(isolate); |
110 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); | 92 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); |
111 PropertyCallbackInfo<v8::Value> info(begin()); | 93 PropertyCallbackInfo<v8::Value> info(begin()); |
112 LOG(isolate, | 94 LOG(isolate, |
113 ApiIndexedPropertyAccess("interceptor-indexed-set", holder(), index)); | 95 ApiIndexedPropertyAccess("interceptor-indexed-set", holder(), index)); |
114 f(index, v8::Utils::ToLocal(value), info); | 96 f(index, v8::Utils::ToLocal(value), info); |
115 return GetReturnValue<Object>(isolate); | 97 return GetReturnValue<Object>(isolate); |
116 } | 98 } |
117 | 99 |
118 Handle<Object> PropertyCallbackArguments::Call( | |
119 IndexedPropertyDefinerCallback f, uint32_t index, | |
120 const v8::PropertyDescriptor& desc) { | |
121 Isolate* isolate = this->isolate(); | |
122 RuntimeCallTimerScope timer( | |
123 isolate, &RuntimeCallStats::IndexedPropertyDefinerCallback); | |
124 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( | |
125 isolate, &tracing::TraceEventStatsTable::IndexedPropertyDefinerCallback); | |
126 VMState<EXTERNAL> state(isolate); | |
127 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); | |
128 PropertyCallbackInfo<v8::Value> info(begin()); | |
129 LOG(isolate, | |
130 ApiIndexedPropertyAccess("interceptor-indexed-define", holder(), index)); | |
131 f(index, desc, info); | |
132 return GetReturnValue<Object>(isolate); | |
133 } | |
134 | |
135 void PropertyCallbackArguments::Call(AccessorNameSetterCallback f, | 100 void PropertyCallbackArguments::Call(AccessorNameSetterCallback f, |
136 Handle<Name> name, Handle<Object> value) { | 101 Handle<Name> name, Handle<Object> value) { |
137 Isolate* isolate = this->isolate(); | 102 Isolate* isolate = this->isolate(); |
138 RuntimeCallTimerScope timer(isolate, | 103 RuntimeCallTimerScope timer(isolate, |
139 &RuntimeCallStats::AccessorNameSetterCallback); | 104 &RuntimeCallStats::AccessorNameSetterCallback); |
140 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( | 105 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( |
141 isolate, &tracing::TraceEventStatsTable::AccessorNameSetterCallback); | 106 isolate, &tracing::TraceEventStatsTable::AccessorNameSetterCallback); |
142 VMState<EXTERNAL> state(isolate); | 107 VMState<EXTERNAL> state(isolate); |
143 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); | 108 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); |
144 PropertyCallbackInfo<void> info(begin()); | 109 PropertyCallbackInfo<void> info(begin()); |
145 LOG(isolate, | 110 LOG(isolate, |
146 ApiNamedPropertyAccess("interceptor-named-set", holder(), *name)); | 111 ApiNamedPropertyAccess("interceptor-named-set", holder(), *name)); |
147 f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info); | 112 f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info); |
148 } | 113 } |
149 | 114 |
150 } // namespace internal | 115 } // namespace internal |
151 } // namespace v8 | 116 } // namespace v8 |
OLD | NEW |