Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: src/api.cc

Issue 718043002: Add a version tag for cached data. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/v8.h ('k') | src/flags.h » ('j') | src/flags.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
(...skipping 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after
1839 } // HandleScope goes out of scope. 1839 } // HandleScope goes out of scope.
1840 i::Handle<i::SharedFunctionInfo> result(raw_result, isolate); 1840 i::Handle<i::SharedFunctionInfo> result(raw_result, isolate);
1841 Local<UnboundScript> generic = ToApiHandle<UnboundScript>(result); 1841 Local<UnboundScript> generic = ToApiHandle<UnboundScript>(result);
1842 if (generic.IsEmpty()) { 1842 if (generic.IsEmpty()) {
1843 return Local<Script>(); 1843 return Local<Script>();
1844 } 1844 }
1845 return generic->BindToCurrentContext(); 1845 return generic->BindToCurrentContext();
1846 } 1846 }
1847 1847
1848 1848
1849 uint32_t ScriptCompiler::CachedDataVersionTag() {
1850 return internal::Version::Hash() ^ internal::FlagList::Hash() ^
1851 internal::CpuFeatures::SupportedFeatures();
Sven Panne 2014/11/12 15:55:31 This is a very bad hash, please use the hashing fa
vogelheim 2014/11/12 18:34:30 Done. Thanks; I was looking for something like th
1852 }
1853
1854
1849 Local<Script> Script::Compile(v8::Handle<String> source, 1855 Local<Script> Script::Compile(v8::Handle<String> source,
1850 v8::ScriptOrigin* origin) { 1856 v8::ScriptOrigin* origin) {
1851 i::Handle<i::String> str = Utils::OpenHandle(*source); 1857 i::Handle<i::String> str = Utils::OpenHandle(*source);
1852 if (origin) { 1858 if (origin) {
1853 ScriptCompiler::Source script_source(source, *origin); 1859 ScriptCompiler::Source script_source(source, *origin);
1854 return ScriptCompiler::Compile( 1860 return ScriptCompiler::Compile(
1855 reinterpret_cast<v8::Isolate*>(str->GetIsolate()), 1861 reinterpret_cast<v8::Isolate*>(str->GetIsolate()),
1856 &script_source); 1862 &script_source);
1857 } 1863 }
1858 ScriptCompiler::Source script_source(source); 1864 ScriptCompiler::Source script_source(source);
(...skipping 5917 matching lines...) Expand 10 before | Expand all | Expand 10 after
7776 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7782 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7777 Address callback_address = 7783 Address callback_address =
7778 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7784 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7779 VMState<EXTERNAL> state(isolate); 7785 VMState<EXTERNAL> state(isolate);
7780 ExternalCallbackScope call_scope(isolate, callback_address); 7786 ExternalCallbackScope call_scope(isolate, callback_address);
7781 callback(info); 7787 callback(info);
7782 } 7788 }
7783 7789
7784 7790
7785 } } // namespace v8::internal 7791 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/flags.h » ('j') | src/flags.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698