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

Side by Side Diff: src/parsing/preparse-data.cc

Issue 2657413002: No need to collect literal counts.
Patch Set: Rebase. 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/parsing/preparse-data.h ('k') | src/parsing/preparser.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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/parsing/preparse-data.h" 5 #include "src/parsing/preparse-data.h"
6 #include "src/base/hashmap.h" 6 #include "src/base/hashmap.h"
7 #include "src/base/logging.h" 7 #include "src/base/logging.h"
8 #include "src/globals.h" 8 #include "src/globals.h"
9 #include "src/objects-inl.h" 9 #include "src/objects-inl.h"
10 #include "src/parsing/parser.h" 10 #include "src/parsing/parser.h"
11 #include "src/parsing/preparse-data-format.h" 11 #include "src/parsing/preparse-data-format.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 void ParserLogger::LogFunction(int start, int end, int num_parameters, 16 void ParserLogger::LogFunction(int start, int end, int num_parameters,
17 int function_length, 17 int function_length,
18 bool has_duplicate_parameters, int literals, 18 bool has_duplicate_parameters, int properties,
19 int properties, LanguageMode language_mode, 19 LanguageMode language_mode,
20 bool uses_super_property, bool calls_eval, 20 bool uses_super_property, bool calls_eval,
21 int num_inner_functions) { 21 int num_inner_functions) {
22 function_store_.Add(start); 22 function_store_.Add(start);
23 function_store_.Add(end); 23 function_store_.Add(end);
24 function_store_.Add(num_parameters); 24 function_store_.Add(num_parameters);
25 function_store_.Add(function_length); 25 function_store_.Add(function_length);
26 function_store_.Add(literals);
27 function_store_.Add(properties); 26 function_store_.Add(properties);
28 function_store_.Add( 27 function_store_.Add(
29 FunctionEntry::EncodeFlags(language_mode, uses_super_property, calls_eval, 28 FunctionEntry::EncodeFlags(language_mode, uses_super_property, calls_eval,
30 has_duplicate_parameters)); 29 has_duplicate_parameters));
31 function_store_.Add(num_inner_functions); 30 function_store_.Add(num_inner_functions);
32 } 31 }
33 32
34 ParserLogger::ParserLogger() { 33 ParserLogger::ParserLogger() {
35 preamble_[PreparseDataConstants::kMagicOffset] = 34 preamble_[PreparseDataConstants::kMagicOffset] =
36 PreparseDataConstants::kMagicNumber; 35 PreparseDataConstants::kMagicNumber;
(...skipping 20 matching lines...) Expand all
57 DCHECK(IsAligned(reinterpret_cast<intptr_t>(data), kPointerAlignment)); 56 DCHECK(IsAligned(reinterpret_cast<intptr_t>(data), kPointerAlignment));
58 ScriptData* result = new ScriptData(reinterpret_cast<byte*>(data), 57 ScriptData* result = new ScriptData(reinterpret_cast<byte*>(data),
59 total_size * sizeof(unsigned)); 58 total_size * sizeof(unsigned));
60 result->AcquireDataOwnership(); 59 result->AcquireDataOwnership();
61 return result; 60 return result;
62 } 61 }
63 62
64 63
65 } // namespace internal 64 } // namespace internal
66 } // namespace v8. 65 } // namespace v8.
OLDNEW
« no previous file with comments | « src/parsing/preparse-data.h ('k') | src/parsing/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698