| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 return zone->New(static_cast<int>(size)); | 51 return zone->New(static_cast<int>(size)); |
| 52 } | 52 } |
| 53 void operator delete(void* pointer, Zone* zone) { } | 53 void operator delete(void* pointer, Zone* zone) { } |
| 54 void operator delete(void* pointer) { } | 54 void operator delete(void* pointer) { } |
| 55 | 55 |
| 56 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); | 56 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 explicit AstTyper(CompilationInfo* info); | 59 explicit AstTyper(CompilationInfo* info); |
| 60 | 60 |
| 61 Handle<Type> ObserveType(Object* value); |
| 62 void ObserveTypesOnStack(); |
| 63 Handle<Type> GetObservedType(Variable* var); |
| 64 |
| 61 static const int kNoVar = INT_MIN; | 65 static const int kNoVar = INT_MIN; |
| 62 typedef v8::internal::Effects<int, kNoVar> Effects; | 66 typedef v8::internal::Effects<int, kNoVar> Effects; |
| 63 typedef v8::internal::NestedEffects<int, kNoVar> Store; | 67 typedef v8::internal::NestedEffects<int, kNoVar> Store; |
| 64 | 68 |
| 65 CompilationInfo* info_; | 69 CompilationInfo* info_; |
| 66 TypeFeedbackOracle oracle_; | 70 TypeFeedbackOracle oracle_; |
| 67 Store store_; | 71 Store store_; |
| 72 ZoneList<Handle<Type> >* parameter_types_; |
| 73 ZoneList<Handle<Type> >* stack_local_types_; |
| 68 | 74 |
| 69 TypeFeedbackOracle* oracle() { return &oracle_; } | 75 TypeFeedbackOracle* oracle() { return &oracle_; } |
| 70 Zone* zone() const { return info_->zone(); } | 76 Zone* zone() const { return info_->zone(); } |
| 71 | 77 |
| 72 void NarrowType(Expression* e, Bounds b) { | 78 void NarrowType(Expression* e, Bounds b) { |
| 73 e->set_bounds(Bounds::Both(e->bounds(), b, isolate_)); | 79 e->set_bounds(Bounds::Both(e->bounds(), b, isolate_)); |
| 74 } | 80 } |
| 75 void NarrowLowerType(Expression* e, Handle<Type> t) { | 81 void NarrowLowerType(Expression* e, Handle<Type> t) { |
| 76 e->set_bounds(Bounds::NarrowLower(e->bounds(), t, isolate_)); | 82 e->set_bounds(Bounds::NarrowLower(e->bounds(), t, isolate_)); |
| 77 } | 83 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 93 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | 99 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); |
| 94 AST_NODE_LIST(DECLARE_VISIT) | 100 AST_NODE_LIST(DECLARE_VISIT) |
| 95 #undef DECLARE_VISIT | 101 #undef DECLARE_VISIT |
| 96 | 102 |
| 97 DISALLOW_COPY_AND_ASSIGN(AstTyper); | 103 DISALLOW_COPY_AND_ASSIGN(AstTyper); |
| 98 }; | 104 }; |
| 99 | 105 |
| 100 } } // namespace v8::internal | 106 } } // namespace v8::internal |
| 101 | 107 |
| 102 #endif // V8_TYPING_H_ | 108 #endif // V8_TYPING_H_ |
| OLD | NEW |