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/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/extensions/externalize-string-extension.h" | 10 #include "src/extensions/externalize-string-extension.h" |
(...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 HandleScope scope(isolate); | 1458 HandleScope scope(isolate); |
1459 Handle<SharedFunctionInfo> function_info; | 1459 Handle<SharedFunctionInfo> function_info; |
1460 | 1460 |
1461 // If we can't find the function in the cache, we compile a new | 1461 // If we can't find the function in the cache, we compile a new |
1462 // function and insert it into the cache. | 1462 // function and insert it into the cache. |
1463 if (cache == NULL || !cache->Lookup(name, &function_info)) { | 1463 if (cache == NULL || !cache->Lookup(name, &function_info)) { |
1464 DCHECK(source->IsOneByteRepresentation()); | 1464 DCHECK(source->IsOneByteRepresentation()); |
1465 Handle<String> script_name = | 1465 Handle<String> script_name = |
1466 factory->NewStringFromUtf8(name).ToHandleChecked(); | 1466 factory->NewStringFromUtf8(name).ToHandleChecked(); |
1467 function_info = Compiler::CompileScript( | 1467 function_info = Compiler::CompileScript( |
1468 source, script_name, 0, 0, false, false, top_context, extension, NULL, | 1468 source, script_name, 0, 0, false, false, Handle<Object>(), top_context, |
1469 ScriptCompiler::kNoCompileOptions, | 1469 extension, NULL, ScriptCompiler::kNoCompileOptions, |
1470 use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE, false); | 1470 use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE, false); |
1471 if (function_info.is_null()) return false; | 1471 if (function_info.is_null()) return false; |
1472 if (cache != NULL) cache->Add(name, function_info); | 1472 if (cache != NULL) cache->Add(name, function_info); |
1473 } | 1473 } |
1474 | 1474 |
1475 // Set up the function context. Conceptually, we should clone the | 1475 // Set up the function context. Conceptually, we should clone the |
1476 // function before overwriting the context but since we're in a | 1476 // function before overwriting the context but since we're in a |
1477 // single-threaded environment it is not strictly necessary. | 1477 // single-threaded environment it is not strictly necessary. |
1478 DCHECK(top_context->IsNativeContext()); | 1478 DCHECK(top_context->IsNativeContext()); |
1479 Handle<Context> context = | 1479 Handle<Context> context = |
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2932 return from + sizeof(NestingCounterType); | 2932 return from + sizeof(NestingCounterType); |
2933 } | 2933 } |
2934 | 2934 |
2935 | 2935 |
2936 // Called when the top-level V8 mutex is destroyed. | 2936 // Called when the top-level V8 mutex is destroyed. |
2937 void Bootstrapper::FreeThreadResources() { | 2937 void Bootstrapper::FreeThreadResources() { |
2938 DCHECK(!IsActive()); | 2938 DCHECK(!IsActive()); |
2939 } | 2939 } |
2940 | 2940 |
2941 } } // namespace v8::internal | 2941 } } // namespace v8::internal |
OLD | NEW |