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

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

Issue 2472063002: Preparse lazy function parameters (Closed)
Patch Set: IsArrowFunction Created 4 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 | « src/parsing/preparse-data.h ('k') | src/parsing/preparse-data-format.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/parsing/parser.h" 9 #include "src/parsing/parser.h"
10 #include "src/parsing/preparse-data-format.h" 10 #include "src/parsing/preparse-data-format.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 14
15 void CompleteParserRecorder::LogFunction(
16 int start, int end, int num_parameters, int function_length,
17 bool has_duplicate_parameters, int literals, int properties,
18 LanguageMode language_mode, bool uses_super_property, bool calls_eval) {
19 function_store_.Add(start);
20 function_store_.Add(end);
21 function_store_.Add(num_parameters);
22 function_store_.Add(function_length);
23 function_store_.Add(literals);
24 function_store_.Add(properties);
25 function_store_.Add(
26 FunctionEntry::EncodeFlags(language_mode, uses_super_property, calls_eval,
27 has_duplicate_parameters));
28 }
15 29
16 CompleteParserRecorder::CompleteParserRecorder() { 30 CompleteParserRecorder::CompleteParserRecorder() {
17 preamble_[PreparseDataConstants::kMagicOffset] = 31 preamble_[PreparseDataConstants::kMagicOffset] =
18 PreparseDataConstants::kMagicNumber; 32 PreparseDataConstants::kMagicNumber;
19 preamble_[PreparseDataConstants::kVersionOffset] = 33 preamble_[PreparseDataConstants::kVersionOffset] =
20 PreparseDataConstants::kCurrentVersion; 34 PreparseDataConstants::kCurrentVersion;
21 preamble_[PreparseDataConstants::kHasErrorOffset] = false; 35 preamble_[PreparseDataConstants::kHasErrorOffset] = false;
22 preamble_[PreparseDataConstants::kFunctionsSizeOffset] = 0; 36 preamble_[PreparseDataConstants::kFunctionsSizeOffset] = 0;
23 preamble_[PreparseDataConstants::kSizeOffset] = 0; 37 preamble_[PreparseDataConstants::kSizeOffset] = 0;
24 DCHECK_EQ(5, PreparseDataConstants::kHeaderSize); 38 DCHECK_EQ(5, PreparseDataConstants::kHeaderSize);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 DCHECK(IsAligned(reinterpret_cast<intptr_t>(data), kPointerAlignment)); 85 DCHECK(IsAligned(reinterpret_cast<intptr_t>(data), kPointerAlignment));
72 ScriptData* result = new ScriptData(reinterpret_cast<byte*>(data), 86 ScriptData* result = new ScriptData(reinterpret_cast<byte*>(data),
73 total_size * sizeof(unsigned)); 87 total_size * sizeof(unsigned));
74 result->AcquireDataOwnership(); 88 result->AcquireDataOwnership();
75 return result; 89 return result;
76 } 90 }
77 91
78 92
79 } // namespace internal 93 } // namespace internal
80 } // namespace v8. 94 } // namespace v8.
OLDNEW
« no previous file with comments | « src/parsing/preparse-data.h ('k') | src/parsing/preparse-data-format.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698