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

Side by Side Diff: src/api.cc

Issue 59133003: Add back assertion SetResourceConstraints. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 567
568 568
569 bool SetResourceConstraints(ResourceConstraints* constraints) { 569 bool SetResourceConstraints(ResourceConstraints* constraints) {
570 i::Isolate* isolate = EnterIsolateIfNeeded(); 570 i::Isolate* isolate = EnterIsolateIfNeeded();
571 571
572 int young_space_size = constraints->max_young_space_size(); 572 int young_space_size = constraints->max_young_space_size();
573 int old_gen_size = constraints->max_old_space_size(); 573 int old_gen_size = constraints->max_old_space_size();
574 int max_executable_size = constraints->max_executable_size(); 574 int max_executable_size = constraints->max_executable_size();
575 if (young_space_size != 0 || old_gen_size != 0 || max_executable_size != 0) { 575 if (young_space_size != 0 || old_gen_size != 0 || max_executable_size != 0) {
576 // After initialization it's too late to change Heap constraints. 576 // After initialization it's too late to change Heap constraints.
577 // TODO(rmcilroy): fix this assert. 577 ASSERT(!isolate->IsInitialized());
578 // ASSERT(!isolate->IsInitialized());
579 bool result = isolate->heap()->ConfigureHeap(young_space_size / 2, 578 bool result = isolate->heap()->ConfigureHeap(young_space_size / 2,
580 old_gen_size, 579 old_gen_size,
581 max_executable_size); 580 max_executable_size);
582 if (!result) return false; 581 if (!result) return false;
583 } 582 }
584 if (constraints->stack_limit() != NULL) { 583 if (constraints->stack_limit() != NULL) {
585 uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit()); 584 uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit());
586 isolate->stack_guard()->SetStackLimit(limit); 585 isolate->stack_guard()->SetStackLimit(limit);
587 } 586 }
588 return true; 587 return true;
(...skipping 6982 matching lines...) Expand 10 before | Expand all | Expand 10 after
7571 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7570 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7572 Address callback_address = 7571 Address callback_address =
7573 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7572 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7574 VMState<EXTERNAL> state(isolate); 7573 VMState<EXTERNAL> state(isolate);
7575 ExternalCallbackScope call_scope(isolate, callback_address); 7574 ExternalCallbackScope call_scope(isolate, callback_address);
7576 callback(info); 7575 callback(info);
7577 } 7576 }
7578 7577
7579 7578
7580 } } // namespace v8::internal 7579 } } // 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