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

Side by Side Diff: src/api.cc

Issue 2650883002: Reland: [Compiler] Enable handles created during parsing and scope analysis to be deferred. (Closed)
Patch Set: Remove unused variable Created 3 years, 10 months 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 | « src/api.h ('k') | src/compilation-info.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 2400 matching lines...) Expand 10 before | Expand all | Expand 10 after
2411 script->set_column_offset( 2411 script->set_column_offset(
2412 static_cast<int>(origin.ResourceColumnOffset()->Value())); 2412 static_cast<int>(origin.ResourceColumnOffset()->Value()));
2413 } 2413 }
2414 script->set_origin_options(origin.Options()); 2414 script->set_origin_options(origin.Options());
2415 if (!origin.SourceMapUrl().IsEmpty()) { 2415 if (!origin.SourceMapUrl().IsEmpty()) {
2416 script->set_source_mapping_url( 2416 script->set_source_mapping_url(
2417 *Utils::OpenHandle(*(origin.SourceMapUrl()))); 2417 *Utils::OpenHandle(*(origin.SourceMapUrl())));
2418 } 2418 }
2419 2419
2420 source->info->set_script(script); 2420 source->info->set_script(script);
2421 if (source->info->literal() == nullptr) {
2422 source->parser->ReportErrors(isolate, script);
2423 }
2424 source->parser->UpdateStatistics(isolate, script);
2421 2425
2422 // Do the parsing tasks which need to be done on the main thread. This will 2426 i::DeferredHandleScope deferred_handle_scope(isolate);
2423 // also handle parse errors. 2427 {
2424 source->parser->Internalize(isolate, script, 2428 // Internalize AST values on the main thread.
2425 source->info->literal() == nullptr); 2429 source->info->ReopenHandlesInNewHandleScope();
2426 source->parser->HandleSourceURLComments(isolate, script); 2430 source->info->ast_value_factory()->Internalize(isolate);
2431 source->parser->HandleSourceURLComments(isolate, script);
2432 }
2433 source->info->set_deferred_handles(deferred_handle_scope.Detach());
2427 2434
2428 i::Handle<i::SharedFunctionInfo> result; 2435 i::Handle<i::SharedFunctionInfo> result;
2429 if (source->info->literal() != nullptr) { 2436 if (source->info->literal() != nullptr) {
2430 // Parsing has succeeded. 2437 // Parsing has succeeded.
2431 result = i::Compiler::GetSharedFunctionInfoForStreamedScript( 2438 result = i::Compiler::GetSharedFunctionInfoForStreamedScript(
2432 script, source->info.get(), str->length()); 2439 script, source->info.get(), str->length());
2433 } 2440 }
2434 has_pending_exception = result.is_null(); 2441 has_pending_exception = result.is_null();
2435 if (has_pending_exception) isolate->ReportPendingMessages(); 2442 if (has_pending_exception) isolate->ReportPendingMessages();
2436 2443
(...skipping 7703 matching lines...) Expand 10 before | Expand all | Expand 10 after
10140 Address callback_address = 10147 Address callback_address =
10141 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10148 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10142 VMState<EXTERNAL> state(isolate); 10149 VMState<EXTERNAL> state(isolate);
10143 ExternalCallbackScope call_scope(isolate, callback_address); 10150 ExternalCallbackScope call_scope(isolate, callback_address);
10144 callback(info); 10151 callback(info);
10145 } 10152 }
10146 10153
10147 10154
10148 } // namespace internal 10155 } // namespace internal
10149 } // namespace v8 10156 } // namespace v8
OLDNEW
« no previous file with comments | « src/api.h ('k') | src/compilation-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698