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

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

Issue 691663002: Unfork Sky's trace events (Closed) Base URL: git@github.com:domokit/mojo.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
« no previous file with comments | « sky/engine/bindings/core/v8/V8GCController.cpp ('k') | sky/engine/core/dom/Document.cpp » ('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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 } // namespace 63 } // namespace
64 64
65 v8::Local<v8::Script> V8ScriptRunner::compileScript(const ScriptSourceCode& sour ce, v8::Isolate* isolate, V8CacheOptions cacheOptions) 65 v8::Local<v8::Script> V8ScriptRunner::compileScript(const ScriptSourceCode& sour ce, v8::Isolate* isolate, V8CacheOptions cacheOptions)
66 { 66 {
67 return compileScript(v8String(isolate, source.source()), source.url(), sourc e.startPosition(), isolate, cacheOptions); 67 return compileScript(v8String(isolate, source.source()), source.url(), sourc e.startPosition(), isolate, cacheOptions);
68 } 68 }
69 69
70 v8::Local<v8::Script> V8ScriptRunner::compileScript(v8::Handle<v8::String> code, const String& fileName, const TextPosition& scriptStartPosition, v8::Isolate* i solate, V8CacheOptions cacheOptions) 70 v8::Local<v8::Script> V8ScriptRunner::compileScript(v8::Handle<v8::String> code, const String& fileName, const TextPosition& scriptStartPosition, v8::Isolate* i solate, V8CacheOptions cacheOptions)
71 { 71 {
72 TRACE_EVENT1("v8", "v8.compile", "fileName", fileName.utf8()); 72 TRACE_EVENT1("v8", "v8.compile", "fileName", fileName.utf8().data());
73 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Compile"); 73 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Compile");
74 74
75 // NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at 75 // NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at
76 // 1, whereas v8 starts at 0. 76 // 1, whereas v8 starts at 0.
77 v8::Handle<v8::String> name = v8String(isolate, fileName); 77 v8::Handle<v8::String> name = v8String(isolate, fileName);
78 v8::Handle<v8::Integer> line = v8::Integer::New(isolate, scriptStartPosition .m_line.zeroBasedInt()); 78 v8::Handle<v8::Integer> line = v8::Integer::New(isolate, scriptStartPosition .m_line.zeroBasedInt());
79 v8::Handle<v8::Integer> column = v8::Integer::New(isolate, scriptStartPositi on.m_column.zeroBasedInt()); 79 v8::Handle<v8::Integer> column = v8::Integer::New(isolate, scriptStartPositi on.m_column.zeroBasedInt());
80 v8::ScriptOrigin origin(name, line, column, v8::True(isolate)); 80 v8::ScriptOrigin origin(name, line, column, v8::True(isolate));
81 81
82 v8::ScriptCompiler::Source source(code, origin); 82 v8::ScriptCompiler::Source source(code, origin);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 auto arguments = module.resolvedDependencies; 226 auto arguments = module.resolvedDependencies;
227 arguments.append(module.receiver); 227 arguments.append(module.receiver);
228 228
229 RELEASE_ASSERT(scriptResult->IsObject()); 229 RELEASE_ASSERT(scriptResult->IsObject());
230 scriptResult.As<v8::Object>()->CallAsFunction( 230 scriptResult.As<v8::Object>()->CallAsFunction(
231 module.receiver, arguments.size(), arguments.data()); 231 module.receiver, arguments.size(), arguments.data());
232 crashIfV8IsDead(); 232 crashIfV8IsDead();
233 } 233 }
234 234
235 } // namespace blink 235 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/bindings/core/v8/V8GCController.cpp ('k') | sky/engine/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698