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_TYPING_H_ | 5 #ifndef V8_TYPING_H_ |
6 #define V8_TYPING_H_ | 6 #define V8_TYPING_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 int stack_local_index(int index) { return index; } | 62 int stack_local_index(int index) { return index; } |
63 | 63 |
64 int variable_index(Variable* var) { | 64 int variable_index(Variable* var) { |
65 // Stack locals have the range [0 .. l] | 65 // Stack locals have the range [0 .. l] |
66 // Parameters have the range [-1 .. p] | 66 // Parameters have the range [-1 .. p] |
67 // We map this to [-p-2 .. -1, 0 .. l] | 67 // We map this to [-p-2 .. -1, 0 .. l] |
68 return var->IsStackLocal() ? stack_local_index(var->index()) : | 68 return var->IsStackLocal() ? stack_local_index(var->index()) : |
69 var->IsParameter() ? parameter_index(var->index()) : kNoVar; | 69 var->IsParameter() ? parameter_index(var->index()) : kNoVar; |
70 } | 70 } |
71 | 71 |
72 void VisitDeclarations(ZoneList<Declaration*>* declarations) OVERRIDE; | 72 void VisitDeclarations(ZoneList<Declaration*>* declarations) override; |
73 void VisitStatements(ZoneList<Statement*>* statements) OVERRIDE; | 73 void VisitStatements(ZoneList<Statement*>* statements) override; |
74 | 74 |
75 #define DECLARE_VISIT(type) virtual void Visit##type(type* node) OVERRIDE; | 75 #define DECLARE_VISIT(type) virtual void Visit##type(type* node) override; |
76 AST_NODE_LIST(DECLARE_VISIT) | 76 AST_NODE_LIST(DECLARE_VISIT) |
77 #undef DECLARE_VISIT | 77 #undef DECLARE_VISIT |
78 | 78 |
79 DISALLOW_COPY_AND_ASSIGN(AstTyper); | 79 DISALLOW_COPY_AND_ASSIGN(AstTyper); |
80 }; | 80 }; |
81 | 81 |
82 } } // namespace v8::internal | 82 } } // namespace v8::internal |
83 | 83 |
84 #endif // V8_TYPING_H_ | 84 #endif // V8_TYPING_H_ |
OLD | NEW |