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

Side by Side Diff: src/api.cc

Issue 262653002: When maximum space size flags are set, overwrite the resource constraints. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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
« 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "api.h" 5 #include "api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #include <cmath> // For isnan. 8 #include <cmath> // For isnan.
9 #include "../include/v8-debug.h" 9 #include "../include/v8-debug.h"
10 #include "../include/v8-profiler.h" 10 #include "../include/v8-profiler.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 set_max_old_space_size(i::Heap::kMaxOldSpaceSizeHighMemoryDevice); 454 set_max_old_space_size(i::Heap::kMaxOldSpaceSizeHighMemoryDevice);
455 set_max_executable_size(i::Heap::kMaxExecutableSizeHighMemoryDevice); 455 set_max_executable_size(i::Heap::kMaxExecutableSizeHighMemoryDevice);
456 } else { 456 } else {
457 set_max_new_space_size(i::Heap::kMaxNewSpaceSizeHugeMemoryDevice); 457 set_max_new_space_size(i::Heap::kMaxNewSpaceSizeHugeMemoryDevice);
458 set_max_old_space_size(i::Heap::kMaxOldSpaceSizeHugeMemoryDevice); 458 set_max_old_space_size(i::Heap::kMaxOldSpaceSizeHugeMemoryDevice);
459 set_max_executable_size(i::Heap::kMaxExecutableSizeHugeMemoryDevice); 459 set_max_executable_size(i::Heap::kMaxExecutableSizeHugeMemoryDevice);
460 } 460 }
461 461
462 set_max_available_threads(i::Max(i::Min(number_of_processors, 4u), 1u)); 462 set_max_available_threads(i::Max(i::Min(number_of_processors, 4u), 1u));
463 463
464 if (i::FLAG_max_new_space_size > 0) {
465 set_max_new_space_size(i::FLAG_max_new_space_size * i::Heap::kLumpOfMemory);
466 }
467 if (i::FLAG_max_old_space_size > 0) {
468 set_max_old_space_size(i::FLAG_max_old_space_size * i::Heap::kLumpOfMemory);
469 }
470 if (i::FLAG_max_executable_size > 0) {
471 set_max_executable_size(
472 i::FLAG_max_executable_size * i::Heap::kLumpOfMemory);
473 }
474
rmcilroy 2014/04/30 12:17:13 Would it be better to put this code in Heap::Confi
Hannes Payer (out of office) 2014/04/30 12:36:22 Yeah, makes sense. Done.
464 if (virtual_memory_limit > 0 && i::kIs64BitArch) { 475 if (virtual_memory_limit > 0 && i::kIs64BitArch) {
465 // Reserve no more than 1/8 of the memory for the code range, but at most 476 // Reserve no more than 1/8 of the memory for the code range, but at most
466 // 512 MB. 477 // 512 MB.
467 set_code_range_size( 478 set_code_range_size(
468 i::Min(512 * i::MB, static_cast<int>(virtual_memory_limit >> 3))); 479 i::Min(512 * i::MB, static_cast<int>(virtual_memory_limit >> 3)));
469 } 480 }
470 } 481 }
471 482
472 483
473 bool SetResourceConstraints(Isolate* v8_isolate, 484 bool SetResourceConstraints(Isolate* v8_isolate,
(...skipping 7108 matching lines...) Expand 10 before | Expand all | Expand 10 after
7582 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7593 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7583 Address callback_address = 7594 Address callback_address =
7584 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7595 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7585 VMState<EXTERNAL> state(isolate); 7596 VMState<EXTERNAL> state(isolate);
7586 ExternalCallbackScope call_scope(isolate, callback_address); 7597 ExternalCallbackScope call_scope(isolate, callback_address);
7587 callback(info); 7598 callback(info);
7588 } 7599 }
7589 7600
7590 7601
7591 } } // namespace v8::internal 7602 } } // namespace v8::internal
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