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

Side by Side Diff: sky/engine/bindings/core/v8/V8ScriptRunner.cpp

Issue 754463004: Remove ScriptPreprocessor (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « sky/engine/bindings/core/v8/V8ScriptRunner.h ('k') | sky/engine/v8_inspector/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « sky/engine/bindings/core/v8/V8ScriptRunner.h ('k') | sky/engine/v8_inspector/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698