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

Side by Side Diff: include/v8.h

Issue 2395793003: [wasm] Support recompilation if deserialization fails. (Closed)
Patch Set: Feedback Created 4 years, 2 months 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
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.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 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 3884 matching lines...) Expand 10 before | Expand all | Expand 10 after
3895 V8_INLINE static Proxy* Cast(Value* obj); 3895 V8_INLINE static Proxy* Cast(Value* obj);
3896 3896
3897 private: 3897 private:
3898 Proxy(); 3898 Proxy();
3899 static void CheckCast(Value* obj); 3899 static void CheckCast(Value* obj);
3900 }; 3900 };
3901 3901
3902 class V8_EXPORT WasmCompiledModule : public Object { 3902 class V8_EXPORT WasmCompiledModule : public Object {
3903 public: 3903 public:
3904 typedef std::pair<std::unique_ptr<const uint8_t[]>, size_t> SerializedModule; 3904 typedef std::pair<std::unique_ptr<const uint8_t[]>, size_t> SerializedModule;
3905 // Get the uncompiled bytes that were used to compile this module.
3906 Local<String> GetUncompiledBytes();
3905 3907
3908 // Serialize the compiled module. The serialized data does not include the
3909 // uncompiled bytes.
3906 SerializedModule Serialize(); 3910 SerializedModule Serialize();
3911
3912 // TODO(mtrofin): Back-compat. Move to private once change lands in Chrome.
3913 // The resulting wasm setup won't have its uncompiled bytes available.
3907 static MaybeLocal<WasmCompiledModule> Deserialize( 3914 static MaybeLocal<WasmCompiledModule> Deserialize(
3908 Isolate* isolate, const SerializedModule& serialized_data); 3915 Isolate* isolate, const SerializedModule& serialized_data);
3916 // If possible, deserialize the module, otherwise compile it from the provided
3917 // uncompiled bytes.
3918 static MaybeLocal<WasmCompiledModule> DeserializeOrCompile(
3919 Isolate* isolate, const SerializedModule& serialized_data,
3920 Local<String> uncompiled_bytes);
3909 V8_INLINE static WasmCompiledModule* Cast(Value* obj); 3921 V8_INLINE static WasmCompiledModule* Cast(Value* obj);
3910 3922
3911 private: 3923 private:
3924 static MaybeLocal<WasmCompiledModule> Compile(Isolate* isolate,
3925 Local<String> bytes);
3912 WasmCompiledModule(); 3926 WasmCompiledModule();
3913 static void CheckCast(Value* obj); 3927 static void CheckCast(Value* obj);
3914 }; 3928 };
3915 3929
3916 #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 3930 #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT
3917 // The number of required internal fields can be defined by embedder. 3931 // The number of required internal fields can be defined by embedder.
3918 #define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2 3932 #define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2
3919 #endif 3933 #endif
3920 3934
3921 3935
(...skipping 5729 matching lines...) Expand 10 before | Expand all | Expand 10 after
9651 */ 9665 */
9652 9666
9653 9667
9654 } // namespace v8 9668 } // namespace v8
9655 9669
9656 9670
9657 #undef TYPE_CHECK 9671 #undef TYPE_CHECK
9658 9672
9659 9673
9660 #endif // INCLUDE_V8_H_ 9674 #endif // INCLUDE_V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698