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

Side by Side Diff: src/objects.h

Issue 2226753002: [wasm] external serialization APIs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 | « src/api.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 V(JSError) \ 995 V(JSError) \
996 V(JSPromise) \ 996 V(JSPromise) \
997 V(JSSet) \ 997 V(JSSet) \
998 V(JSMap) \ 998 V(JSMap) \
999 V(JSSetIterator) \ 999 V(JSSetIterator) \
1000 V(JSMapIterator) \ 1000 V(JSMapIterator) \
1001 V(JSWeakCollection) \ 1001 V(JSWeakCollection) \
1002 V(JSWeakMap) \ 1002 V(JSWeakMap) \
1003 V(JSWeakSet) \ 1003 V(JSWeakSet) \
1004 V(JSRegExp) \ 1004 V(JSRegExp) \
1005 V(WebAssemblyCompiledModule) \
1005 V(HashTable) \ 1006 V(HashTable) \
1006 V(Dictionary) \ 1007 V(Dictionary) \
1007 V(UnseededNumberDictionary) \ 1008 V(UnseededNumberDictionary) \
1008 V(StringTable) \ 1009 V(StringTable) \
1009 V(StringSet) \ 1010 V(StringSet) \
1010 V(NormalizedMapCache) \ 1011 V(NormalizedMapCache) \
1011 V(CompilationCacheTable) \ 1012 V(CompilationCacheTable) \
1012 V(CodeCacheHashTable) \ 1013 V(CodeCacheHashTable) \
1013 V(MapCache) \ 1014 V(MapCache) \
1014 V(JSGlobalObject) \ 1015 V(JSGlobalObject) \
(...skipping 7127 matching lines...) Expand 10 before | Expand all | Expand 10 after
8142 static const int kStackFramesOffset = kScriptOffset + kPointerSize; 8143 static const int kStackFramesOffset = kScriptOffset + kPointerSize;
8143 static const int kStartPositionOffset = kStackFramesOffset + kPointerSize; 8144 static const int kStartPositionOffset = kStackFramesOffset + kPointerSize;
8144 static const int kEndPositionOffset = kStartPositionOffset + kPointerSize; 8145 static const int kEndPositionOffset = kStartPositionOffset + kPointerSize;
8145 static const int kSize = kEndPositionOffset + kPointerSize; 8146 static const int kSize = kEndPositionOffset + kPointerSize;
8146 8147
8147 typedef FixedBodyDescriptor<HeapObject::kMapOffset, 8148 typedef FixedBodyDescriptor<HeapObject::kMapOffset,
8148 kStackFramesOffset + kPointerSize, 8149 kStackFramesOffset + kPointerSize,
8149 kSize> BodyDescriptor; 8150 kSize> BodyDescriptor;
8150 }; 8151 };
8151 8152
8153 // A compiled web assembly module.
8154 class WebAssemblyCompiledModule : public JSObject {
8155 public:
8156 // Serialize the compiled module. The returned buffer is owned by
8157 // the caller, who may simply leave the return value drop out of
8158 // scope, once done processing the bytes.
8159 // TODO(mtrofin): to avoid increased memory pressure, we should
8160 // explore a caller-provided segmented memory design.
8161 std::pair<std::unique_ptr<const byte>, size_t> Serialize();
8162
8163 // Deserialize a compiled module. The buffer is owned by the caller and may
8164 // be released after deserialization returns.
8165 static MaybeHandle<WebAssemblyCompiledModule> Deserialize(Isolate* isolate,
8166 const byte* data,
8167 size_t size);
8168
8169 private:
8170 DISALLOW_IMPLICIT_CONSTRUCTORS(WebAssemblyCompiledModule);
8171 };
8152 8172
8153 // Regular expressions 8173 // Regular expressions
8154 // The regular expression holds a single reference to a FixedArray in 8174 // The regular expression holds a single reference to a FixedArray in
8155 // the kDataOffset field. 8175 // the kDataOffset field.
8156 // The FixedArray contains the following data: 8176 // The FixedArray contains the following data:
8157 // - tag : type of regexp implementation (not compiled yet, atom or irregexp) 8177 // - tag : type of regexp implementation (not compiled yet, atom or irregexp)
8158 // - reference to the original source string 8178 // - reference to the original source string
8159 // - reference to the original flag string 8179 // - reference to the original flag string
8160 // If it is an atom regexp 8180 // If it is an atom regexp
8161 // - a reference to a literal string to search for 8181 // - a reference to a literal string to search for
(...skipping 2905 matching lines...) Expand 10 before | Expand all | Expand 10 after
11067 } 11087 }
11068 return value; 11088 return value;
11069 } 11089 }
11070 }; 11090 };
11071 11091
11072 11092
11073 } // NOLINT, false-positive due to second-order macros. 11093 } // NOLINT, false-positive due to second-order macros.
11074 } // NOLINT, false-positive due to second-order macros. 11094 } // NOLINT, false-positive due to second-order macros.
11075 11095
11076 #endif // V8_OBJECTS_H_ 11096 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698