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 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1470 Vector<const char> name, | 1470 Vector<const char> name, |
1471 Handle<String> source) { | 1471 Handle<String> source) { |
1472 HandleScope scope(isolate); | 1472 HandleScope scope(isolate); |
1473 #ifdef ENABLE_DEBUGGER_SUPPORT | 1473 #ifdef ENABLE_DEBUGGER_SUPPORT |
1474 isolate->debugger()->set_compiling_natives(true); | 1474 isolate->debugger()->set_compiling_natives(true); |
1475 #endif | 1475 #endif |
1476 // During genesis, the boilerplate for stack overflow won't work until the | 1476 // During genesis, the boilerplate for stack overflow won't work until the |
1477 // environment has been at least partially initialized. Add a stack check | 1477 // environment has been at least partially initialized. Add a stack check |
1478 // before entering JS code to catch overflow early. | 1478 // before entering JS code to catch overflow early. |
1479 StackLimitCheck check(isolate); | 1479 StackLimitCheck check(isolate); |
1480 if (check.HasOverflowed()) return false; | 1480 if (check.WillOverflow(5000 * sizeof(intptr_t))) { |
Jarin
2014/02/25 20:45:08
Could you possibly create some constant with some
| |
1481 isolate->StackOverflow(); | |
1482 isolate->OptionalRescheduleException(true); | |
1483 return false; | |
1484 } | |
1481 | 1485 |
1482 bool result = CompileScriptCached(isolate, | 1486 bool result = CompileScriptCached(isolate, |
1483 name, | 1487 name, |
1484 source, | 1488 source, |
1485 NULL, | 1489 NULL, |
1486 NULL, | 1490 NULL, |
1487 Handle<Context>(isolate->context()), | 1491 Handle<Context>(isolate->context()), |
1488 true); | 1492 true); |
1489 ASSERT(isolate->has_pending_exception() != result); | 1493 ASSERT(isolate->has_pending_exception() != result); |
1490 if (!result) isolate->clear_pending_exception(); | 1494 if (!result) isolate->clear_pending_exception(); |
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2601 if (!V8::Initialize(NULL)) return; | 2605 if (!V8::Initialize(NULL)) return; |
2602 | 2606 |
2603 // Before creating the roots we must save the context and restore it | 2607 // Before creating the roots we must save the context and restore it |
2604 // on all function exits. | 2608 // on all function exits. |
2605 SaveContext saved_context(isolate); | 2609 SaveContext saved_context(isolate); |
2606 | 2610 |
2607 // During genesis, the boilerplate for stack overflow won't work until the | 2611 // During genesis, the boilerplate for stack overflow won't work until the |
2608 // environment has been at least partially initialized. Add a stack check | 2612 // environment has been at least partially initialized. Add a stack check |
2609 // before entering JS code to catch overflow early. | 2613 // before entering JS code to catch overflow early. |
2610 StackLimitCheck check(isolate); | 2614 StackLimitCheck check(isolate); |
2611 if (check.HasOverflowed()) return; | 2615 if (check.WillOverflow(6000 * sizeof(intptr_t))) { |
Jarin
2014/02/25 20:45:08
Is there a reason why the magic constant differs f
| |
2616 isolate->StackOverflow(); | |
2617 isolate->OptionalRescheduleException(true); | |
2618 return; | |
2619 } | |
2612 | 2620 |
2613 // We can only de-serialize a context if the isolate was initialized from | 2621 // We can only de-serialize a context if the isolate was initialized from |
2614 // a snapshot. Otherwise we have to build the context from scratch. | 2622 // a snapshot. Otherwise we have to build the context from scratch. |
2615 if (isolate->initialized_from_snapshot()) { | 2623 if (isolate->initialized_from_snapshot()) { |
2616 native_context_ = Snapshot::NewContextFromSnapshot(isolate); | 2624 native_context_ = Snapshot::NewContextFromSnapshot(isolate); |
2617 } else { | 2625 } else { |
2618 native_context_ = Handle<Context>(); | 2626 native_context_ = Handle<Context>(); |
2619 } | 2627 } |
2620 | 2628 |
2621 if (!native_context().is_null()) { | 2629 if (!native_context().is_null()) { |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2746 return from + sizeof(NestingCounterType); | 2754 return from + sizeof(NestingCounterType); |
2747 } | 2755 } |
2748 | 2756 |
2749 | 2757 |
2750 // Called when the top-level V8 mutex is destroyed. | 2758 // Called when the top-level V8 mutex is destroyed. |
2751 void Bootstrapper::FreeThreadResources() { | 2759 void Bootstrapper::FreeThreadResources() { |
2752 ASSERT(!IsActive()); | 2760 ASSERT(!IsActive()); |
2753 } | 2761 } |
2754 | 2762 |
2755 } } // namespace v8::internal | 2763 } } // namespace v8::internal |
OLD | NEW |