refactor: 扁平化对象属性存储并优化常量池与 IC 热路径
This commit is contained in:
@@ -30,7 +30,7 @@ pub fn bind_number(kernel: &Arc<OxideKernel>, global: &mut JsObject) {
|
||||
let num_shape = kernel.shape_forge().make_shape(global.shape_id(), si_num);
|
||||
let num_val = JsValue::from_js_object(kernel.builtin_world().number_constructor.as_ptr() as *mut JsObject);
|
||||
global.set_shape_id(num_shape);
|
||||
global.ensure_hash_props().push(Box::new(num_val));
|
||||
global.ensure_hash_props().push(num_val);
|
||||
global.bump_generation();
|
||||
|
||||
{
|
||||
@@ -52,7 +52,7 @@ pub fn bind_number(kernel: &Arc<OxideKernel>, global: &mut JsObject) {
|
||||
("NEGATIVE_INFINITY", JsValue::float(f64::NEG_INFINITY)),
|
||||
("POSITIVE_INFINITY", JsValue::float(f64::INFINITY)),
|
||||
] {
|
||||
num_ctor.ensure_hash_props().push(Box::new(value));
|
||||
num_ctor.ensure_hash_props().push(value);
|
||||
let prop_si = kernel.string_forge().intern(name).0;
|
||||
let next_shape = kernel.shape_forge().make_shape(num_ctor.shape_id(), prop_si);
|
||||
num_ctor.set_shape_id(next_shape);
|
||||
|
||||
Reference in New Issue
Block a user