Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: src/zone-inl.h

Issue 7066004: Inline more zone stuff. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/zone.h ('k') | test/cctest/test-ast.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // allocated. 95 // allocated.
96 void* ZoneObject::operator new(size_t size) { 96 void* ZoneObject::operator new(size_t size) {
97 return ZONE->New(static_cast<int>(size)); 97 return ZONE->New(static_cast<int>(size));
98 } 98 }
99 99
100 void* ZoneObject::operator new(size_t size, Zone* zone) { 100 void* ZoneObject::operator new(size_t size, Zone* zone) {
101 return zone->New(static_cast<int>(size)); 101 return zone->New(static_cast<int>(size));
102 } 102 }
103 103
104 104
105 void* ZoneListAllocationPolicy::New(int size) { 105 inline void* ZoneListAllocationPolicy::New(int size) {
106 return ZONE->New(size); 106 return ZONE->New(size);
107 } 107 }
108 108
109 109
110 template <typename T> 110 template <typename T>
111 void* ZoneList<T>::operator new(size_t size) { 111 void* ZoneList<T>::operator new(size_t size) {
112 return ZONE->New(static_cast<int>(size)); 112 return ZONE->New(static_cast<int>(size));
113 } 113 }
114 114
115 115
116 template <typename T> 116 template <typename T>
117 void* ZoneList<T>::operator new(size_t size, Zone* zone) { 117 void* ZoneList<T>::operator new(size_t size, Zone* zone) {
118 return zone->New(static_cast<int>(size)); 118 return zone->New(static_cast<int>(size));
119 } 119 }
120 120
121 121
122 ZoneScope::ZoneScope(ZoneScopeMode mode) 122 ZoneScope::ZoneScope(Isolate* isolate, ZoneScopeMode mode)
123 : isolate_(Isolate::Current()), 123 : isolate_(isolate), mode_(mode) {
124 mode_(mode) {
125 isolate_->zone()->scope_nesting_++; 124 isolate_->zone()->scope_nesting_++;
126 } 125 }
127 126
128 127
129 bool ZoneScope::ShouldDeleteOnExit() { 128 bool ZoneScope::ShouldDeleteOnExit() {
130 return isolate_->zone()->scope_nesting_ == 1 && mode_ == DELETE_ON_EXIT; 129 return isolate_->zone()->scope_nesting_ == 1 && mode_ == DELETE_ON_EXIT;
131 } 130 }
132 131
133 132
134 int ZoneScope::nesting() { 133 int ZoneScope::nesting() {
135 return Isolate::Current()->zone()->scope_nesting_; 134 return Isolate::Current()->zone()->scope_nesting_;
136 } 135 }
137 136
138 137
139 } } // namespace v8::internal 138 } } // namespace v8::internal
140 139
141 #endif // V8_ZONE_INL_H_ 140 #endif // V8_ZONE_INL_H_
OLDNEW
« no previous file with comments | « src/zone.h ('k') | test/cctest/test-ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698