| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 if (result.IsEmpty()) | 177 if (result.IsEmpty()) |
| 178 return v8::Local<v8::Value>(); | 178 return v8::Local<v8::Value>(); |
| 179 | 179 |
| 180 crashIfV8IsDead(); | 180 crashIfV8IsDead(); |
| 181 return result; | 181 return result; |
| 182 } | 182 } |
| 183 | 183 |
| 184 v8::Local<v8::Value> V8ScriptRunner::compileAndRunInternalScript(v8::Handle<v8::
String> source, v8::Isolate* isolate, const String& fileName, const TextPosition
& scriptStartPosition) | 184 v8::Local<v8::Value> V8ScriptRunner::compileAndRunInternalScript(v8::Handle<v8::
String> source, v8::Isolate* isolate, const String& fileName, const TextPosition
& scriptStartPosition) |
| 185 { | 185 { |
| 186 TRACE_EVENT0("v8", "v8.run"); | |
| 187 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); | |
| 188 v8::Handle<v8::Script> script = V8ScriptRunner::compileScript(source, fileNa
me, scriptStartPosition, 0, isolate); | 186 v8::Handle<v8::Script> script = V8ScriptRunner::compileScript(source, fileNa
me, scriptStartPosition, 0, isolate); |
| 189 if (script.IsEmpty()) | 187 if (script.IsEmpty()) |
| 190 return v8::Local<v8::Value>(); | 188 return v8::Local<v8::Value>(); |
| 191 | 189 |
| 190 TRACE_EVENT0("v8", "v8.run"); |
| 191 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); |
| 192 V8RecursionScope::MicrotaskSuppression recursionScope(isolate); | 192 V8RecursionScope::MicrotaskSuppression recursionScope(isolate); |
| 193 v8::Local<v8::Value> result = script->Run(); | 193 v8::Local<v8::Value> result = script->Run(); |
| 194 crashIfV8IsDead(); | 194 crashIfV8IsDead(); |
| 195 return result; |
| 196 } |
| 197 |
| 198 v8::Local<v8::Value> V8ScriptRunner::runCompiledInternalScript(v8::Handle<v8::Sc
ript> script, v8::Isolate* isolate) |
| 199 { |
| 200 TRACE_EVENT0("v8", "v8.run"); |
| 201 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); |
| 202 V8RecursionScope::MicrotaskSuppression recursionScope(isolate); |
| 203 v8::Local<v8::Value> result = script->Run(); |
| 204 crashIfV8IsDead(); |
| 195 return result; | 205 return result; |
| 196 } | 206 } |
| 197 | 207 |
| 198 v8::Local<v8::Value> V8ScriptRunner::callFunction(v8::Handle<v8::Function> funct
ion, ExecutionContext* context, v8::Handle<v8::Value> receiver, int argc, v8::Ha
ndle<v8::Value> args[], v8::Isolate* isolate) | 208 v8::Local<v8::Value> V8ScriptRunner::callFunction(v8::Handle<v8::Function> funct
ion, ExecutionContext* context, v8::Handle<v8::Value> receiver, int argc, v8::Ha
ndle<v8::Value> args[], v8::Isolate* isolate) |
| 199 { | 209 { |
| 200 TRACE_EVENT0("v8", "v8.callFunction"); | 210 TRACE_EVENT0("v8", "v8.callFunction"); |
| 201 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); | 211 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); |
| 202 | 212 |
| 203 if (V8RecursionScope::recursionLevel(isolate) >= kMaxRecursionDepth) | 213 if (V8RecursionScope::recursionLevel(isolate) >= kMaxRecursionDepth) |
| 204 return throwStackOverflowExceptionIfNeeded(isolate); | 214 return throwStackOverflowExceptionIfNeeded(isolate); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 { | 268 { |
| 259 TRACE_EVENT0("v8", "v8.newInstance"); | 269 TRACE_EVENT0("v8", "v8.newInstance"); |
| 260 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); | 270 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); |
| 261 V8RecursionScope scope(isolate, context); | 271 V8RecursionScope scope(isolate, context); |
| 262 v8::Local<v8::Object> result = function->NewInstance(argc, argv); | 272 v8::Local<v8::Object> result = function->NewInstance(argc, argv); |
| 263 crashIfV8IsDead(); | 273 crashIfV8IsDead(); |
| 264 return result; | 274 return result; |
| 265 } | 275 } |
| 266 | 276 |
| 267 } // namespace blink | 277 } // namespace blink |
| OLD | NEW |