| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 return reinterpret_cast<Variable*>(p->value); | 98 return reinterpret_cast<Variable*>(p->value); |
| 99 } | 99 } |
| 100 return NULL; | 100 return NULL; |
| 101 } | 101 } |
| 102 | 102 |
| 103 | 103 |
| 104 // ---------------------------------------------------------------------------- | 104 // ---------------------------------------------------------------------------- |
| 105 // Implementation of Scope | 105 // Implementation of Scope |
| 106 | 106 |
| 107 Scope::Scope(Scope* outer_scope, ScopeType type, Zone* zone) | 107 Scope::Scope(Scope* outer_scope, ScopeType type, Zone* zone) |
| 108 : isolate_(Isolate::Current()), | 108 : isolate_(zone->isolate()), |
| 109 inner_scopes_(4, zone), | 109 inner_scopes_(4, zone), |
| 110 variables_(zone), | 110 variables_(zone), |
| 111 internals_(4, zone), | 111 internals_(4, zone), |
| 112 temps_(4, zone), | 112 temps_(4, zone), |
| 113 params_(4, zone), | 113 params_(4, zone), |
| 114 unresolved_(16, zone), | 114 unresolved_(16, zone), |
| 115 decls_(4, zone), | 115 decls_(4, zone), |
| 116 interface_(FLAG_harmony_modules && | 116 interface_(FLAG_harmony_modules && |
| 117 (type == MODULE_SCOPE || type == GLOBAL_SCOPE) | 117 (type == MODULE_SCOPE || type == GLOBAL_SCOPE) |
| 118 ? Interface::NewModule(zone) : NULL), | 118 ? Interface::NewModule(zone) : NULL), |
| (...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 } | 1379 } |
| 1380 | 1380 |
| 1381 | 1381 |
| 1382 int Scope::ContextLocalCount() const { | 1382 int Scope::ContextLocalCount() const { |
| 1383 if (num_heap_slots() == 0) return 0; | 1383 if (num_heap_slots() == 0) return 0; |
| 1384 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 1384 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
| 1385 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); | 1385 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); |
| 1386 } | 1386 } |
| 1387 | 1387 |
| 1388 } } // namespace v8::internal | 1388 } } // namespace v8::internal |
| OLD | NEW |