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

Side by Side Diff: src/background-parsing-task.cc

Issue 913183005: Inline the ParseInfo structure as parameters to the Parser constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « no previous file | src/parser.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/background-parsing-task.h" 5 #include "src/background-parsing-task.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 9
10 BackgroundParsingTask::BackgroundParsingTask( 10 BackgroundParsingTask::BackgroundParsingTask(
(...skipping 27 matching lines...) Expand all
38 DisallowHeapAllocation no_allocation; 38 DisallowHeapAllocation no_allocation;
39 DisallowHandleAllocation no_handles; 39 DisallowHandleAllocation no_handles;
40 DisallowHandleDereference no_deref; 40 DisallowHandleDereference no_deref;
41 41
42 ScriptData* script_data = NULL; 42 ScriptData* script_data = NULL;
43 if (options_ == ScriptCompiler::kProduceParserCache || 43 if (options_ == ScriptCompiler::kProduceParserCache ||
44 options_ == ScriptCompiler::kProduceCodeCache) { 44 options_ == ScriptCompiler::kProduceCodeCache) {
45 source_->info->SetCachedData(&script_data, options_); 45 source_->info->SetCachedData(&script_data, options_);
46 } 46 }
47 47
48 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit) - stack_size_ * KB; 48 uintptr_t stack_limit =
49 Parser::ParseInfo parse_info = {limit, source_->hash_seed, 49 reinterpret_cast<uintptr_t>(&stack_limit) - stack_size_ * KB;
50 &source_->unicode_cache};
51 50
52 // Parser needs to stay alive for finalizing the parsing on the main 51 // Parser needs to stay alive for finalizing the parsing on the main
53 // thread. Passing &parse_info is OK because Parser doesn't store it. 52 // thread. Passing &parse_info is OK because Parser doesn't store it.
54 source_->parser.Reset(new Parser(source_->info.get(), &parse_info)); 53 source_->parser.Reset(new Parser(source_->info.get(), stack_limit,
54 source_->hash_seed,
55 &source_->unicode_cache));
55 source_->parser->set_allow_lazy(source_->allow_lazy); 56 source_->parser->set_allow_lazy(source_->allow_lazy);
56 source_->parser->ParseOnBackground(); 57 source_->parser->ParseOnBackground();
57 58
58 if (script_data != NULL) { 59 if (script_data != NULL) {
59 source_->cached_data.Reset(new ScriptCompiler::CachedData( 60 source_->cached_data.Reset(new ScriptCompiler::CachedData(
60 script_data->data(), script_data->length(), 61 script_data->data(), script_data->length(),
61 ScriptCompiler::CachedData::BufferOwned)); 62 ScriptCompiler::CachedData::BufferOwned));
62 script_data->ReleaseDataOwnership(); 63 script_data->ReleaseDataOwnership();
63 delete script_data; 64 delete script_data;
64 } 65 }
65 } 66 }
66 } 67 }
67 } // namespace v8::internal 68 } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698