v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
module.cc
Go to the documentation of this file.
1// Copyright 2017 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
7#include <unordered_map>
8#include <unordered_set>
9
10#include "src/api/api-inl.h"
11#include "src/ast/modules.h"
14#include "src/heap/heap-inl.h"
23#include "src/utils/ostreams.h"
24
25namespace v8 {
26namespace internal {
27
28namespace {
29#ifdef DEBUG
30void PrintModuleName(Tagged<Module> module, std::ostream& os) {
31 if (IsSourceTextModule(module)) {
32 Print(Cast<SourceTextModule>(module)->GetScript()->GetNameOrSourceURL(),
33 os);
34 } else {
35 Print(Cast<SyntheticModule>(module)->name(), os);
36 }
37#ifndef OBJECT_PRINT
38 os << "\n";
39#endif // OBJECT_PRINT
40}
41
42void PrintStatusTransition(Tagged<Module> module, Module::Status old_status) {
43 if (!v8_flags.trace_module_status) return;
44 StdoutStream os;
45 os << "Changing module status from " << Module::StatusString(old_status)
46 << " to "
47 << Module::StatusString(static_cast<Module::Status>(module->status()))
48 << " for ";
49 PrintModuleName(module, os);
50}
51
52void PrintStatusMessage(Tagged<Module> module, const char* message) {
53 if (!v8_flags.trace_module_status) return;
54 StdoutStream os;
55 os << "Instantiating module ";
56 PrintModuleName(module, os);
57}
58#endif // DEBUG
59
60void SetStatusInternal(Tagged<Module> module, Module::Status new_status) {
62#ifdef DEBUG
63 Module::Status old_status = static_cast<Module::Status>(module->status());
64 module->set_status(new_status);
65 PrintStatusTransition(module, old_status);
66#else
67 module->set_status(new_status);
68#endif // DEBUG
69}
70
71} // end namespace
72
73#ifdef DEBUG
74// static
75const char* Module::StatusString(Module::Status status) {
76 switch (status) {
78 return "Unlinked";
80 return "PreLinking";
82 return "Linking";
83 case Module::kLinked:
84 return "Linked";
86 return "Evaluating";
88 return "EvaluatingAsync";
90 return "Evaluated";
92 return "Errored";
93 }
94}
95#endif // DEBUG
96
97void Module::SetStatus(Status new_status) {
99 DCHECK_LE(status(), new_status);
100 DCHECK_NE(new_status, Module::kErrored);
101 SetStatusInternal(*this, new_status);
102}
103
106 // Allow overriding exceptions with termination exceptions.
107 DCHECK_IMPLIES(isolate->is_catchable_by_javascript(error),
108 IsTheHole(exception(), isolate));
109 DCHECK(!IsTheHole(error, isolate));
110 if (IsSourceTextModule(*this)) {
111 // Revert to minimal SFI in case we have already been instantiating or
112 // evaluating.
113 auto self = Cast<SourceTextModule>(*this);
114 self->set_code(self->GetSharedFunctionInfo());
115 }
116 SetStatusInternal(*this, Module::kErrored);
117 if (isolate->is_catchable_by_javascript(error)) {
118 set_exception(error);
119 } else {
120 // v8::TryCatch uses `null` for termination exceptions.
121 set_exception(ReadOnlyRoots(isolate).null_value());
122 }
123}
124
126 DCHECK_NE(module->status(), kEvaluating);
127 if (module->status() != kPreLinking && module->status() != kLinking) {
128 return;
129 }
130
131 DirectHandle<FixedArray> requested_modules =
132 IsSourceTextModule(*module)
134 Cast<SourceTextModule>(*module)->requested_modules(), isolate)
136 Reset(isolate, module);
137
138 if (!IsSourceTextModule(*module)) {
139 DCHECK(IsSyntheticModule(*module));
140 return;
141 }
142 for (int i = 0; i < requested_modules->length(); ++i) {
143 DirectHandle<Object> descendant(requested_modules->get(i), isolate);
144 if (IsModule(*descendant)) {
145 ResetGraph(isolate, Cast<Module>(descendant));
146 } else {
147 // The requested module is either an undefined or a WasmModule object.
148#if V8_ENABLE_WEBASSEMBLY
149 DCHECK(IsUndefined(*descendant, isolate) ||
150 IsWasmModuleObject(*descendant));
151#else
152 DCHECK(IsUndefined(*descendant, isolate));
153#endif
154 }
155 }
156}
157
159 DCHECK(module->status() == kPreLinking || module->status() == kLinking);
160 DCHECK(IsTheHole(module->exception(), isolate));
161 // The namespace object cannot exist, because it would have been created
162 // by RunInitializationCode, which is called only after this module's SCC
163 // succeeds instantiation.
164 DCHECK(!IsJSModuleNamespace(module->module_namespace()));
165 const int export_count =
166 IsSourceTextModule(*module)
167 ? Cast<SourceTextModule>(*module)->regular_exports()->length()
168 : Cast<SyntheticModule>(*module)->export_names()->length();
170 ObjectHashTable::New(isolate, export_count);
171
172 if (IsSourceTextModule(*module)) {
174 }
175
176 module->set_exports(*exports);
177 SetStatusInternal(*module, kUnlinked);
178}
179
183 DCHECK(!IsTheHole(exception()));
184 return exception();
185}
186
188 DirectHandle<String> module_specifier,
189 Handle<String> export_name,
190 MessageLocation loc, bool must_resolve,
191 Module::ResolveSet* resolve_set) {
192 DCHECK_GE(module->status(), kPreLinking);
193 DCHECK_NE(module->status(), kEvaluating);
194
195 if (IsSourceTextModule(*module)) {
197 isolate, Cast<SourceTextModule>(module), module_specifier, export_name,
198 loc, must_resolve, resolve_set);
199 } else {
201 isolate, Cast<SyntheticModule>(module), module_specifier, export_name,
202 loc, must_resolve);
203 }
204}
205
208 v8::Module::ResolveModuleCallback module_callback,
209 v8::Module::ResolveSourceCallback source_callback) {
210#ifdef DEBUG
211 PrintStatusMessage(*module, "Instantiating module ");
212#endif // DEBUG
213
214 if (!PrepareInstantiate(isolate, module, context, module_callback,
215 source_callback)) {
216 ResetGraph(isolate, module);
217 DCHECK_EQ(module->status(), kUnlinked);
218 return false;
219 }
220 Zone zone(isolate->allocator(), ZONE_NAME);
222 unsigned dfs_index = 0;
223 if (!FinishInstantiate(isolate, module, &stack, &dfs_index, &zone)) {
224 ResetGraph(isolate, module);
225 DCHECK_EQ(module->status(), kUnlinked);
226 return false;
227 }
228 DCHECK(module->status() == kLinked || module->status() == kEvaluated ||
229 module->status() == kEvaluatingAsync || module->status() == kErrored);
230 DCHECK(stack.empty());
231 return true;
232}
233
235 Isolate* isolate, DirectHandle<Module> module,
237 v8::Module::ResolveModuleCallback module_callback,
238 v8::Module::ResolveSourceCallback source_callback) {
239 DCHECK_NE(module->status(), kEvaluating);
240 DCHECK_NE(module->status(), kLinking);
241 if (module->status() >= kPreLinking) return true;
242 module->SetStatus(kPreLinking);
243 STACK_CHECK(isolate, false);
244
245 if (IsSourceTextModule(*module)) {
247 isolate, Cast<SourceTextModule>(module), context, module_callback,
248 source_callback);
249 } else {
251 isolate, Cast<SyntheticModule>(module), context);
252 }
253}
254
257 unsigned* dfs_index, Zone* zone) {
258 DCHECK_NE(module->status(), kEvaluating);
259 if (module->status() >= kLinking) return true;
260 DCHECK_EQ(module->status(), kPreLinking);
261 STACK_CHECK(isolate, false);
262
263 if (IsSourceTextModule(*module)) {
265 isolate, Cast<SourceTextModule>(module), stack, dfs_index, zone);
266 } else {
268 Cast<SyntheticModule>(module));
269 }
270}
271
273 Handle<Module> module) {
274#ifdef DEBUG
275 PrintStatusMessage(*module, "Evaluating module ");
276#endif // DEBUG
277 int module_status = module->status();
278
279 // In the event of errored evaluation, return a rejected promise.
280 if (module_status == kErrored) {
281 // If we have a top level capability we assume it has already been
282 // rejected, and return it here. Otherwise create a new promise and
283 // reject it with the module's exception.
284 if (IsJSPromise(module->top_level_capability())) {
285 DirectHandle<JSPromise> top_level_capability(
286 Cast<JSPromise>(module->top_level_capability()), isolate);
287 DCHECK(top_level_capability->status() == Promise::kRejected &&
288 top_level_capability->result() == module->exception());
289 return top_level_capability;
290 }
291 DirectHandle<JSPromise> capability = isolate->factory()->NewJSPromise();
292 JSPromise::Reject(capability, direct_handle(module->exception(), isolate));
293 return capability;
294 }
295
296 // Start of Evaluate () Concrete Method
297 // 2. Assert: module.[[Status]] is one of LINKED, EVALUATING-ASYNC, or
298 // EVALUATED.
299 CHECK(module_status == kLinked || module_status == kEvaluatingAsync ||
300 module_status == kEvaluated);
301
302 // 3. If module.[[Status]] is either EVALUATING-ASYNC or EVALUATED, set module
303 // to module.[[CycleRoot]].
304 // A Synthetic Module has no children so it is its own cycle root.
305 if (module_status >= kEvaluatingAsync && IsSourceTextModule(*module)) {
306 module = Cast<SourceTextModule>(module)->GetCycleRoot(isolate);
307 }
308
309 // 4. If module.[[TopLevelCapability]] is not EMPTY, then
310 // a. Return module.[[TopLevelCapability]].[[Promise]].
311 if (IsJSPromise(module->top_level_capability())) {
312 return direct_handle(Cast<JSPromise>(module->top_level_capability()),
313 isolate);
314 }
315 DCHECK(IsUndefined(module->top_level_capability()));
316
317 if (IsSourceTextModule(*module)) {
318 return SourceTextModule::Evaluate(isolate, Cast<SourceTextModule>(module));
319 } else {
320 return SyntheticModule::Evaluate(isolate, Cast<SyntheticModule>(module));
321 }
322}
323
325 Isolate* isolate, Handle<Module> module) {
326 DirectHandle<HeapObject> object(module->module_namespace(), isolate);
327 ReadOnlyRoots roots(isolate);
328 if (!IsUndefined(*object, roots)) {
329 // Namespace object already exists.
330 return Cast<JSModuleNamespace>(object);
331 }
332
333 // Collect the export names.
334 Zone zone(isolate->allocator(), ZONE_NAME);
335 UnorderedModuleSet visited(&zone);
336
337 if (IsSourceTextModule(*module)) {
339 &zone, &visited);
340 }
341
342 DirectHandle<ObjectHashTable> exports(module->exports(), isolate);
344 names.reserve(exports->NumberOfElements());
345 for (InternalIndex i : exports->IterateEntries()) {
347 if (!exports->ToKey(roots, i, &key)) continue;
348 names.push_back(handle(Cast<String>(key), isolate));
349 }
350 DCHECK_EQ(static_cast<int>(names.size()), exports->NumberOfElements());
351
352 // Sort them alphabetically.
353 std::sort(names.begin(), names.end(),
355 return String::Compare(isolate, a, b) ==
356 ComparisonResult::kLessThan;
357 });
358
359 // Create the namespace object (initially empty).
361 isolate->factory()->NewJSModuleNamespace();
362 ns->set_module(*module);
363 module->set_module_namespace(*ns);
364
365 // Create the properties in the namespace object. Transition the object
366 // to dictionary mode so that property addition is faster.
369 static_cast<int>(names.size()),
370 "JSModuleNamespace");
372 for (const auto& name : names) {
373 uint32_t index = 0;
374 if (name->AsArrayIndex(&index)) {
376 ns, index, Accessors::MakeModuleNamespaceEntryInfo(isolate, name),
379 } else {
381 ns, name, Accessors::MakeModuleNamespaceEntryInfo(isolate, name),
384 }
385 }
386 JSObject::PreventExtensions(isolate, ns, kThrowOnError).ToChecked();
387
388 // Optimize the namespace object as a prototype, for two reasons:
389 // - The object's map is guaranteed not to be shared. ICs rely on this.
390 // - We can store a pointer from the map back to the namespace object.
391 // Turbofan can use this for inlining the access.
393
394 DirectHandle<PrototypeInfo> proto_info =
396 proto_info->set_module_namespace(*ns);
397 return ns;
398}
399
401 DirectHandle<Object> object(module()->exports()->Lookup(name), isolate);
402 return !IsTheHole(*object, isolate);
403}
404
406 Isolate* isolate, DirectHandle<String> name) {
407 DirectHandle<Object> object(module()->exports()->Lookup(name), isolate);
408 if (IsTheHole(*object, isolate)) {
409 return isolate->factory()->undefined_value();
410 }
411
412 DirectHandle<Object> value(Cast<Cell>(*object)->value(), isolate);
413 if (IsTheHole(*value, isolate)) {
414 // According to https://tc39.es/ecma262/#sec-InnerModuleLinking
415 // step 10 and
416 // https://tc39.es/ecma262/#sec-source-text-module-record-initialize-environment
417 // step 8-25, variables must be declared in Link. And according to
418 // https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-get-p-receiver,
419 // here accessing uninitialized variable error should be thrown.
420 THROW_NEW_ERROR(isolate,
421 NewReferenceError(
422 MessageTemplate::kAccessedUninitializedVariable, name));
423 }
424
425 return value;
426}
427
429 LookupIterator* it) {
430 DirectHandle<JSModuleNamespace> object = it->GetHolder<JSModuleNamespace>();
431 DirectHandle<String> name = Cast<String>(it->GetName());
433
434 Isolate* isolate = it->isolate();
435
436 DirectHandle<Object> lookup(object->module()->exports()->Lookup(name),
437 isolate);
438 if (IsTheHole(*lookup, isolate)) return Just(ABSENT);
439
440 DirectHandle<Object> value(Cast<Cell>(lookup)->value(), isolate);
441 if (IsTheHole(*value, isolate)) {
442 isolate->Throw(*isolate->factory()->NewReferenceError(
443 MessageTemplate::kNotDefined, name));
445 }
446
447 return Just(it->property_attributes());
448}
449
450// ES
451// https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-defineownproperty-p-desc
452// static
456 Maybe<ShouldThrow> should_throw) {
457 // 1. If Type(P) is Symbol, return OrdinaryDefineOwnProperty(O, P, Desc).
458 if (IsSymbol(*key)) {
459 return OrdinaryDefineOwnProperty(isolate, object, key, desc, should_throw);
460 }
461
462 // 2. Let current be ? O.[[GetOwnProperty]](P).
463 PropertyKey lookup_key(isolate, key);
464 LookupIterator it(isolate, object, lookup_key, LookupIterator::OWN);
466 Maybe<bool> has_own = GetOwnPropertyDescriptor(&it, &current);
467 MAYBE_RETURN(has_own, Nothing<bool>());
468
469 // 3. If current is undefined, return false.
470 // 4. If Desc.[[Configurable]] is present and has value true, return false.
471 // 5. If Desc.[[Enumerable]] is present and has value false, return false.
472 // 6. If ! IsAccessorDescriptor(Desc) is true, return false.
473 // 7. If Desc.[[Writable]] is present and has value false, return false.
474 // 8. If Desc.[[Value]] is present, return
475 // SameValue(Desc.[[Value]], current.[[Value]]).
476 if (!has_own.FromJust() ||
477 (desc->has_configurable() && desc->configurable()) ||
478 (desc->has_enumerable() && !desc->enumerable()) ||
480 (desc->has_writable() && !desc->writable()) ||
481 (desc->has_value() &&
482 !Object::SameValue(*desc->value(), *current.value()))) {
483 RETURN_FAILURE(isolate, GetShouldThrow(isolate, should_throw),
484 NewTypeError(MessageTemplate::kRedefineDisallowed, key));
485 }
486
487 return Just(true);
488}
489
490bool Module::IsGraphAsync(Isolate* isolate) const {
492
493 // Only SourceTextModules may be async.
494 if (!IsSourceTextModule(*this)) return false;
496
497 Zone zone(isolate->allocator(), ZONE_NAME);
498 const size_t bucket_count = 2;
499 ZoneUnorderedSet<Tagged<Module>, Module::Hash> visited(&zone, bucket_count);
501 visited.insert(root);
502 worklist.push_back(root);
503
504 do {
505 Tagged<SourceTextModule> current = worklist.back();
506 worklist.pop_back();
507 DCHECK_GE(current->status(), kLinked);
508
509 if (current->has_toplevel_await()) return true;
510 Tagged<FixedArray> requested_modules = current->requested_modules();
511 for (int i = 0, length = requested_modules->length(); i < length; ++i) {
512 Tagged<Module> descendant = Cast<Module>(requested_modules->get(i));
513 if (IsSourceTextModule(descendant)) {
514 const bool cycle = !visited.insert(descendant).second;
515 if (!cycle) worklist.push_back(Cast<SourceTextModule>(descendant));
516 }
517 }
518 } while (!worklist.empty());
519
520 return false;
521}
522
523} // namespace internal
524} // namespace v8
V8_INLINE T FromJust() const &
Definition v8-maybe.h:64
Local< Value > GetModuleNamespace()
Definition api.cc:2174
bool IsGraphAsync() const
Definition api.cc:2211
static DirectHandle< AccessorInfo > MakeModuleNamespaceEntryInfo(Isolate *isolate, DirectHandle< String > name)
Definition accessors.cc:274
Isolate * isolate() const
Definition factory.h:1281
static V8_WARN_UNUSED_RESULT Maybe< bool > DefineOwnProperty(Isolate *isolate, DirectHandle< JSModuleNamespace > o, DirectHandle< Object > key, PropertyDescriptor *desc, Maybe< ShouldThrow > should_throw)
Definition module.cc:453
V8_WARN_UNUSED_RESULT MaybeDirectHandle< Object > GetExport(Isolate *isolate, DirectHandle< String > name)
Definition module.cc:405
static V8_WARN_UNUSED_RESULT Maybe< PropertyAttributes > GetPropertyAttributes(LookupIterator *it)
Definition module.cc:428
bool HasExport(Isolate *isolate, DirectHandle< String > name)
Definition module.cc:400
static V8_EXPORT_PRIVATE DirectHandle< NumberDictionary > NormalizeElements(DirectHandle< JSObject > object)
static void SetNormalizedElement(DirectHandle< JSObject > object, uint32_t index, DirectHandle< Object > value, PropertyDetails details)
static void OptimizeAsPrototype(DirectHandle< JSObject > object, bool enable_setup_mode=true)
static void SetNormalizedProperty(DirectHandle< JSObject > object, DirectHandle< Name > name, DirectHandle< Object > value, PropertyDetails details)
static V8_EXPORT_PRIVATE void NormalizeProperties(Isolate *isolate, DirectHandle< JSObject > object, PropertyNormalizationMode mode, int expected_additional_properties, bool use_cache, const char *reason)
static V8_WARN_UNUSED_RESULT Maybe< bool > PreventExtensions(Isolate *isolate, DirectHandle< JSObject > object, ShouldThrow should_throw)
static Handle< Object > Reject(DirectHandle< JSPromise > promise, DirectHandle< Object > reason, bool debug_event=true)
Definition objects.cc:5069
static DirectHandle< PrototypeInfo > GetOrCreatePrototypeInfo(DirectHandle< Map > prototype_map, Isolate *isolate)
Definition map.cc:2377
static void ResetGraph(Isolate *isolate, DirectHandle< Module > module)
Definition module.cc:125
void RecordError(Isolate *isolate, Tagged< Object > error)
Definition module.cc:104
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< Object > Evaluate(Isolate *isolate, Handle< Module > module)
Definition module.cc:272
Tagged< Object > GetException()
Definition module.cc:180
void SetStatus(Status status)
Definition module.cc:97
static V8_WARN_UNUSED_RESULT bool FinishInstantiate(Isolate *isolate, Handle< Module > module, ZoneForwardList< Handle< SourceTextModule > > *stack, unsigned *dfs_index, Zone *zone)
Definition module.cc:255
static V8_WARN_UNUSED_RESULT MaybeHandle< Cell > ResolveExport(Isolate *isolate, Handle< Module > module, DirectHandle< String > module_specifier, Handle< String > export_name, MessageLocation loc, bool must_resolve, ResolveSet *resolve_set)
Definition module.cc:187
static void Reset(Isolate *isolate, DirectHandle< Module > module)
Definition module.cc:158
static V8_WARN_UNUSED_RESULT bool Instantiate(Isolate *isolate, Handle< Module > module, v8::Local< v8::Context > context, v8::Module::ResolveModuleCallback module_callback, v8::Module::ResolveSourceCallback source_callback)
Definition module.cc:206
static V8_WARN_UNUSED_RESULT bool PrepareInstantiate(Isolate *isolate, DirectHandle< Module > module, v8::Local< v8::Context > context, v8::Module::ResolveModuleCallback module_callback, v8::Module::ResolveSourceCallback source_callback)
Definition module.cc:234
static V8_EXPORT_PRIVATE bool SameValue(Tagged< Object > obj, Tagged< Object > other)
Definition objects.cc:1706
static bool IsAccessorDescriptor(PropertyDescriptor *desc)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< Object > Evaluate(Isolate *isolate, Handle< SourceTextModule > module)
static void FetchStarExports(Isolate *isolate, Handle< SourceTextModule > module, Zone *zone, UnorderedModuleSet *visited)
static V8_WARN_UNUSED_RESULT bool PrepareInstantiate(Isolate *isolate, DirectHandle< SourceTextModule > module, v8::Local< v8::Context > context, v8::Module::ResolveModuleCallback module_callback, v8::Module::ResolveSourceCallback source_callback)
static V8_WARN_UNUSED_RESULT MaybeHandle< Cell > ResolveExport(Isolate *isolate, Handle< SourceTextModule > module, DirectHandle< String > module_specifier, Handle< String > export_name, MessageLocation loc, bool must_resolve, ResolveSet *resolve_set)
static V8_WARN_UNUSED_RESULT bool FinishInstantiate(Isolate *isolate, Handle< SourceTextModule > module, ZoneForwardList< Handle< SourceTextModule > > *stack, unsigned *dfs_index, Zone *zone)
static void Reset(Isolate *isolate, DirectHandle< SourceTextModule > module)
static V8_WARN_UNUSED_RESULT bool PrepareInstantiate(Isolate *isolate, DirectHandle< SyntheticModule > module, v8::Local< v8::Context > context)
static V8_WARN_UNUSED_RESULT MaybeHandle< Cell > ResolveExport(Isolate *isolate, DirectHandle< SyntheticModule > module, DirectHandle< String > module_specifier, DirectHandle< String > export_name, MessageLocation loc, bool must_resolve)
static V8_WARN_UNUSED_RESULT bool FinishInstantiate(Isolate *isolate, DirectHandle< SyntheticModule > module)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< Object > Evaluate(Isolate *isolate, DirectHandle< SyntheticModule > module)
void push_back(const T &value)
LineAndColumn current
#define RETURN_FAILURE(isolate, should_throw, call)
Definition isolate.h:398
#define THROW_NEW_ERROR(isolate, call)
Definition isolate.h:307
#define STACK_CHECK(isolate, result_value)
Definition isolate.h:3067
#define MAYBE_RETURN(call, value)
Definition isolate.h:408
ZoneStack< RpoNumber > & stack
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
Definition handles-inl.h:72
PerThreadAssertScopeDebugOnly< false, SAFEPOINTS_ASSERT, HEAP_ALLOCATION_ASSERT > DisallowGarbageCollection
Tagged(T object) -> Tagged< T >
V8_INLINE DirectHandle< T > direct_handle(Tagged< T > object, Isolate *isolate)
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in name
Definition flags.cc:2086
void Print(Tagged< Object > obj)
Definition objects.h:774
bool IsModule(FunctionKind kind)
ShouldThrow GetShouldThrow(Isolate *isolate, Maybe< ShouldThrow > should_throw)
Definition objects.cc:140
V8_EXPORT_PRIVATE FlagValues v8_flags
return value
Definition map-inl.h:893
@ CLEAR_INOBJECT_PROPERTIES
Definition objects.h:61
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
Definition casting.h:150
Maybe< T > Nothing()
Definition v8-maybe.h:112
Maybe< T > Just(const T &t)
Definition v8-maybe.h:117
#define DCHECK_LE(v1, v2)
Definition logging.h:490
#define CHECK(condition)
Definition logging.h:124
#define DCHECK_IMPLIES(v1, v2)
Definition logging.h:493
#define DCHECK_NE(v1, v2)
Definition logging.h:486
#define DCHECK_GE(v1, v2)
Definition logging.h:488
#define DCHECK(condition)
Definition logging.h:482
#define DCHECK_EQ(v1, v2)
Definition logging.h:485
#define ZONE_NAME
Definition zone.h:22