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

Side by Side Diff: src/wasm/wasm-module.h

Issue 2574133002: [wasm] Enforce limits for maximums for many WebAssembly binary entities. (Closed)
Patch Set: Address review comments. Created 4 years 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/wasm/wasm-limits.h ('k') | test/unittests/wasm/ast-decoder-unittest.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_WASM_MODULE_H_ 5 #ifndef V8_WASM_MODULE_H_
6 #define V8_WASM_MODULE_H_ 6 #define V8_WASM_MODULE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "src/api.h" 10 #include "src/api.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 kNameSectionCode = 12, // Name section (encoded as a string) 55 kNameSectionCode = 12, // Name section (encoded as a string)
56 }; 56 };
57 57
58 inline bool IsValidSectionCode(uint8_t byte) { 58 inline bool IsValidSectionCode(uint8_t byte) {
59 return kTypeSectionCode <= byte && byte <= kDataSectionCode; 59 return kTypeSectionCode <= byte && byte <= kDataSectionCode;
60 } 60 }
61 61
62 const char* SectionName(WasmSectionCode code); 62 const char* SectionName(WasmSectionCode code);
63 63
64 // Constants for fixed-size elements within a module. 64 // Constants for fixed-size elements within a module.
65 static const uint32_t kMaxReturnCount = 1;
66 static const uint8_t kResizableMaximumFlag = 1; 65 static const uint8_t kResizableMaximumFlag = 1;
67 static const int32_t kInvalidFunctionIndex = -1; 66 static const int32_t kInvalidFunctionIndex = -1;
68 67
69 enum WasmExternalKind { 68 enum WasmExternalKind {
70 kExternalFunction = 0, 69 kExternalFunction = 0,
71 kExternalTable = 1, 70 kExternalTable = 1,
72 kExternalMemory = 2, 71 kExternalMemory = 2,
73 kExternalGlobal = 3 72 kExternalGlobal = 3
74 }; 73 };
75 74
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 void ValidateModuleState(Isolate* isolate, Handle<WasmModuleObject> module_obj); 447 void ValidateModuleState(Isolate* isolate, Handle<WasmModuleObject> module_obj);
449 void ValidateOrphanedInstance(Isolate* isolate, 448 void ValidateOrphanedInstance(Isolate* isolate,
450 Handle<WasmInstanceObject> instance); 449 Handle<WasmInstanceObject> instance);
451 450
452 } // namespace testing 451 } // namespace testing
453 } // namespace wasm 452 } // namespace wasm
454 } // namespace internal 453 } // namespace internal
455 } // namespace v8 454 } // namespace v8
456 455
457 #endif // V8_WASM_MODULE_H_ 456 #endif // V8_WASM_MODULE_H_
OLDNEW
« no previous file with comments | « src/wasm/wasm-limits.h ('k') | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698