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/objects.h

Issue 8637015: Set maximum length of FixedArray in terms of elements instead an absolute number of bytes. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 1 month 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 | « no previous file | no next file » | 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 2080 matching lines...) Expand 10 before | Expand all | Expand 10 after
2091 2091
2092 // Code Generation support. 2092 // Code Generation support.
2093 static int OffsetOfElementAt(int index) { return SizeFor(index); } 2093 static int OffsetOfElementAt(int index) { return SizeFor(index); }
2094 2094
2095 // Casting. 2095 // Casting.
2096 static inline FixedArray* cast(Object* obj); 2096 static inline FixedArray* cast(Object* obj);
2097 2097
2098 // Maximal allowed size, in bytes, of a single FixedArray. 2098 // Maximal allowed size, in bytes, of a single FixedArray.
2099 // Prevents overflowing size computations, as well as extreme memory 2099 // Prevents overflowing size computations, as well as extreme memory
2100 // consumption. 2100 // consumption.
2101 static const int kMaxSize = 512 * MB; 2101 static const int kMaxSize = 128 * MB * kPointerSize;
2102 // Maximally allowed length of a FixedArray. 2102 // Maximally allowed length of a FixedArray.
2103 static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize; 2103 static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize;
2104 2104
2105 // Dispatched behavior. 2105 // Dispatched behavior.
2106 #ifdef OBJECT_PRINT 2106 #ifdef OBJECT_PRINT
2107 inline void FixedArrayPrint() { 2107 inline void FixedArrayPrint() {
2108 FixedArrayPrint(stdout); 2108 FixedArrayPrint(stdout);
2109 } 2109 }
2110 void FixedArrayPrint(FILE* out); 2110 void FixedArrayPrint(FILE* out);
2111 #endif 2111 #endif
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
3332 void FreeSpaceVerify(); 3332 void FreeSpaceVerify();
3333 #endif 3333 #endif
3334 3334
3335 // Layout description. 3335 // Layout description.
3336 // Size is smi tagged when it is stored. 3336 // Size is smi tagged when it is stored.
3337 static const int kSizeOffset = HeapObject::kHeaderSize; 3337 static const int kSizeOffset = HeapObject::kHeaderSize;
3338 static const int kHeaderSize = kSizeOffset + kPointerSize; 3338 static const int kHeaderSize = kSizeOffset + kPointerSize;
3339 3339
3340 static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize); 3340 static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize);
3341 3341
3342 // Maximal size of a single FreeSpace.
3343 static const int kMaxSize = 512 * MB;
3344
3345 private: 3342 private:
3346 DISALLOW_IMPLICIT_CONSTRUCTORS(FreeSpace); 3343 DISALLOW_IMPLICIT_CONSTRUCTORS(FreeSpace);
3347 }; 3344 };
3348 3345
3349 3346
3350 // An ExternalArray represents a fixed-size array of primitive values 3347 // An ExternalArray represents a fixed-size array of primitive values
3351 // which live outside the JavaScript heap. Its subclasses are used to 3348 // which live outside the JavaScript heap. Its subclasses are used to
3352 // implement the CanvasArray types being defined in the WebGL 3349 // implement the CanvasArray types being defined in the WebGL
3353 // specification. As of this writing the first public draft is not yet 3350 // specification. As of this writing the first public draft is not yet
3354 // available, but Khronos members can access the draft at: 3351 // available, but Khronos members can access the draft at:
(...skipping 4532 matching lines...) Expand 10 before | Expand all | Expand 10 after
7887 } else { 7884 } else {
7888 value &= ~(1 << bit_position); 7885 value &= ~(1 << bit_position);
7889 } 7886 }
7890 return value; 7887 return value;
7891 } 7888 }
7892 }; 7889 };
7893 7890
7894 } } // namespace v8::internal 7891 } } // namespace v8::internal
7895 7892
7896 #endif // V8_OBJECTS_H_ 7893 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698