| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 v8::Local<v8::Value> V8ScriptRunner::callInternalFunction(v8::Handle<v8::Functio
n> function, v8::Handle<v8::Value> receiver, int argc, v8::Handle<v8::Value> arg
s[], v8::Isolate* isolate) | 145 v8::Local<v8::Value> V8ScriptRunner::callInternalFunction(v8::Handle<v8::Functio
n> function, v8::Handle<v8::Value> receiver, int argc, v8::Handle<v8::Value> arg
s[], v8::Isolate* isolate) |
| 146 { | 146 { |
| 147 TRACE_EVENT0("v8", "v8.callFunction"); | 147 TRACE_EVENT0("v8", "v8.callFunction"); |
| 148 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); | 148 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); |
| 149 V8RecursionScope::MicrotaskSuppression recursionScope(isolate); | 149 V8RecursionScope::MicrotaskSuppression recursionScope(isolate); |
| 150 v8::Local<v8::Value> result = function->Call(receiver, argc, args); | 150 v8::Local<v8::Value> result = function->Call(receiver, argc, args); |
| 151 crashIfV8IsDead(); | 151 crashIfV8IsDead(); |
| 152 return result; | 152 return result; |
| 153 } | 153 } |
| 154 | 154 |
| 155 v8::Local<v8::Value> V8ScriptRunner::callAsFunction(v8::Isolate* isolate, v8::Ha
ndle<v8::Object> object, v8::Handle<v8::Value> receiver, int argc, v8::Handle<v8
::Value> args[]) | |
| 156 { | |
| 157 TRACE_EVENT0("v8", "v8.callFunction"); | |
| 158 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); | |
| 159 | |
| 160 V8RecursionScope::MicrotaskSuppression recursionScope(isolate); | |
| 161 v8::Local<v8::Value> result = object->CallAsFunction(receiver, argc, args); | |
| 162 crashIfV8IsDead(); | |
| 163 return result; | |
| 164 } | |
| 165 | |
| 166 v8::Local<v8::Object> V8ScriptRunner::instantiateObject(v8::Isolate* isolate, v8
::Handle<v8::ObjectTemplate> objectTemplate) | 155 v8::Local<v8::Object> V8ScriptRunner::instantiateObject(v8::Isolate* isolate, v8
::Handle<v8::ObjectTemplate> objectTemplate) |
| 167 { | 156 { |
| 168 TRACE_EVENT0("v8", "v8.newInstance"); | 157 TRACE_EVENT0("v8", "v8.newInstance"); |
| 169 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); | 158 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); |
| 170 | 159 |
| 171 V8RecursionScope::MicrotaskSuppression scope(isolate); | 160 V8RecursionScope::MicrotaskSuppression scope(isolate); |
| 172 v8::Local<v8::Object> result = objectTemplate->NewInstance(); | 161 v8::Local<v8::Object> result = objectTemplate->NewInstance(); |
| 173 crashIfV8IsDead(); | 162 crashIfV8IsDead(); |
| 174 return result; | 163 return result; |
| 175 } | 164 } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 auto arguments = module.resolvedDependencies; | 217 auto arguments = module.resolvedDependencies; |
| 229 arguments.append(module.moduleObject); | 218 arguments.append(module.moduleObject); |
| 230 | 219 |
| 231 RELEASE_ASSERT(scriptResult->IsObject()); | 220 RELEASE_ASSERT(scriptResult->IsObject()); |
| 232 scriptResult.As<v8::Object>()->CallAsFunction( | 221 scriptResult.As<v8::Object>()->CallAsFunction( |
| 233 v8::Null(isolate), arguments.size(), arguments.data()); | 222 v8::Null(isolate), arguments.size(), arguments.data()); |
| 234 crashIfV8IsDead(); | 223 crashIfV8IsDead(); |
| 235 } | 224 } |
| 236 | 225 |
| 237 } // namespace blink | 226 } // namespace blink |
| OLD | NEW |