OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 HandleScope handle_scope(isolate); | 264 HandleScope handle_scope(isolate); |
265 Handle<Object> handle(*object, isolate); | 265 Handle<Object> handle(*object, isolate); |
266 v8::WeakCallbackData<v8::Value, void> data( | 266 v8::WeakCallbackData<v8::Value, void> data( |
267 reinterpret_cast<v8::Isolate*>(isolate), | 267 reinterpret_cast<v8::Isolate*>(isolate), |
268 v8::Utils::ToLocal(handle), | 268 v8::Utils::ToLocal(handle), |
269 par); | 269 par); |
270 weak_callback_(data); | 270 weak_callback_(data); |
271 } | 271 } |
272 // Absence of explicit cleanup or revival of weak handle | 272 // Absence of explicit cleanup or revival of weak handle |
273 // in most of the cases would lead to memory leak. | 273 // in most of the cases would lead to memory leak. |
274 ASSERT(state() != NEAR_DEATH); | 274 CHECK(state() != NEAR_DEATH); |
275 return true; | 275 return true; |
276 } | 276 } |
277 | 277 |
278 inline GlobalHandles* GetGlobalHandles(); | 278 inline GlobalHandles* GetGlobalHandles(); |
279 | 279 |
280 private: | 280 private: |
281 inline NodeBlock* FindBlock(); | 281 inline NodeBlock* FindBlock(); |
282 inline void IncreaseBlockUses(); | 282 inline void IncreaseBlockUses(); |
283 inline void DecreaseBlockUses(); | 283 inline void DecreaseBlockUses(); |
284 | 284 |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 ASSERT_EQ(isolate->heap()->the_hole_value(), blocks_[block][offset]); | 1084 ASSERT_EQ(isolate->heap()->the_hole_value(), blocks_[block][offset]); |
1085 blocks_[block][offset] = object; | 1085 blocks_[block][offset] = object; |
1086 if (isolate->heap()->InNewSpace(object)) { | 1086 if (isolate->heap()->InNewSpace(object)) { |
1087 new_space_indices_.Add(size_); | 1087 new_space_indices_.Add(size_); |
1088 } | 1088 } |
1089 *index = size_++; | 1089 *index = size_++; |
1090 } | 1090 } |
1091 | 1091 |
1092 | 1092 |
1093 } } // namespace v8::internal | 1093 } } // namespace v8::internal |
OLD | NEW |