| 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 "src/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
| 9 #include "src/base/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 | 1534 |
| 1535 | 1535 |
| 1536 bool Genesis::CompileNative(Isolate* isolate, Vector<const char> name, | 1536 bool Genesis::CompileNative(Isolate* isolate, Vector<const char> name, |
| 1537 Handle<String> source, int argc, | 1537 Handle<String> source, int argc, |
| 1538 Handle<Object> argv[]) { | 1538 Handle<Object> argv[]) { |
| 1539 SuppressDebug compiling_natives(isolate->debug()); | 1539 SuppressDebug compiling_natives(isolate->debug()); |
| 1540 // During genesis, the boilerplate for stack overflow won't work until the | 1540 // During genesis, the boilerplate for stack overflow won't work until the |
| 1541 // environment has been at least partially initialized. Add a stack check | 1541 // environment has been at least partially initialized. Add a stack check |
| 1542 // before entering JS code to catch overflow early. | 1542 // before entering JS code to catch overflow early. |
| 1543 StackLimitCheck check(isolate); | 1543 StackLimitCheck check(isolate); |
| 1544 if (check.HasOverflowed()) { | 1544 if (check.JsHasOverflowed(1 * KB)) { |
| 1545 isolate->StackOverflow(); | 1545 isolate->StackOverflow(); |
| 1546 return false; | 1546 return false; |
| 1547 } | 1547 } |
| 1548 | 1548 |
| 1549 Handle<Context> context(isolate->context()); | 1549 Handle<Context> context(isolate->context()); |
| 1550 | 1550 |
| 1551 Handle<String> script_name = | 1551 Handle<String> script_name = |
| 1552 isolate->factory()->NewStringFromUtf8(name).ToHandleChecked(); | 1552 isolate->factory()->NewStringFromUtf8(name).ToHandleChecked(); |
| 1553 Handle<SharedFunctionInfo> function_info = Compiler::CompileScript( | 1553 Handle<SharedFunctionInfo> function_info = Compiler::CompileScript( |
| 1554 source, script_name, 0, 0, ScriptOriginOptions(), Handle<Object>(), | 1554 source, script_name, 0, 0, ScriptOriginOptions(), Handle<Object>(), |
| (...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3198 } | 3198 } |
| 3199 | 3199 |
| 3200 | 3200 |
| 3201 // Called when the top-level V8 mutex is destroyed. | 3201 // Called when the top-level V8 mutex is destroyed. |
| 3202 void Bootstrapper::FreeThreadResources() { | 3202 void Bootstrapper::FreeThreadResources() { |
| 3203 DCHECK(!IsActive()); | 3203 DCHECK(!IsActive()); |
| 3204 } | 3204 } |
| 3205 | 3205 |
| 3206 } // namespace internal | 3206 } // namespace internal |
| 3207 } // namespace v8 | 3207 } // namespace v8 |
| OLD | NEW |