mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
Store yield_continuation and yield_is_await directly in ExecutionContext instead of allocating a GeneratorResult GC cell. This removes a heap allocation per yield/await and fixes a latent bug where continuation addresses stored as doubles could lose precision.
31 lines
544 B
C++
31 lines
544 B
C++
/*
|
|
* Copyright (c) 2020-2024, Andreas Kling <andreas@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibGC/Cell.h>
|
|
#include <LibGC/CellAllocator.h>
|
|
#include <LibJS/Export.h>
|
|
#include <LibJS/Forward.h>
|
|
|
|
namespace JS {
|
|
|
|
class JS_API Cell : public GC::Cell {
|
|
GC_CELL(Cell, GC::Cell);
|
|
|
|
public:
|
|
MUST_UPCALL virtual void initialize(Realm&);
|
|
|
|
virtual bool is_environment() const { return false; }
|
|
|
|
ALWAYS_INLINE VM& vm() const;
|
|
|
|
template<typename T>
|
|
bool fast_is() const = delete;
|
|
};
|
|
|
|
}
|