OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_CRANKSHAFT_TYPING_H_ | 5 #ifndef V8_CRANKSHAFT_TYPING_H_ |
6 #define V8_CRANKSHAFT_TYPING_H_ | 6 #define V8_CRANKSHAFT_TYPING_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/ast-type-bounds.h" | 9 #include "src/ast/ast-type-bounds.h" |
10 #include "src/ast/ast-types.h" | 10 #include "src/ast/ast-types.h" |
11 #include "src/ast/ast.h" | 11 #include "src/ast/ast.h" |
12 #include "src/ast/variables.h" | 12 #include "src/ast/variables.h" |
13 #include "src/effects.h" | 13 #include "src/effects.h" |
14 #include "src/type-info.h" | 14 #include "src/type-info.h" |
15 #include "src/zone/zone.h" | 15 #include "src/zone/zone.h" |
16 | 16 |
17 namespace v8 { | 17 namespace v8 { |
18 namespace internal { | 18 namespace internal { |
19 | 19 |
20 class DeclarationScope; | 20 class DeclarationScope; |
21 class Isolate; | 21 class Isolate; |
22 class FunctionLiteral; | 22 class FunctionLiteral; |
23 | 23 |
24 class AstTyper final : public AstVisitor<AstTyper> { | 24 class AstTyper final : public AstVisitor<AstTyper> { |
25 public: | 25 public: |
26 AstTyper(Isolate* isolate, Zone* zone, Handle<JSFunction> closure, | 26 AstTyper(Isolate* isolate, Zone* zone, Handle<JSFunction> closure, |
27 DeclarationScope* scope, BailoutId osr_ast_id, FunctionLiteral* root, | 27 DeclarationScope* scope, BailoutId osr_ast_id, FunctionLiteral* root, |
28 AstTypeBounds* bounds); | 28 AstTypeBounds* bounds, bool ignition_feedback = false); |
29 void Run(); | 29 void Run(); |
30 | 30 |
31 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); | 31 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); |
32 | 32 |
33 private: | 33 private: |
34 Effect ObservedOnStack(Object* value); | 34 Effect ObservedOnStack(Object* value); |
35 void ObserveTypesAtOsrEntry(IterationStatement* stmt); | 35 void ObserveTypesAtOsrEntry(IterationStatement* stmt); |
36 | 36 |
37 static const int kNoVar = INT_MIN; | 37 static const int kNoVar = INT_MIN; |
38 typedef v8::internal::Effects<int, kNoVar> Effects; | 38 typedef v8::internal::Effects<int, kNoVar> Effects; |
39 typedef v8::internal::NestedEffects<int, kNoVar> Store; | 39 typedef v8::internal::NestedEffects<int, kNoVar> Store; |
40 | 40 |
41 Isolate* isolate_; | 41 Isolate* isolate_; |
42 Zone* zone_; | 42 Zone* zone_; |
43 Handle<JSFunction> closure_; | 43 Handle<JSFunction> closure_; |
44 DeclarationScope* scope_; | 44 DeclarationScope* scope_; |
45 BailoutId osr_ast_id_; | 45 BailoutId osr_ast_id_; |
46 FunctionLiteral* root_; | 46 FunctionLiteral* root_; |
47 TypeFeedbackOracle oracle_; | 47 TypeFeedbackOracle oracle_; |
48 Store store_; | 48 Store store_; |
49 AstTypeBounds* bounds_; | 49 AstTypeBounds* bounds_; |
| 50 bool ignition_feedback_; |
50 | 51 |
51 Zone* zone() const { return zone_; } | 52 Zone* zone() const { return zone_; } |
52 TypeFeedbackOracle* oracle() { return &oracle_; } | 53 TypeFeedbackOracle* oracle() { return &oracle_; } |
53 | 54 |
54 void NarrowType(Expression* e, AstBounds b) { | 55 void NarrowType(Expression* e, AstBounds b) { |
55 bounds_->set(e, AstBounds::Both(bounds_->get(e), b, zone())); | 56 bounds_->set(e, AstBounds::Both(bounds_->get(e), b, zone())); |
56 } | 57 } |
57 void NarrowLowerType(Expression* e, AstType* t) { | 58 void NarrowLowerType(Expression* e, AstType* t) { |
58 bounds_->set(e, AstBounds::NarrowLower(bounds_->get(e), t, zone())); | 59 bounds_->set(e, AstBounds::NarrowLower(bounds_->get(e), t, zone())); |
59 } | 60 } |
(...skipping 16 matching lines...) Expand all Loading... |
76 AST_NODE_LIST(DECLARE_VISIT) | 77 AST_NODE_LIST(DECLARE_VISIT) |
77 #undef DECLARE_VISIT | 78 #undef DECLARE_VISIT |
78 | 79 |
79 DISALLOW_COPY_AND_ASSIGN(AstTyper); | 80 DISALLOW_COPY_AND_ASSIGN(AstTyper); |
80 }; | 81 }; |
81 | 82 |
82 } // namespace internal | 83 } // namespace internal |
83 } // namespace v8 | 84 } // namespace v8 |
84 | 85 |
85 #endif // V8_CRANKSHAFT_TYPING_H_ | 86 #endif // V8_CRANKSHAFT_TYPING_H_ |
OLD | NEW |