OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 } | 697 } |
698 } | 698 } |
699 } | 699 } |
700 | 700 |
701 | 701 |
702 #ifdef DEBUG | 702 #ifdef DEBUG |
703 static const char* Header(ScopeType type) { | 703 static const char* Header(ScopeType type) { |
704 switch (type) { | 704 switch (type) { |
705 case EVAL_SCOPE: return "eval"; | 705 case EVAL_SCOPE: return "eval"; |
706 case FUNCTION_SCOPE: return "function"; | 706 case FUNCTION_SCOPE: return "function"; |
| 707 case MODULE_SCOPE: return "module"; |
707 case GLOBAL_SCOPE: return "global"; | 708 case GLOBAL_SCOPE: return "global"; |
708 case CATCH_SCOPE: return "catch"; | 709 case CATCH_SCOPE: return "catch"; |
709 case BLOCK_SCOPE: return "block"; | 710 case BLOCK_SCOPE: return "block"; |
710 case WITH_SCOPE: return "with"; | 711 case WITH_SCOPE: return "with"; |
711 } | 712 } |
712 UNREACHABLE(); | 713 UNREACHABLE(); |
713 return NULL; | 714 return NULL; |
714 } | 715 } |
715 | 716 |
716 | 717 |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 } | 1217 } |
1217 | 1218 |
1218 | 1219 |
1219 int Scope::ContextLocalCount() const { | 1220 int Scope::ContextLocalCount() const { |
1220 if (num_heap_slots() == 0) return 0; | 1221 if (num_heap_slots() == 0) return 0; |
1221 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 1222 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
1222 (function_ != NULL && function_->var()->IsContextSlot() ? 1 : 0); | 1223 (function_ != NULL && function_->var()->IsContextSlot() ? 1 : 0); |
1223 } | 1224 } |
1224 | 1225 |
1225 } } // namespace v8::internal | 1226 } } // namespace v8::internal |
OLD | NEW |