summaryrefslogtreecommitdiff
path: root/yjit/src/codegen.rs
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2023-10-10 13:12:17 +0200
committerJean Boussier <[email protected]>2023-10-10 14:47:54 +0200
commit5cc44f48c51974a84a40480477a4afd8901ae7e4 (patch)
tree9c252adf59e2e0b932a74a7d0cf000969039e97d /yjit/src/codegen.rs
parentfd21460898d2d5044c1bcc140927142921424791 (diff)
Refactor rb_shape_transition_shape_capa to not accept capacity
This way the groth factor is encapsulated, which allows rb_shape_transition_shape_capa to be smarter about ideal sizes.
Diffstat (limited to 'yjit/src/codegen.rs')
-rw-r--r--yjit/src/codegen.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index e4fa1a3665..5dff45ba8d 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -2403,7 +2403,6 @@ fn gen_setinstancevariable(
let shape = comptime_receiver.shape_of();
let current_capacity = unsafe { (*shape).capacity };
- let new_capacity = current_capacity * 2;
// If the object doesn't have the capacity to store the IV,
// then we'll need to allocate it.
@@ -2416,7 +2415,7 @@ fn gen_setinstancevariable(
// We need to add an extended table to the object
// First, create an outgoing transition that increases the
// capacity
- Some(unsafe { rb_shape_transition_shape_capa(shape, new_capacity) })
+ Some(unsafe { rb_shape_transition_shape_capa(shape) })
} else {
None
};
@@ -2429,7 +2428,7 @@ fn gen_setinstancevariable(
let new_shape_id = unsafe { rb_shape_id(dest_shape) };
let needs_extension = if needs_extension {
- Some((current_capacity, new_capacity))
+ Some((current_capacity, unsafe { (*dest_shape).capacity }))
} else {
None
};