Chromium Code Reviews| Index: src/typing.h |
| diff --git a/src/typing.h b/src/typing.h |
| index a111ae5fd1594d14868ba2db80df27a34e2caf1e..0a439f9b41b82fec6156d806c38bf9c9944c3f27 100644 |
| --- a/src/typing.h |
| +++ b/src/typing.h |
| @@ -58,6 +58,9 @@ class AstTyper: public AstVisitor { |
| private: |
| explicit AstTyper(CompilationInfo* info); |
| + Effect ObservedOnStack(Object* value); |
| + void ObserveTypesAtOsrEntry(IterationStatement* stmt); |
| + |
| static const int kNoVar = INT_MIN; |
| typedef v8::internal::Effects<int, kNoVar> Effects; |
| typedef v8::internal::NestedEffects<int, kNoVar> Store; |
| @@ -82,12 +85,15 @@ class AstTyper: public AstVisitor { |
| } |
| void ExitEffects() { store_ = store_.Pop(); } |
| + inline int parameter_index(int index) { return -index - 2; } |
| + inline int stack_local_index(int index) { return index; } |
|
rossberg
2013/12/16 11:49:44
Nit: the 'inline' is redundant here.
Is there muc
Yang
2013/12/16 11:58:35
Removed 'inline'.
I use them in case where I don'
|
| + |
| int variable_index(Variable* var) { |
| // Stack locals have the range [0 .. l] |
| // Parameters have the range [-1 .. p] |
| // We map this to [-p-2 .. -1, 0 .. l] |
| - return var->IsStackLocal() ? var->index() : |
| - var->IsParameter() ? -var->index() - 2 : kNoVar; |
| + return var->IsStackLocal() ? stack_local_index(var->index()) : |
| + var->IsParameter() ? parameter_index(var->index()) : kNoVar; |
| } |
| void VisitDeclarations(ZoneList<Declaration*>* declarations); |