| 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/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/extensions/externalize-string-extension.h" | 9 #include "src/extensions/externalize-string-extension.h" |
| 10 #include "src/extensions/free-buffer-extension.h" | 10 #include "src/extensions/free-buffer-extension.h" |
| (...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1497 HandleScope scope(isolate); | 1497 HandleScope scope(isolate); |
| 1498 Handle<SharedFunctionInfo> function_info; | 1498 Handle<SharedFunctionInfo> function_info; |
| 1499 | 1499 |
| 1500 // If we can't find the function in the cache, we compile a new | 1500 // If we can't find the function in the cache, we compile a new |
| 1501 // function and insert it into the cache. | 1501 // function and insert it into the cache. |
| 1502 if (cache == NULL || !cache->Lookup(name, &function_info)) { | 1502 if (cache == NULL || !cache->Lookup(name, &function_info)) { |
| 1503 ASSERT(source->IsOneByteRepresentation()); | 1503 ASSERT(source->IsOneByteRepresentation()); |
| 1504 Handle<String> script_name = | 1504 Handle<String> script_name = |
| 1505 factory->NewStringFromUtf8(name).ToHandleChecked(); | 1505 factory->NewStringFromUtf8(name).ToHandleChecked(); |
| 1506 function_info = Compiler::CompileScript( | 1506 function_info = Compiler::CompileScript( |
| 1507 source, | 1507 source, script_name, 0, 0, false, top_context, extension, NULL, |
| 1508 script_name, | 1508 ScriptCompiler::kNoCompileOptions, |
| 1509 0, | |
| 1510 0, | |
| 1511 false, | |
| 1512 top_context, | |
| 1513 extension, | |
| 1514 NULL, | |
| 1515 NO_CACHED_DATA, | |
| 1516 use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE); | 1509 use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE); |
| 1517 if (function_info.is_null()) return false; | 1510 if (function_info.is_null()) return false; |
| 1518 if (cache != NULL) cache->Add(name, function_info); | 1511 if (cache != NULL) cache->Add(name, function_info); |
| 1519 } | 1512 } |
| 1520 | 1513 |
| 1521 // Set up the function context. Conceptually, we should clone the | 1514 // Set up the function context. Conceptually, we should clone the |
| 1522 // function before overwriting the context but since we're in a | 1515 // function before overwriting the context but since we're in a |
| 1523 // single-threaded environment it is not strictly necessary. | 1516 // single-threaded environment it is not strictly necessary. |
| 1524 ASSERT(top_context->IsNativeContext()); | 1517 ASSERT(top_context->IsNativeContext()); |
| 1525 Handle<Context> context = | 1518 Handle<Context> context = |
| (...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2705 return from + sizeof(NestingCounterType); | 2698 return from + sizeof(NestingCounterType); |
| 2706 } | 2699 } |
| 2707 | 2700 |
| 2708 | 2701 |
| 2709 // Called when the top-level V8 mutex is destroyed. | 2702 // Called when the top-level V8 mutex is destroyed. |
| 2710 void Bootstrapper::FreeThreadResources() { | 2703 void Bootstrapper::FreeThreadResources() { |
| 2711 ASSERT(!IsActive()); | 2704 ASSERT(!IsActive()); |
| 2712 } | 2705 } |
| 2713 | 2706 |
| 2714 } } // namespace v8::internal | 2707 } } // namespace v8::internal |
| OLD | NEW |