Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

OptimizeNanBoxedValue related operations#4506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jedel1043 merged 9 commits intoboa-dev:mainfromjedel1043:optimize-nan-boxed
Oct 29, 2025
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
optimize NanBoxedValue::clone
  • Loading branch information
@jedel1043
jedel1043 committedOct 27, 2025
commit82e02ed3b36c27b8e3f7c76698ad0b72a698dd23
34 changes: 21 additions & 13 deletionscore/engine/src/value/inner/nan_boxed.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -342,21 +342,29 @@ unsafe impl Trace for NanBoxedValue {
impl Clone for NanBoxedValue {
#[inline(always)]
fn clone(&self) -> Self {
if let Some(o) = self.as_object() {
Self::object(o.clone())
} else if let Some(s) = self.as_string() {
Self::string(s.clone())
} else if let Some(b) = self.as_bigint() {
Self::bigint(b.clone())
} else if let Some(s) = self.as_symbol() {
Self::symbol(s.clone())
} else {
Self {
#[cfg(target_pointer_width = "32")]
half: self.half,
ptr: self.ptr,
match self.value() & bits::MASK_KIND {
bits::MASK_OBJECT => unsafe {
mem::forget((*self.as_object_unchecked()).clone());
},
bits::MASK_STRING => unsafe {
mem::forget((*self.as_string_unchecked()).clone());
},
bits::MASK_SYMBOL => unsafe {
mem::forget((*self.as_symbol_unchecked()).clone());
},
bits::MASK_BIGINT => unsafe {
mem::forget((*self.as_bigint_unchecked()).clone());
},
_ => {
// Rest of the variants don't need additional handling.
}
}

Self {
#[cfg(target_pointer_width = "32")]
half: self.half,
ptr: self.ptr,
}
}
}

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp