| 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 |
| 83 Handle<Object> PropertyCallbackArguments::Call(IndexedPropertySetterCallback f, | 101 Handle<Object> PropertyCallbackArguments::Call(IndexedPropertySetterCallback f, |
| 84 uint32_t index, | 102 uint32_t index, |
| 85 Handle<Object> value) { | 103 Handle<Object> value) { |
| 86 Isolate* isolate = this->isolate(); | 104 Isolate* isolate = this->isolate(); |
| 87 RuntimeCallTimerScope timer(isolate, | 105 RuntimeCallTimerScope timer(isolate, |
| 88 &RuntimeCallStats::IndexedPropertySetterCallback); | 106 &RuntimeCallStats::IndexedPropertySetterCallback); |
| 89 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( | 107 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( |
| 90 isolate, &tracing::TraceEventStatsTable::IndexedPropertySetterCallback); | 108 isolate, &tracing::TraceEventStatsTable::IndexedPropertySetterCallback); |
| 91 VMState<EXTERNAL> state(isolate); | 109 VMState<EXTERNAL> state(isolate); |
| 92 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); | 110 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); |
| 93 PropertyCallbackInfo<v8::Value> info(begin()); | 111 PropertyCallbackInfo<v8::Value> info(begin()); |
| 94 LOG(isolate, | 112 LOG(isolate, |
| 95 ApiIndexedPropertyAccess("interceptor-indexed-set", holder(), index)); | 113 ApiIndexedPropertyAccess("interceptor-indexed-set", holder(), index)); |
| 96 f(index, v8::Utils::ToLocal(value), info); | 114 f(index, v8::Utils::ToLocal(value), info); |
| 97 return GetReturnValue<Object>(isolate); | 115 return GetReturnValue<Object>(isolate); |
| 98 } | 116 } |
| 99 | 117 |
| 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 |
| 100 void PropertyCallbackArguments::Call(AccessorNameSetterCallback f, | 135 void PropertyCallbackArguments::Call(AccessorNameSetterCallback f, |
| 101 Handle<Name> name, Handle<Object> value) { | 136 Handle<Name> name, Handle<Object> value) { |
| 102 Isolate* isolate = this->isolate(); | 137 Isolate* isolate = this->isolate(); |
| 103 RuntimeCallTimerScope timer(isolate, | 138 RuntimeCallTimerScope timer(isolate, |
| 104 &RuntimeCallStats::AccessorNameSetterCallback); | 139 &RuntimeCallStats::AccessorNameSetterCallback); |
| 105 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( | 140 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( |
| 106 isolate, &tracing::TraceEventStatsTable::AccessorNameSetterCallback); | 141 isolate, &tracing::TraceEventStatsTable::AccessorNameSetterCallback); |
| 107 VMState<EXTERNAL> state(isolate); | 142 VMState<EXTERNAL> state(isolate); |
| 108 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); | 143 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); |
| 109 PropertyCallbackInfo<void> info(begin()); | 144 PropertyCallbackInfo<void> info(begin()); |
| 110 LOG(isolate, | 145 LOG(isolate, |
| 111 ApiNamedPropertyAccess("interceptor-named-set", holder(), *name)); | 146 ApiNamedPropertyAccess("interceptor-named-set", holder(), *name)); |
| 112 f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info); | 147 f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info); |
| 113 } | 148 } |
| 114 | 149 |
| 115 } // namespace internal | 150 } // namespace internal |
| 116 } // namespace v8 | 151 } // namespace v8 |
| OLD | NEW |