| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "bootstrapper.h" | 5 #include "bootstrapper.h" |
| 6 | 6 |
| 7 #include "accessors.h" | 7 #include "accessors.h" |
| 8 #include "isolate-inl.h" | 8 #include "isolate-inl.h" |
| 9 #include "natives.h" | 9 #include "natives.h" |
| 10 #include "snapshot.h" | 10 #include "snapshot.h" |
| (...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1414 ExperimentalNatives::GetRawScriptSource(index)), | 1414 ExperimentalNatives::GetRawScriptSource(index)), |
| 1415 false); | 1415 false); |
| 1416 return CompileNative(isolate, name, source_code); | 1416 return CompileNative(isolate, name, source_code); |
| 1417 } | 1417 } |
| 1418 | 1418 |
| 1419 | 1419 |
| 1420 bool Genesis::CompileNative(Isolate* isolate, | 1420 bool Genesis::CompileNative(Isolate* isolate, |
| 1421 Vector<const char> name, | 1421 Vector<const char> name, |
| 1422 Handle<String> source) { | 1422 Handle<String> source) { |
| 1423 HandleScope scope(isolate); | 1423 HandleScope scope(isolate); |
| 1424 isolate->debugger()->set_compiling_natives(true); | 1424 Debugger::IgnoreScope compiling_natives(isolate->debugger()); |
| 1425 // During genesis, the boilerplate for stack overflow won't work until the | 1425 // During genesis, the boilerplate for stack overflow won't work until the |
| 1426 // environment has been at least partially initialized. Add a stack check | 1426 // environment has been at least partially initialized. Add a stack check |
| 1427 // before entering JS code to catch overflow early. | 1427 // before entering JS code to catch overflow early. |
| 1428 StackLimitCheck check(isolate); | 1428 StackLimitCheck check(isolate); |
| 1429 if (check.HasOverflowed()) return false; | 1429 if (check.HasOverflowed()) return false; |
| 1430 | 1430 |
| 1431 bool result = CompileScriptCached(isolate, | 1431 bool result = CompileScriptCached(isolate, |
| 1432 name, | 1432 name, |
| 1433 source, | 1433 source, |
| 1434 NULL, | 1434 NULL, |
| 1435 NULL, | 1435 NULL, |
| 1436 Handle<Context>(isolate->context()), | 1436 Handle<Context>(isolate->context()), |
| 1437 true); | 1437 true); |
| 1438 ASSERT(isolate->has_pending_exception() != result); | 1438 ASSERT(isolate->has_pending_exception() != result); |
| 1439 if (!result) isolate->clear_pending_exception(); | 1439 if (!result) isolate->clear_pending_exception(); |
| 1440 isolate->debugger()->set_compiling_natives(false); | |
| 1441 return result; | 1440 return result; |
| 1442 } | 1441 } |
| 1443 | 1442 |
| 1444 | 1443 |
| 1445 bool Genesis::CompileScriptCached(Isolate* isolate, | 1444 bool Genesis::CompileScriptCached(Isolate* isolate, |
| 1446 Vector<const char> name, | 1445 Vector<const char> name, |
| 1447 Handle<String> source, | 1446 Handle<String> source, |
| 1448 SourceCodeCache* cache, | 1447 SourceCodeCache* cache, |
| 1449 v8::Extension* extension, | 1448 v8::Extension* extension, |
| 1450 Handle<Context> top_context, | 1449 Handle<Context> top_context, |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2654 return from + sizeof(NestingCounterType); | 2653 return from + sizeof(NestingCounterType); |
| 2655 } | 2654 } |
| 2656 | 2655 |
| 2657 | 2656 |
| 2658 // Called when the top-level V8 mutex is destroyed. | 2657 // Called when the top-level V8 mutex is destroyed. |
| 2659 void Bootstrapper::FreeThreadResources() { | 2658 void Bootstrapper::FreeThreadResources() { |
| 2660 ASSERT(!IsActive()); | 2659 ASSERT(!IsActive()); |
| 2661 } | 2660 } |
| 2662 | 2661 |
| 2663 } } // namespace v8::internal | 2662 } } // namespace v8::internal |
| OLD | NEW |