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

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

Issue 3601010: [Isolates] Allow running multiple isolates in shell and use this in tests. (Closed)
Patch Set: Created 10 years, 2 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
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 Isolate* isolate = Isolate::Current(); 51 Isolate* isolate = Isolate::Current();
52 if (allowed_ == DISALLOW) { 52 if (allowed_ == DISALLOW) {
53 isolate->set_allocation_disallowed(isolate->allocation_disallowed() - 1); 53 isolate->set_allocation_disallowed(isolate->allocation_disallowed() - 1);
54 } 54 }
55 ASSERT(isolate->allocation_disallowed() >= 0); 55 ASSERT(isolate->allocation_disallowed() >= 0);
56 #endif 56 #endif
57 } 57 }
58 58
59 59
60 bool NativeAllocationChecker::allocation_allowed() { 60 bool NativeAllocationChecker::allocation_allowed() {
61 #ifdef DEBUG
61 return Isolate::Current()->allocation_disallowed() == 0; 62 return Isolate::Current()->allocation_disallowed() == 0;
63 #else
64 return true;
65 #endif // DEBUG
62 } 66 }
63 67
64 68
65 void* PreallocatedStorage::New(size_t size) { 69 void* PreallocatedStorage::New(size_t size) {
66 return Isolate::Current()->PreallocatedStorageNew(size); 70 return Isolate::Current()->PreallocatedStorageNew(size);
67 } 71 }
68 72
69 73
70 void PreallocatedStorage::Delete(void* p) { 74 void PreallocatedStorage::Delete(void* p) {
71 return Isolate::Current()->PreallocatedStorageDelete(p); 75 return Isolate::Current()->PreallocatedStorageDelete(p);
72 } 76 }
73 77
74 78
75 } } // namespace v8::internal 79 } } // namespace v8::internal
76 80
77 #endif // V8_ALLOCATION_INL_H_ 81 #endif // V8_ALLOCATION_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698