Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(589)

Side by Side Diff: Source/bindings/core/v8/V8ScriptRunner.cpp

Issue 682883003: Move the v8::Isolate* parameter to the first parameter of various binding methods in third_party/We… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8ScriptRunner.h ('k') | Source/bindings/core/v8/WorkerScriptController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698