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

Side by Side Diff: src/allocation.h

Issue 6529055: [Isolates] Merge crankshaft (r5922 from bleeding_edge). (Closed)
Patch Set: Win32 port Created 9 years, 10 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
« no previous file with comments | « src/accessors.cc ('k') | src/allocation.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 2008 the V8 project authors. All rights reserved. 1 // Copyright 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 22 matching lines...) Expand all
33 33
34 // Called when allocation routines fail to allocate. 34 // Called when allocation routines fail to allocate.
35 // This function should not return, but should terminate the current 35 // This function should not return, but should terminate the current
36 // processing. 36 // processing.
37 void FatalProcessOutOfMemory(const char* message); 37 void FatalProcessOutOfMemory(const char* message);
38 38
39 // A class that controls whether allocation is allowed. This is for 39 // A class that controls whether allocation is allowed. This is for
40 // the C++ heap only! 40 // the C++ heap only!
41 class NativeAllocationChecker { 41 class NativeAllocationChecker {
42 public: 42 public:
43 typedef enum { ALLOW, DISALLOW } NativeAllocationAllowed; 43 enum NativeAllocationAllowed { ALLOW, DISALLOW };
44 explicit inline NativeAllocationChecker(NativeAllocationAllowed allowed); 44 #ifdef DEBUG
45 inline ~NativeAllocationChecker(); 45 explicit NativeAllocationChecker(NativeAllocationAllowed allowed);
46 static inline bool allocation_allowed(); 46 ~NativeAllocationChecker();
47 static bool allocation_allowed();
47 private: 48 private:
48 // This flag applies to this particular instance. 49 // This flag applies to this particular instance.
49 NativeAllocationAllowed allowed_; 50 NativeAllocationAllowed allowed_;
51 #else
52 explicit inline NativeAllocationChecker(NativeAllocationAllowed allowed) {}
53 static inline bool allocation_allowed() { return true; }
54 #endif
50 }; 55 };
51 56
52 57
53 // Superclass for classes managed with new & delete. 58 // Superclass for classes managed with new & delete.
54 class Malloced { 59 class Malloced {
55 public: 60 public:
56 void* operator new(size_t size) { return New(size); } 61 void* operator new(size_t size) { return New(size); }
57 void operator delete(void* p) { Delete(p); } 62 void operator delete(void* p) { Delete(p); }
58 63
59 static void FatalProcessOutOfMemory(); 64 static void FatalProcessOutOfMemory();
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 151
147 friend class Isolate; 152 friend class Isolate;
148 153
149 DISALLOW_IMPLICIT_CONSTRUCTORS(PreallocatedStorage); 154 DISALLOW_IMPLICIT_CONSTRUCTORS(PreallocatedStorage);
150 }; 155 };
151 156
152 157
153 } } // namespace v8::internal 158 } } // namespace v8::internal
154 159
155 #endif // V8_ALLOCATION_H_ 160 #endif // V8_ALLOCATION_H_
OLDNEW
« no previous file with comments | « src/accessors.cc ('k') | src/allocation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698