| 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 2586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; |
| 2603 | 2603 |
| 2604 // We can only de-serialize a context if the isolate was initialized from | 2604 // We can only de-serialize a context if the isolate was initialized from |
| 2605 // a snapshot. Otherwise we have to build the context from scratch. | 2605 // a snapshot. Otherwise we have to build the context from scratch. |
| 2606 if (isolate->initialized_from_snapshot()) { | 2606 if (isolate->initialized_from_snapshot()) { |
| 2607 native_context_ = Snapshot::NewContextFromSnapshot(); | 2607 native_context_ = Snapshot::NewContextFromSnapshot(isolate); |
| 2608 } else { | 2608 } else { |
| 2609 native_context_ = Handle<Context>(); | 2609 native_context_ = Handle<Context>(); |
| 2610 } | 2610 } |
| 2611 | 2611 |
| 2612 if (!native_context().is_null()) { | 2612 if (!native_context().is_null()) { |
| 2613 AddToWeakNativeContextList(*native_context()); | 2613 AddToWeakNativeContextList(*native_context()); |
| 2614 isolate->set_context(*native_context()); | 2614 isolate->set_context(*native_context()); |
| 2615 isolate->counters()->contexts_created_by_snapshot()->Increment(); | 2615 isolate->counters()->contexts_created_by_snapshot()->Increment(); |
| 2616 Handle<GlobalObject> inner_global; | 2616 Handle<GlobalObject> inner_global; |
| 2617 Handle<JSGlobalProxy> global_proxy = | 2617 Handle<JSGlobalProxy> global_proxy = |
| (...skipping 55 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 |