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

Side by Side Diff: src/spaces.h

Issue 5556012: Speed up quoting of JSON strings by allocating a string that is big enough... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years 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
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-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 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 // respective semispace (not necessarily below the allocation pointer of the 1636 // respective semispace (not necessarily below the allocation pointer of the
1637 // semispace). 1637 // semispace).
1638 bool ToSpaceContains(Object* o) { return to_space_.Contains(o); } 1638 bool ToSpaceContains(Object* o) { return to_space_.Contains(o); }
1639 bool FromSpaceContains(Object* o) { return from_space_.Contains(o); } 1639 bool FromSpaceContains(Object* o) { return from_space_.Contains(o); }
1640 1640
1641 bool ToSpaceContains(Address a) { return to_space_.Contains(a); } 1641 bool ToSpaceContains(Address a) { return to_space_.Contains(a); }
1642 bool FromSpaceContains(Address a) { return from_space_.Contains(a); } 1642 bool FromSpaceContains(Address a) { return from_space_.Contains(a); }
1643 1643
1644 virtual bool ReserveSpace(int bytes); 1644 virtual bool ReserveSpace(int bytes);
1645 1645
1646 // Resizes a sequential string which must be the most recent thing that was
1647 // allocated in new space.
1648 template <typename StringType>
1649 inline void ShrinkStringAtAllocationBoundary(String* string, int len);
1650
1646 #ifdef ENABLE_HEAP_PROTECTION 1651 #ifdef ENABLE_HEAP_PROTECTION
1647 // Protect/unprotect the space by marking it read-only/writable. 1652 // Protect/unprotect the space by marking it read-only/writable.
1648 virtual void Protect(); 1653 virtual void Protect();
1649 virtual void Unprotect(); 1654 virtual void Unprotect();
1650 #endif 1655 #endif
1651 1656
1652 #ifdef DEBUG 1657 #ifdef DEBUG
1653 // Verify the active semispace. 1658 // Verify the active semispace.
1654 virtual void Verify(); 1659 virtual void Verify();
1655 // Print the active semispace. 1660 // Print the active semispace.
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
2343 2348
2344 private: 2349 private:
2345 LargeObjectChunk* current_; 2350 LargeObjectChunk* current_;
2346 HeapObjectCallback size_func_; 2351 HeapObjectCallback size_func_;
2347 }; 2352 };
2348 2353
2349 2354
2350 } } // namespace v8::internal 2355 } } // namespace v8::internal
2351 2356
2352 #endif // V8_SPACES_H_ 2357 #endif // V8_SPACES_H_
OLDNEW
« src/runtime.cc ('K') | « src/runtime.cc ('k') | src/spaces-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698