Lines Matching defs:code

2 // Use of this source code is governed by a BSD-style license that can be
305 // Only Liftoff code that was generated for debugging can be inspected
340 // Decrement the ref count. Returns whether this code becomes dead and needs
354 // Decrement the ref count on code that is known to be in use (i.e. the ref
362 // Decrement the ref count on code that is known to be dead, even though there
364 // reference and the code needs to be freed.
370 // belonging to different {NativeModule}s. Dead code will be deleted.
376 // Returns whether this code was generated for debugging. If this returns
444 // Slow path for {DecRef}: The code becomes potentially dead.
445 // Returns whether this code becomes dead and needs to be freed.
482 // 1) The jump table / code table.
484 // 3) The set of potentially dead code in the {WasmEngine}.
485 // If a decrement of (1) would drop the ref count to 0, that code becomes a
487 // *before* decrementing the counter to ensure the code stays alive as long as
489 // from (3) and all (2)), the code object is deleted and the memory for the
490 // machine code is freed.
507 // Manages the code reservations and allocations of a single {NativeModule}.
517 // Use 1024 MB limit for code spaces on other platforms. This is smaller than
518 // the total allowed code space (kMaxWasmCodeMemory) to avoid unnecessarily
519 // big reservations, and to ensure that distances within a code space fit
540 // Allocate code space. Returns a valid buffer or fails with OOM (crash).
544 // Allocate code space within a specific region. Returns a valid buffer or
552 // When the last writer is removed, all code is switched back to
559 // Make a code region writable. Only allowed if there is at lease one writer
564 // Free memory pages of all given code objects. Used for wasm code GC.
568 // Retrieve the number of separately reserved code spaces.
589 // Code space that was allocated for code (subset of {owned_code_space_}).
605 // is used to protect code space. It is false if {MAP_JIT} on Mac or PKU is
629 // code below, i.e. it can be called concurrently from background threads.
630 // The returned code still needs to be published via {PublishCode}.
638 // {PublishCode} makes the code available to the system by entering it into
639 // the code table and patching the jump table. It returns a raw pointer to the
644 // ReinstallDebugCode does a subset of PublishCode: It installs the code in
645 // the code table and patches the jump table. The given code must be debug
646 // code (with breakpoints) and must be owned by this {NativeModule} already.
647 // This method is used to re-instantiate code that was removed from the code
671 // Adds anonymous code for testing purposes.
672 WasmCode* AddCodeForTesting(Handle<Code> code);
679 // Creates a snapshot of the current state of the code table. This is useful
682 // Creates a snapshot of all {owned_code_}, will transfer new code (if any) to
704 // Finds the jump tables that should be used for given code region. This
805 // Sample the current code size of this modules to the given counters.
840 // Retrieve the number of separately reserved code spaces for this module.
892 // Called by the {WasmCodeAllocator} to register a new code space.
898 // Transfer owned code from {new_owned_code_} to {owned_code_}.
901 // Add code to the code cache, if it meets criteria for being cached and we do
902 // not have code in the cache yet.
903 void InsertToCodeCache(WasmCode* code);
910 // access the engine (like the code allocator), so that it's destructor runs
914 // {WasmCodeAllocator} manages all code reservations and allocations for this
967 // Holds allocated code objects for fast lookup and deletion. For lookup based
972 // Holds owned code which is not inserted into {owned_code_} yet. It will be
974 // individual code objects.
977 // Table of the latest code object per function, updated on initial
983 // Data (especially jump table) per code space.
994 // Cache both baseline and top-tier code if we are debugging, to speed up
1030 // Estimate the needed code space for a Liftoff function based on the size of
1031 // the function body (wasm byte code).
1033 // Estimate the needed code space from a completely decoded module.
1037 // Estimate the needed code space from the number of functions and total code
1045 // generated code. This data still be stored on the C++ heap.
1048 // Set this thread's permission of all owned code space to read-write or
1093 // If the committed code space exceeds {critical_committed_code_space_}, then
1095 // currently committed space plus 50% of the available code space on creation
1113 // by e.g. creating new code or looking up code by its address are added to the
1135 explicit GlobalWasmCodeRef(WasmCode* code,
1137 : code_(code), native_module_(std::move(native_module)) {
1148 WasmCode* code() const { return code_; }