| OLD | NEW |
| 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 Loading... |
| 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 ASSERT(!isolate->IsInitialized()); | 577 // TODO(rmcilroy): fix this assert. |
| 578 // ASSERT(!isolate->IsInitialized()); |
| 578 bool result = isolate->heap()->ConfigureHeap(young_space_size / 2, | 579 bool result = isolate->heap()->ConfigureHeap(young_space_size / 2, |
| 579 old_gen_size, | 580 old_gen_size, |
| 580 max_executable_size); | 581 max_executable_size); |
| 581 if (!result) return false; | 582 if (!result) return false; |
| 582 } | 583 } |
| 583 if (constraints->stack_limit() != NULL) { | 584 if (constraints->stack_limit() != NULL) { |
| 584 uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit()); | 585 uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit()); |
| 585 isolate->stack_guard()->SetStackLimit(limit); | 586 isolate->stack_guard()->SetStackLimit(limit); |
| 586 } | 587 } |
| 587 return true; | 588 return true; |
| (...skipping 6982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7570 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7571 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7571 Address callback_address = | 7572 Address callback_address = |
| 7572 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7573 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7573 VMState<EXTERNAL> state(isolate); | 7574 VMState<EXTERNAL> state(isolate); |
| 7574 ExternalCallbackScope call_scope(isolate, callback_address); | 7575 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7575 callback(info); | 7576 callback(info); |
| 7576 } | 7577 } |
| 7577 | 7578 |
| 7578 | 7579 |
| 7579 } } // namespace v8::internal | 7580 } } // namespace v8::internal |
| OLD | NEW |