| 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 2570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2581 } | 2581 } |
| 2582 | 2582 |
| 2583 | 2583 |
| 2584 Genesis::Genesis(Isolate* isolate, | 2584 Genesis::Genesis(Isolate* isolate, |
| 2585 Handle<Object> global_object, | 2585 Handle<Object> global_object, |
| 2586 v8::Handle<v8::ObjectTemplate> global_template, | 2586 v8::Handle<v8::ObjectTemplate> global_template, |
| 2587 v8::ExtensionConfiguration* extensions) | 2587 v8::ExtensionConfiguration* extensions) |
| 2588 : isolate_(isolate), | 2588 : isolate_(isolate), |
| 2589 active_(isolate->bootstrapper()) { | 2589 active_(isolate->bootstrapper()) { |
| 2590 result_ = Handle<Context>::null(); | 2590 result_ = Handle<Context>::null(); |
| 2591 // If V8 isn't running and cannot be initialized, just return. | 2591 // If V8 cannot be initialized, just return. |
| 2592 if (!V8::IsRunning() && !V8::Initialize(NULL)) return; | 2592 if (!V8::Initialize(NULL)) return; |
| 2593 | 2593 |
| 2594 // Before creating the roots we must save the context and restore it | 2594 // Before creating the roots we must save the context and restore it |
| 2595 // on all function exits. | 2595 // on all function exits. |
| 2596 SaveContext saved_context(isolate); | 2596 SaveContext saved_context(isolate); |
| 2597 | 2597 |
| 2598 // During genesis, the boilerplate for stack overflow won't work until the | 2598 // During genesis, the boilerplate for stack overflow won't work until the |
| 2599 // environment has been at least partially initialized. Add a stack check | 2599 // environment has been at least partially initialized. Add a stack check |
| 2600 // before entering JS code to catch overflow early. | 2600 // before entering JS code to catch overflow early. |
| 2601 StackLimitCheck check(isolate); | 2601 StackLimitCheck check(isolate); |
| 2602 if (check.HasOverflowed()) return; | 2602 if (check.HasOverflowed()) return; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2673 return from + sizeof(NestingCounterType); | 2673 return from + sizeof(NestingCounterType); |
| 2674 } | 2674 } |
| 2675 | 2675 |
| 2676 | 2676 |
| 2677 // Called when the top-level V8 mutex is destroyed. | 2677 // Called when the top-level V8 mutex is destroyed. |
| 2678 void Bootstrapper::FreeThreadResources() { | 2678 void Bootstrapper::FreeThreadResources() { |
| 2679 ASSERT(!IsActive()); | 2679 ASSERT(!IsActive()); |
| 2680 } | 2680 } |
| 2681 | 2681 |
| 2682 } } // namespace v8::internal | 2682 } } // namespace v8::internal |
| OLD | NEW |