OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
11 #include <cmath> // For isnan. | 11 #include <cmath> // For isnan. |
12 #include "include/v8-debug.h" | 12 #include "include/v8-debug.h" |
13 #include "include/v8-profiler.h" | 13 #include "include/v8-profiler.h" |
14 #include "include/v8-testing.h" | 14 #include "include/v8-testing.h" |
15 #include "src/assert-scope.h" | 15 #include "src/assert-scope.h" |
16 #include "src/background-parsing-task.h" | 16 #include "src/background-parsing-task.h" |
| 17 #include "src/base/functional.h" |
17 #include "src/base/platform/platform.h" | 18 #include "src/base/platform/platform.h" |
18 #include "src/base/platform/time.h" | 19 #include "src/base/platform/time.h" |
19 #include "src/base/utils/random-number-generator.h" | 20 #include "src/base/utils/random-number-generator.h" |
20 #include "src/bootstrapper.h" | 21 #include "src/bootstrapper.h" |
21 #include "src/code-stubs.h" | 22 #include "src/code-stubs.h" |
22 #include "src/compiler.h" | 23 #include "src/compiler.h" |
23 #include "src/conversions-inl.h" | 24 #include "src/conversions-inl.h" |
24 #include "src/counters.h" | 25 #include "src/counters.h" |
25 #include "src/cpu-profiler.h" | 26 #include "src/cpu-profiler.h" |
26 #include "src/debug.h" | 27 #include "src/debug.h" |
(...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1839 } // HandleScope goes out of scope. | 1840 } // HandleScope goes out of scope. |
1840 i::Handle<i::SharedFunctionInfo> result(raw_result, isolate); | 1841 i::Handle<i::SharedFunctionInfo> result(raw_result, isolate); |
1841 Local<UnboundScript> generic = ToApiHandle<UnboundScript>(result); | 1842 Local<UnboundScript> generic = ToApiHandle<UnboundScript>(result); |
1842 if (generic.IsEmpty()) { | 1843 if (generic.IsEmpty()) { |
1843 return Local<Script>(); | 1844 return Local<Script>(); |
1844 } | 1845 } |
1845 return generic->BindToCurrentContext(); | 1846 return generic->BindToCurrentContext(); |
1846 } | 1847 } |
1847 | 1848 |
1848 | 1849 |
| 1850 uint32_t ScriptCompiler::CachedDataVersionTag() { |
| 1851 return static_cast<uint32_t>(base::hash_combine( |
| 1852 internal::Version::Hash(), internal::FlagList::Hash(), |
| 1853 static_cast<uint32_t>(internal::CpuFeatures::SupportedFeatures()))); |
| 1854 } |
| 1855 |
| 1856 |
1849 Local<Script> Script::Compile(v8::Handle<String> source, | 1857 Local<Script> Script::Compile(v8::Handle<String> source, |
1850 v8::ScriptOrigin* origin) { | 1858 v8::ScriptOrigin* origin) { |
1851 i::Handle<i::String> str = Utils::OpenHandle(*source); | 1859 i::Handle<i::String> str = Utils::OpenHandle(*source); |
1852 if (origin) { | 1860 if (origin) { |
1853 ScriptCompiler::Source script_source(source, *origin); | 1861 ScriptCompiler::Source script_source(source, *origin); |
1854 return ScriptCompiler::Compile( | 1862 return ScriptCompiler::Compile( |
1855 reinterpret_cast<v8::Isolate*>(str->GetIsolate()), | 1863 reinterpret_cast<v8::Isolate*>(str->GetIsolate()), |
1856 &script_source); | 1864 &script_source); |
1857 } | 1865 } |
1858 ScriptCompiler::Source script_source(source); | 1866 ScriptCompiler::Source script_source(source); |
(...skipping 5911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7770 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7778 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7771 Address callback_address = | 7779 Address callback_address = |
7772 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7780 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7773 VMState<EXTERNAL> state(isolate); | 7781 VMState<EXTERNAL> state(isolate); |
7774 ExternalCallbackScope call_scope(isolate, callback_address); | 7782 ExternalCallbackScope call_scope(isolate, callback_address); |
7775 callback(info); | 7783 callback(info); |
7776 } | 7784 } |
7777 | 7785 |
7778 | 7786 |
7779 } } // namespace v8::internal | 7787 } } // namespace v8::internal |
OLD | NEW |