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

Side by Side Diff: src/type-cache.h

Issue 1847543002: Expose a lower bound of malloc'd memory via heap statistics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 years, 8 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/runtime/runtime-internal.cc ('k') | src/wasm/ast-decoder.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_TYPE_CACHE_H_ 5 #ifndef V8_TYPE_CACHE_H_
6 #define V8_TYPE_CACHE_H_ 6 #define V8_TYPE_CACHE_H_
7 7
8 #include "src/types.h" 8 #include "src/types.h"
9 9
10 namespace v8 { 10 namespace v8 {
11 namespace internal { 11 namespace internal {
12 12
13 class TypeCache final { 13 class TypeCache final {
14 private: 14 private:
15 // This has to be first for the initialization magic to work. 15 // This has to be first for the initialization magic to work.
16 base::AccountingAllocator allocator;
16 Zone zone_; 17 Zone zone_;
17 18
18 public: 19 public:
19 static TypeCache const& Get(); 20 static TypeCache const& Get();
20 21
21 TypeCache() = default; 22 TypeCache() : zone_(&allocator) {}
22 23
23 Type* const kInt8 = 24 Type* const kInt8 =
24 CreateNative(CreateRange<int8_t>(), Type::UntaggedIntegral8()); 25 CreateNative(CreateRange<int8_t>(), Type::UntaggedIntegral8());
25 Type* const kUint8 = 26 Type* const kUint8 =
26 CreateNative(CreateRange<uint8_t>(), Type::UntaggedIntegral8()); 27 CreateNative(CreateRange<uint8_t>(), Type::UntaggedIntegral8());
27 Type* const kUint8Clamped = kUint8; 28 Type* const kUint8Clamped = kUint8;
28 Type* const kInt16 = 29 Type* const kInt16 =
29 CreateNative(CreateRange<int16_t>(), Type::UntaggedIntegral16()); 30 CreateNative(CreateRange<int16_t>(), Type::UntaggedIntegral16());
30 Type* const kUint16 = 31 Type* const kUint16 =
31 CreateNative(CreateRange<uint16_t>(), Type::UntaggedIntegral16()); 32 CreateNative(CreateRange<uint16_t>(), Type::UntaggedIntegral16());
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 return Type::Range(min, max, zone()); 142 return Type::Range(min, max, zone());
142 } 143 }
143 144
144 Zone* zone() { return &zone_; } 145 Zone* zone() { return &zone_; }
145 }; 146 };
146 147
147 } // namespace internal 148 } // namespace internal
148 } // namespace v8 149 } // namespace v8
149 150
150 #endif // V8_TYPE_CACHE_H_ 151 #endif // V8_TYPE_CACHE_H_
OLDNEW
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | src/wasm/ast-decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698