| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 cacheTag = tagForParserCache(); | 154 cacheTag = tagForParserCache(); |
| 155 script = resource->cachedMetadata(cacheTag) | 155 script = resource->cachedMetadata(cacheTag) |
| 156 ? compileAndConsumeCache(isolate, code, origin, resource, v8::Sc
riptCompiler::kConsumeParserCache, cacheTag) | 156 ? compileAndConsumeCache(isolate, code, origin, resource, v8::Sc
riptCompiler::kConsumeParserCache, cacheTag) |
| 157 : compileAndProduceCache(isolate, code, origin, resource, v8::Sc
riptCompiler::kProduceParserCache, cacheTag, Resource::CacheLocally); | 157 : compileAndProduceCache(isolate, code, origin, resource, v8::Sc
riptCompiler::kProduceParserCache, cacheTag, Resource::CacheLocally); |
| 158 break; | 158 break; |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 return script; | 161 return script; |
| 162 } | 162 } |
| 163 | 163 |
| 164 v8::Local<v8::Value> V8ScriptRunner::runCompiledScript(v8::Handle<v8::Script> sc
ript, ExecutionContext* context, v8::Isolate* isolate) | 164 v8::Local<v8::Value> V8ScriptRunner::runCompiledScript(v8::Isolate* isolate, v8:
:Handle<v8::Script> script, ExecutionContext* context) |
| 165 { | 165 { |
| 166 if (script.IsEmpty()) | 166 if (script.IsEmpty()) |
| 167 return v8::Local<v8::Value>(); | 167 return v8::Local<v8::Value>(); |
| 168 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); | 168 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); |
| 169 TRACE_EVENT1("v8", "v8.run", "fileName", TRACE_STR_COPY(*v8::String::Utf8Val
ue(script->GetUnboundScript()->GetScriptName()))); | 169 TRACE_EVENT1("v8", "v8.run", "fileName", TRACE_STR_COPY(*v8::String::Utf8Val
ue(script->GetUnboundScript()->GetScriptName()))); |
| 170 | 170 |
| 171 if (V8RecursionScope::recursionLevel(isolate) >= kMaxRecursionDepth) | 171 if (V8RecursionScope::recursionLevel(isolate) >= kMaxRecursionDepth) |
| 172 return throwStackOverflowExceptionIfNeeded(isolate); | 172 return throwStackOverflowExceptionIfNeeded(isolate); |
| 173 | 173 |
| 174 RELEASE_ASSERT(!context->isIteratingOverObservers()); | 174 RELEASE_ASSERT(!context->isIteratingOverObservers()); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 196 return v8::Local<v8::Value>(); | 196 return v8::Local<v8::Value>(); |
| 197 | 197 |
| 198 TRACE_EVENT0("v8", "v8.run"); | 198 TRACE_EVENT0("v8", "v8.run"); |
| 199 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); | 199 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); |
| 200 V8RecursionScope::MicrotaskSuppression recursionScope(isolate); | 200 V8RecursionScope::MicrotaskSuppression recursionScope(isolate); |
| 201 v8::Local<v8::Value> result = script->Run(); | 201 v8::Local<v8::Value> result = script->Run(); |
| 202 crashIfV8IsDead(); | 202 crashIfV8IsDead(); |
| 203 return result; | 203 return result; |
| 204 } | 204 } |
| 205 | 205 |
| 206 v8::Local<v8::Value> V8ScriptRunner::runCompiledInternalScript(v8::Handle<v8::Sc
ript> script, v8::Isolate* isolate) | 206 v8::Local<v8::Value> V8ScriptRunner::runCompiledInternalScript(v8::Isolate* isol
ate, v8::Handle<v8::Script> script) |
| 207 { | 207 { |
| 208 TRACE_EVENT0("v8", "v8.run"); | 208 TRACE_EVENT0("v8", "v8.run"); |
| 209 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); | 209 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); |
| 210 V8RecursionScope::MicrotaskSuppression recursionScope(isolate); | 210 V8RecursionScope::MicrotaskSuppression recursionScope(isolate); |
| 211 v8::Local<v8::Value> result = script->Run(); | 211 v8::Local<v8::Value> result = script->Run(); |
| 212 crashIfV8IsDead(); | 212 crashIfV8IsDead(); |
| 213 return result; | 213 return result; |
| 214 } | 214 } |
| 215 | 215 |
| 216 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) | 216 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) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 { | 290 { |
| 291 return StringHash::hash(v8::V8::GetVersion()) * 2; | 291 return StringHash::hash(v8::V8::GetVersion()) * 2; |
| 292 } | 292 } |
| 293 | 293 |
| 294 unsigned V8ScriptRunner::tagForCodeCache() | 294 unsigned V8ScriptRunner::tagForCodeCache() |
| 295 { | 295 { |
| 296 return StringHash::hash(v8::V8::GetVersion()) * 2 + 1; | 296 return StringHash::hash(v8::V8::GetVersion()) * 2 + 1; |
| 297 } | 297 } |
| 298 | 298 |
| 299 } // namespace blink | 299 } // namespace blink |
| OLD | NEW |