| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 19 matching lines...) Expand all Loading... |
| 30 #include "prettyprinter.h" | 30 #include "prettyprinter.h" |
| 31 #include "scopeinfo.h" | 31 #include "scopeinfo.h" |
| 32 #include "scopes.h" | 32 #include "scopes.h" |
| 33 | 33 |
| 34 namespace v8 { | 34 namespace v8 { |
| 35 namespace internal { | 35 namespace internal { |
| 36 | 36 |
| 37 // ---------------------------------------------------------------------------- | 37 // ---------------------------------------------------------------------------- |
| 38 // A Zone allocator for use with LocalsMap. | 38 // A Zone allocator for use with LocalsMap. |
| 39 | 39 |
| 40 // TODO(isolates): It is probably worth it to change the Allocator class to |
| 41 // take a pointer to an isolate. |
| 40 class ZoneAllocator: public Allocator { | 42 class ZoneAllocator: public Allocator { |
| 41 public: | 43 public: |
| 42 /* nothing to do */ | 44 /* nothing to do */ |
| 43 virtual ~ZoneAllocator() {} | 45 virtual ~ZoneAllocator() {} |
| 44 | 46 |
| 45 virtual void* New(size_t size) { return ZONE->New(static_cast<int>(size)); } | 47 virtual void* New(size_t size) { return ZONE->New(static_cast<int>(size)); } |
| 46 | 48 |
| 47 /* ignored - Zone is freed in one fell swoop */ | 49 /* ignored - Zone is freed in one fell swoop */ |
| 48 virtual void Delete(void* p) {} | 50 virtual void Delete(void* p) {} |
| 49 }; | 51 }; |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && | 955 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && |
| 954 !must_have_local_context) { | 956 !must_have_local_context) { |
| 955 num_heap_slots_ = 0; | 957 num_heap_slots_ = 0; |
| 956 } | 958 } |
| 957 | 959 |
| 958 // Allocation done. | 960 // Allocation done. |
| 959 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); | 961 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); |
| 960 } | 962 } |
| 961 | 963 |
| 962 } } // namespace v8::internal | 964 } } // namespace v8::internal |
| OLD | NEW |