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

Side by Side Diff: src/ast/ast-numbering.h

Issue 2707873002: Collect type profile for DevTools. (Closed)
Patch Set: Explain why throw is needed in message test. Created 3 years, 9 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/ast/ast.cc ('k') | src/ast/ast-numbering.cc » ('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 #ifndef V8_AST_AST_NUMBERING_H_ 5 #ifndef V8_AST_AST_NUMBERING_H_
6 #define V8_AST_AST_NUMBERING_H_ 6 #define V8_AST_AST_NUMBERING_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 namespace v8 { 10 namespace v8 {
11 namespace internal { 11 namespace internal {
12 12
13 // Forward declarations. 13 // Forward declarations.
14 class FunctionLiteral; 14 class FunctionLiteral;
15 class Isolate; 15 class Isolate;
16 class Zone; 16 class Zone;
17 template <typename T> 17 template <typename T>
18 class ThreadedList; 18 class ThreadedList;
19 template <typename T> 19 template <typename T>
20 class ThreadedListZoneEntry; 20 class ThreadedListZoneEntry;
21 template <typename T> 21 template <typename T>
22 class ZoneVector; 22 class ZoneVector;
23 23
24 namespace AstNumbering { 24 namespace AstNumbering {
25 // Assign type feedback IDs, bailout IDs, and generator yield IDs to an AST node 25 // Assign type feedback IDs, bailout IDs, and generator yield IDs to an AST node
26 // tree; perform catch prediction for TryStatements. If |eager_literals| is 26 // tree; perform catch prediction for TryStatements. If |eager_literals| is
27 // non-null, adds any eager inner literal functions into it. 27 // non-null, adds any eager inner literal functions into it.
28 bool Renumber( 28 bool Renumber(
29 uintptr_t stack_limit, Zone* zone, FunctionLiteral* function, 29 uintptr_t stack_limit, Zone* zone, FunctionLiteral* function,
30 ThreadedList<ThreadedListZoneEntry<FunctionLiteral*>>* eager_literals); 30 ThreadedList<ThreadedListZoneEntry<FunctionLiteral*>>* eager_literals,
31 bool collect_type_profile = false);
31 } 32 }
32 33
33 // Some details on yield IDs 34 // Some details on yield IDs
34 // ------------------------- 35 // -------------------------
35 // 36 //
36 // In order to assist Ignition in generating bytecode for a generator function, 37 // In order to assist Ignition in generating bytecode for a generator function,
37 // we assign a unique number (the yield ID) to each Yield node in its AST. We 38 // we assign a unique number (the yield ID) to each Yield node in its AST. We
38 // also annotate loops with the number of yields they contain (loop.yield_count) 39 // also annotate loops with the number of yields they contain (loop.yield_count)
39 // and the smallest ID of those (loop.first_yield_id), and we annotate the 40 // and the smallest ID of those (loop.first_yield_id), and we annotate the
40 // function itself with the number of yields it contains (function.yield_count). 41 // function itself with the number of yields it contains (function.yield_count).
41 // 42 //
42 // The way in which we choose the IDs is simply by enumerating the Yield nodes. 43 // The way in which we choose the IDs is simply by enumerating the Yield nodes.
43 // Ignition relies on the following properties: 44 // Ignition relies on the following properties:
44 // - For each loop l and each yield y of l: 45 // - For each loop l and each yield y of l:
45 // l.first_yield_id <= y.yield_id < l.first_yield_id + l.yield_count 46 // l.first_yield_id <= y.yield_id < l.first_yield_id + l.yield_count
46 // - For the generator function f itself and each yield y of f: 47 // - For the generator function f itself and each yield y of f:
47 // 0 <= y.yield_id < f.yield_count 48 // 0 <= y.yield_id < f.yield_count
48 49
49 } // namespace internal 50 } // namespace internal
50 } // namespace v8 51 } // namespace v8
51 52
52 #endif // V8_AST_AST_NUMBERING_H_ 53 #endif // V8_AST_AST_NUMBERING_H_
OLDNEW
« no previous file with comments | « src/ast/ast.cc ('k') | src/ast/ast-numbering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698