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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 v8::Isolate* isolate, | 458 v8::Isolate* isolate, |
459 ScriptResource* resource, | 459 ScriptResource* resource, |
460 ScriptStreamer* streamer, | 460 ScriptStreamer* streamer, |
461 CachedMetadataHandler* cache_handler, | 461 CachedMetadataHandler* cache_handler, |
462 AccessControlStatus access_control_status, | 462 AccessControlStatus access_control_status, |
463 V8CacheOptions cache_options) { | 463 V8CacheOptions cache_options) { |
464 TRACE_EVENT2( | 464 TRACE_EVENT2( |
465 "v8,devtools.timeline", "v8.compile", "fileName", file_name.Utf8(), | 465 "v8,devtools.timeline", "v8.compile", "fileName", file_name.Utf8(), |
466 "data", | 466 "data", |
467 InspectorCompileScriptEvent::Data(file_name, script_start_position)); | 467 InspectorCompileScriptEvent::Data(file_name, script_start_position)); |
| 468 // TODO(maxlg): probe will use a execution context once |
| 469 // DocumentWriteEvaluator::EnsureEvaluationContext provide script state, see |
| 470 // https://crbug.com/746961. |
| 471 probe::V8Compile probe(nullptr, file_name, |
| 472 script_start_position.line_.ZeroBasedInt(), |
| 473 script_start_position.column_.ZeroBasedInt()); |
468 | 474 |
469 DCHECK(!streamer || resource); | 475 DCHECK(!streamer || resource); |
470 DCHECK(!resource || resource->CacheHandler() == cache_handler); | 476 DCHECK(!resource || resource->CacheHandler() == cache_handler); |
471 | 477 |
472 // NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at | 478 // NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at |
473 // 1, whereas v8 starts at 0. | 479 // 1, whereas v8 starts at 0. |
474 v8::ScriptOrigin origin( | 480 v8::ScriptOrigin origin( |
475 V8String(isolate, file_name), | 481 V8String(isolate, file_name), |
476 v8::Integer::New(isolate, script_start_position.line_.ZeroBasedInt()), | 482 v8::Integer::New(isolate, script_start_position.line_.ZeroBasedInt()), |
477 v8::Integer::New(isolate, script_start_position.column_.ZeroBasedInt()), | 483 v8::Integer::New(isolate, script_start_position.column_.ZeroBasedInt()), |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 if (!context->GetExtrasBindingObject() | 788 if (!context->GetExtrasBindingObject() |
783 ->Get(context, V8AtomicString(isolate, name)) | 789 ->Get(context, V8AtomicString(isolate, name)) |
784 .ToLocal(&function_value)) | 790 .ToLocal(&function_value)) |
785 return v8::MaybeLocal<v8::Value>(); | 791 return v8::MaybeLocal<v8::Value>(); |
786 v8::Local<v8::Function> function = function_value.As<v8::Function>(); | 792 v8::Local<v8::Function> function = function_value.As<v8::Function>(); |
787 return V8ScriptRunner::CallInternalFunction(function, v8::Undefined(isolate), | 793 return V8ScriptRunner::CallInternalFunction(function, v8::Undefined(isolate), |
788 num_args, args, isolate); | 794 num_args, args, isolate); |
789 } | 795 } |
790 | 796 |
791 } // namespace blink | 797 } // namespace blink |
OLD | NEW |