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

Side by Side Diff: src/platform-openbsd.cc

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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) { 451 bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) {
452 return CommitRegion(address, size, is_executable); 452 return CommitRegion(address, size, is_executable);
453 } 453 }
454 454
455 455
456 bool VirtualMemory::Uncommit(void* address, size_t size) { 456 bool VirtualMemory::Uncommit(void* address, size_t size) {
457 return UncommitRegion(address, size); 457 return UncommitRegion(address, size);
458 } 458 }
459 459
460 460
461 bool VirtualMemory::Guard(void* address) {
462 OS::Guard(address, OS::CommitPageSize());
463 return true;
464 }
465
466
461 void* VirtualMemory::ReserveRegion(size_t size) { 467 void* VirtualMemory::ReserveRegion(size_t size) {
462 void* result = mmap(GetRandomMmapAddr(), 468 void* result = mmap(GetRandomMmapAddr(),
463 size, 469 size,
464 PROT_NONE, 470 PROT_NONE,
465 MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, 471 MAP_PRIVATE | MAP_ANON | MAP_NORESERVE,
466 kMmapFd, 472 kMmapFd,
467 kMmapFdOffset); 473 kMmapFdOffset);
468 474
469 if (result == MAP_FAILED) return NULL; 475 if (result == MAP_FAILED) return NULL;
470 476
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 959
954 960
955 void Sampler::Stop() { 961 void Sampler::Stop() {
956 ASSERT(IsActive()); 962 ASSERT(IsActive());
957 SignalSender::RemoveActiveSampler(this); 963 SignalSender::RemoveActiveSampler(this);
958 SetActive(false); 964 SetActive(false);
959 } 965 }
960 966
961 967
962 } } // namespace v8::internal 968 } } // namespace v8::internal
OLDNEW
« src/platform-freebsd.cc ('K') | « src/platform-nullos.cc ('k') | src/platform-solaris.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698