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

Side by Side Diff: src/heap.h

Issue 9452002: Ensure that executable pages are properly guarded. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 *target = e.obj_; 338 *target = e.obj_;
339 *size = e.size_; 339 *size = e.size_;
340 return; 340 return;
341 } 341 }
342 342
343 if (NewSpacePage::IsAtStart(reinterpret_cast<Address>(front_))) { 343 if (NewSpacePage::IsAtStart(reinterpret_cast<Address>(front_))) {
344 NewSpacePage* front_page = 344 NewSpacePage* front_page =
345 NewSpacePage::FromAddress(reinterpret_cast<Address>(front_)); 345 NewSpacePage::FromAddress(reinterpret_cast<Address>(front_));
346 ASSERT(!front_page->prev_page()->is_anchor()); 346 ASSERT(!front_page->prev_page()->is_anchor());
347 front_ = 347 front_ =
348 reinterpret_cast<intptr_t*>(front_page->prev_page()->body_limit()); 348 reinterpret_cast<intptr_t*>(front_page->prev_page()->area_end());
349 } 349 }
350 *target = reinterpret_cast<HeapObject*>(*(--front_)); 350 *target = reinterpret_cast<HeapObject*>(*(--front_));
351 *size = static_cast<int>(*(--front_)); 351 *size = static_cast<int>(*(--front_));
352 // Assert no underflow. 352 // Assert no underflow.
353 SemiSpace::AssertValidRange(reinterpret_cast<Address>(rear_), 353 SemiSpace::AssertValidRange(reinterpret_cast<Address>(rear_),
354 reinterpret_cast<Address>(front_)); 354 reinterpret_cast<Address>(front_));
355 } 355 }
356 356
357 private: 357 private:
358 // The front of the queue is higher in the memory page chain than the rear. 358 // The front of the queue is higher in the memory page chain than the rear.
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 intptr_t CommittedMemory(); 477 intptr_t CommittedMemory();
478 478
479 // Returns the amount of executable memory currently committed for the heap. 479 // Returns the amount of executable memory currently committed for the heap.
480 intptr_t CommittedMemoryExecutable(); 480 intptr_t CommittedMemoryExecutable();
481 481
482 // Returns the available bytes in space w/o growing. 482 // Returns the available bytes in space w/o growing.
483 // Heap doesn't guarantee that it can allocate an object that requires 483 // Heap doesn't guarantee that it can allocate an object that requires
484 // all available bytes. Check MaxHeapObjectSize() instead. 484 // all available bytes. Check MaxHeapObjectSize() instead.
485 intptr_t Available(); 485 intptr_t Available();
486 486
487 // Returns the maximum object size in paged space.
488 inline int MaxObjectSizeInPagedSpace();
489
490 // Returns of size of all objects residing in the heap. 487 // Returns of size of all objects residing in the heap.
491 intptr_t SizeOfObjects(); 488 intptr_t SizeOfObjects();
492 489
493 // Return the starting address and a mask for the new space. And-masking an 490 // Return the starting address and a mask for the new space. And-masking an
494 // address with the mask will result in the start address of the new space 491 // address with the mask will result in the start address of the new space
495 // for all addresses in either semispace. 492 // for all addresses in either semispace.
496 Address NewSpaceStart() { return new_space_.start(); } 493 Address NewSpaceStart() { return new_space_.start(); }
497 uintptr_t NewSpaceMask() { return new_space_.mask(); } 494 uintptr_t NewSpaceMask() { return new_space_.mask(); }
498 Address NewSpaceTop() { return new_space_.top(); } 495 Address NewSpaceTop() { return new_space_.top(); }
499 496
(...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after
2654 AssertNoAllocation no_alloc; // i.e. no gc allowed. 2651 AssertNoAllocation no_alloc; // i.e. no gc allowed.
2655 2652
2656 private: 2653 private:
2657 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2654 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2658 }; 2655 };
2659 #endif // DEBUG || LIVE_OBJECT_LIST 2656 #endif // DEBUG || LIVE_OBJECT_LIST
2660 2657
2661 } } // namespace v8::internal 2658 } } // namespace v8::internal
2662 2659
2663 #endif // V8_HEAP_H_ 2660 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/deoptimizer.cc ('k') | src/heap.cc » ('j') | src/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698