Truly independent web browser
LibJS: Hold function indices and literal property slots in 16 bits
Andreas Kling5d4a0e8c0d5d
diff --git a/Libraries/LibJS/Flap/src/bytecode.rs b/Libraries/LibJS/Flap/src/bytecode.rsindex b88ea0464ac..fd720a35dda 100644--- a/Libraries/LibJS/Flap/src/bytecode.rs+++ b/Libraries/LibJS/Flap/src/bytecode.rs@@ -165,6 +165,7 @@ fn bytecode_field_type_matches(field: &crate::metadata::Field, parameter_type: &match field.ty.as_str() {"bool" => *parameter_type == Type::Bool || *parameter_type == Type::U8,"u8" => *parameter_type == Type::U8,+ "u16" => *parameter_type == Type::U16,"u32"| "EnvironmentShapeCacheIndex"| "IdentifierTableIndex"diff --git a/Libraries/LibJS/Flap/src/metadata.rs b/Libraries/LibJS/Flap/src/metadata.rsindex de4c9d7b9f5..aa118d17993 100644--- a/Libraries/LibJS/Flap/src/metadata.rs+++ b/Libraries/LibJS/Flap/src/metadata.rs@@ -672,6 +672,7 @@ fn try_field_type_info(ty: &str) -> Option<FieldType> {match ty {"bool" => ("bool", 1, "bool"),"u8" => ("u32", 1, "byte_count"),+ "u16" => ("u16", 2, "u16"),"i32" => ("i32", 4, "i32"),"u32" => ("u32", 4, "u32"),"u64" => ("u64", 8, "u64"),diff --git a/Libraries/LibJS/Flap/src/rust_bytecode.rs b/Libraries/LibJS/Flap/src/rust_bytecode.rsindex 5e463e9322d..5cc5f12a743 100644--- a/Libraries/LibJS/Flap/src/rust_bytecode.rs+++ b/Libraries/LibJS/Flap/src/rust_bytecode.rs@@ -97,6 +97,7 @@ pub fn read_expr_for_type(ty: &str, offset: &str, reader: &str) -> String {match ty {"bool" => format!("bytes[{offset}] != 0"),"u8" => format!("u32::from(bytes[{offset}])"),+ "u16" => format!("{reader}read_u16(bytes, {offset})"),"i32" => format!("{reader}read_u32(bytes, {offset}) as i32"),"u32" | "TemplateObjectCacheIndex" | "ObjectPropertyIteratorCacheIndex" | "EnvironmentShapeCacheIndex" => {format!("{reader}read_u32(bytes, {offset})")diff --git a/Libraries/LibJS/Flap/tests/interpreter-assembly/aarch64.S b/Libraries/LibJS/Flap/tests/interpreter-assembly/aarch64.Sindex aa1c3835d64..657a7b5acb8 100644--- a/Libraries/LibJS/Flap/tests/interpreter-assembly/aarch64.S+++ b/Libraries/LibJS/Flap/tests/interpreter-assembly/aarch64.S@@ -195,6 +195,7 @@ asm_dispatch_table:.quad asm_handler_SetCompletionType.quad asm_handler_GetTemplateObject.quad asm_handler_NewFunction+ .quad asm_handler_NewFunctionWide.quad asm_handler_Typeof.quad asm_handler_LeavePrivateEnvironment.quad asm_handler_ResolveThisBinding@@ -268,7 +269,6 @@ asm_dispatch_table:.quad asm_handler_fallback.quad asm_handler_fallback.quad asm_handler_fallback- .quad asm_handler_fallback.globl CSYM(js_interpreter_debug_dispatch_table)CSYM(js_interpreter_debug_dispatch_table):@@ -1261,6 +1261,10 @@ CSYM(js_interpreter_handler_ranges):.quad asm_handler_NewFunction_hot_end.quad asm_handler_NewFunction_cold.quad asm_handler_NewFunction_cold_end+ .quad asm_handler_NewFunctionWide+ .quad asm_handler_NewFunctionWide_hot_end+ .quad asm_handler_NewFunctionWide_cold+ .quad asm_handler_NewFunctionWide_cold_end.quad asm_handler_Typeof.quad asm_handler_Typeof_hot_end.quad asm_handler_Typeof_cold@@ -1553,10 +1557,6 @@ CSYM(js_interpreter_handler_ranges):.quad asm_handler_fallback_hot_end.quad asm_handler_fallback_cold.quad asm_handler_fallback_cold_end- .quad asm_handler_fallback- .quad asm_handler_fallback_hot_end- .quad asm_handler_fallback_cold- .quad asm_handler_fallback_cold_end.text@@ -18065,7 +18065,7 @@ asm_handler_NewFunction:mov x0, x20sub w1, w21, w26str w1, [x28, #64]- ldrb w9, [x21, #9]+ ldrb w9, [x21, #7]movz x10, #0x7ffb, lsl #48mov w11, #255cmp w9, w11@@ -18107,6 +18107,53 @@ asm_handler_NewFunction_hot_end:asm_handler_NewFunction_cold:asm_handler_NewFunction_cold_end:+.p2align 4+asm_handler_NewFunctionWide:+ mov x0, x20+ sub w1, w21, w26+ str w1, [x28, #64]+ ldrb w9, [x21, #9]+ movz x10, #0x7ffb, lsl #48+ mov w11, #255+ cmp w9, w11+ b.eq .Lasm_NewFunctionWide.scalar_value_ready_0+ ldr x10, [x27, x9, lsl #3]+.Lasm_NewFunctionWide.scalar_value_ready_0:+ mov x3, x10+ mov x0, x20+ sub w1, w21, w26+ mov x2, x21+ bl CSYM(asm_slow_path_new_function_wide)+ tbnz x0, #63, .Lasm_NewFunctionWide.scalar_result_done_1+ tbz x0, #32, .Lasm_NewFunctionWide.scalar_result_done_1+ ldrb w9, [x21, #1]+ str x1, [x27, x9, lsl #3]+ add x21, x26, w0, uxtw+ ldrb w9, [x21]+ ldr x10, [x19, x9, lsl #3]+ br x10+.Lasm_NewFunctionWide.scalar_result_done_1:+ tbz x0, #63, 1f+ b .Lexit+1:+ tbz x0, #32, .Lasm_NewFunctionWide.slow_path_transfer_2+ add x21, x26, w0, uxtw+ ldrb w9, [x21]+ ldr x10, [x19, x9, lsl #3]+ br x10+.Lasm_NewFunctionWide.slow_path_transfer_2:+ ldr x28, [x20]+ ldr x9, [x28, #88]+ ldr x26, [x9, #40]+ add x27, x28, #128+ add x21, x26, w0, uxtw+ ldrb w9, [x21]+ ldr x10, [x19, x9, lsl #3]+ br x10+asm_handler_NewFunctionWide_hot_end:+asm_handler_NewFunctionWide_cold:+asm_handler_NewFunctionWide_cold_end:+.p2align 4asm_handler_Typeof:mov x0, x20diff --git a/Libraries/LibJS/Flap/tests/interpreter-assembly/x86_64.S b/Libraries/LibJS/Flap/tests/interpreter-assembly/x86_64.Sindex 25070d5a757..30fbe4fbeac 100644--- a/Libraries/LibJS/Flap/tests/interpreter-assembly/x86_64.S+++ b/Libraries/LibJS/Flap/tests/interpreter-assembly/x86_64.S@@ -196,6 +196,7 @@ asm_dispatch_table:.quad asm_handler_SetCompletionType.quad asm_handler_GetTemplateObject.quad asm_handler_NewFunction+ .quad asm_handler_NewFunctionWide.quad asm_handler_Typeof.quad asm_handler_LeavePrivateEnvironment.quad asm_handler_ResolveThisBinding@@ -269,7 +270,6 @@ asm_dispatch_table:.quad asm_handler_fallback.quad asm_handler_fallback.quad asm_handler_fallback- .quad asm_handler_fallback.globl CSYM(js_interpreter_debug_dispatch_table)CSYM(js_interpreter_debug_dispatch_table):@@ -1262,6 +1262,10 @@ CSYM(js_interpreter_handler_ranges):.quad asm_handler_NewFunction_hot_end.quad asm_handler_NewFunction_cold.quad asm_handler_NewFunction_cold_end+ .quad asm_handler_NewFunctionWide+ .quad asm_handler_NewFunctionWide_hot_end+ .quad asm_handler_NewFunctionWide_cold+ .quad asm_handler_NewFunctionWide_cold_end.quad asm_handler_Typeof.quad asm_handler_Typeof_hot_end.quad asm_handler_Typeof_cold@@ -1554,10 +1558,6 @@ CSYM(js_interpreter_handler_ranges):.quad asm_handler_fallback_hot_end.quad asm_handler_fallback_cold.quad asm_handler_fallback_cold_end- .quad asm_handler_fallback- .quad asm_handler_fallback_hot_end- .quad asm_handler_fallback_cold- .quad asm_handler_fallback_cold_end.text@@ -17618,7 +17618,7 @@ asm_handler_GetTemplateObject_cold_end:asm_handler_NewFunction:mov DWORD PTR [rbx + -64], r13dlea r11, [r14 + r13]- movzx r10d, BYTE PTR [r11 + 9]+ movzx r10d, BYTE PTR [r11 + 7]movabs rax, 9221964661971222528cmp r10d, 255je .Lasm_NewFunction.scalar_value_ready_0@@ -17660,6 +17660,52 @@ asm_handler_NewFunction_hot_end:asm_handler_NewFunction_cold:asm_handler_NewFunction_cold_end:+.p2align 4+asm_handler_NewFunctionWide:+ mov DWORD PTR [rbx + -64], r13d+ lea r11, [r14 + r13]+ movzx r10d, BYTE PTR [r11 + 9]+ movabs rax, 9221964661971222528+ cmp r10d, 255+ je .Lasm_NewFunctionWide.scalar_value_ready_0+ mov rax, QWORD PTR [rbx + r10 * 8]+.Lasm_NewFunctionWide.scalar_value_ready_0:+ mov rcx, rax+ mov rdi, QWORD PTR [rbp - 48]+ mov esi, r13d+ lea rdx, [r14 + r13]+ call CSYM(asm_slow_path_new_function_wide)+ test rax, rax+ js .Lasm_NewFunctionWide.scalar_result_done_1+ bt rax, 32+ jnc .Lasm_NewFunctionWide.scalar_result_done_1+ lea rcx, [r14 + r13]+ movzx r10d, BYTE PTR [rcx + 1]+ mov QWORD PTR [rbx + r10 * 8], rdx+ mov r13d, eax+ movzx eax, BYTE PTR [r14 + r13]+ jmp [r12 + rax * 8]+.Lasm_NewFunctionWide.scalar_result_done_1:+ test rax, rax+ js .Lexit+ bt rax, 32+ jnc .Lasm_NewFunctionWide.slow_path_transfer_2+ mov r13d, eax+ movzx eax, BYTE PTR [r14 + r13]+ jmp [r12 + rax * 8]+.Lasm_NewFunctionWide.slow_path_transfer_2:+ mov rcx, QWORD PTR [rbp - 48]+ mov rbx, QWORD PTR [rcx]+ add rbx, 128+ mov rcx, QWORD PTR [rbx + -40]+ mov r14, QWORD PTR [rcx + 40]+ mov r13d, eax+ movzx eax, BYTE PTR [r14 + r13]+ jmp [r12 + rax * 8]+asm_handler_NewFunctionWide_hot_end:+asm_handler_NewFunctionWide_cold:+asm_handler_NewFunctionWide_cold_end:+.p2align 4asm_handler_Typeof:mov DWORD PTR [rbx + -64], r13ddiff --git a/Libraries/LibJS/Interpreter/interpreter.flap b/Libraries/LibJS/Interpreter/interpreter.flapindex 12880baa19d..e3c10530960 100644--- a/Libraries/LibJS/Interpreter/interpreter.flap+++ b/Libraries/LibJS/Interpreter/interpreter.flap@@ -4384,8 +4384,8 @@ handler InitObjectLiteralProperty(object: Operand,property: PropertyKeyTableIndex,src: Operand,- shape_cache_index: u32,- property_slot: u32+ shape_cache_index: ObjectShapeCacheIndex,+ property_slot: u16) @cold = call_slow_path(init_object_literal_property);handler NewArray(@@ -4567,11 +4567,19 @@ handler GetTemplateObject(handler NewFunction(dst: out Operand,- shared_function_data_index: u32,+ shared_function_data_index: u16,lhs_name: Optional<IdentifierTableIndex>,home_object: Optional<Operand>) @cold = call_slow_path(new_function);+# NB: A NewFunction for the functions of an executable past its first 65536, whose index takes four bytes.+handler NewFunctionWide(+ dst: out Operand,+ shared_function_data_index: u32,+ lhs_name: Optional<IdentifierTableIndex>,+ home_object: Optional<Operand>+) @cold = call_slow_path(new_function_wide);+handler Typeof(dst: out Operand,src: Operanddiff --git a/Libraries/LibJS/JIT/Rust/src/builder/arguments.rs b/Libraries/LibJS/JIT/Rust/src/builder/arguments.rsindex 723dca812b3..1ab66346307 100644--- a/Libraries/LibJS/JIT/Rust/src/builder/arguments.rs+++ b/Libraries/LibJS/JIT/Rust/src/builder/arguments.rs@@ -64,6 +64,7 @@ pub(super) fn may_write_parameter_bindings(opcode: OpCode) -> bool {matches!(opcode,O::NewFunction+ | O::NewFunctionWide| O::NewClass| O::InitializeVariableBinding| O::DynamicInitializeLexicalBindingdiff --git a/Libraries/LibJS/JIT/Rust/src/builder/handling.rs b/Libraries/LibJS/JIT/Rust/src/builder/handling.rsindex 5f7ea9d2989..17a7ee88961 100644--- a/Libraries/LibJS/JIT/Rust/src/builder/handling.rs+++ b/Libraries/LibJS/JIT/Rust/src/builder/handling.rs@@ -140,6 +140,7 @@ pub fn handling(opcode: OpCode) -> Handling {| O::NewArray| O::NewPrimitiveArray| O::NewFunction+ | O::NewFunctionWide| O::NewReferenceError| O::NewTypeError| O::CreateLexicalEnvironmentdiff --git a/Libraries/LibJS/JIT/Rust/src/builder/mod.rs b/Libraries/LibJS/JIT/Rust/src/builder/mod.rsindex d985197e805..5b4457212fb 100644--- a/Libraries/LibJS/JIT/Rust/src/builder/mod.rs+++ b/Libraries/LibJS/JIT/Rust/src/builder/mod.rs@@ -1596,7 +1596,7 @@ impl<'a> GraphBuilder<'a> {home_object,..} => {- if !self.try_build_new_function(dst, shared_function_data_index, home_object.is_some())? {+ if !self.try_build_new_function(dst, shared_function_data_index.into(), home_object.is_some())? {return Ok(None);}}@@ -1633,7 +1633,7 @@ impl<'a> GraphBuilder<'a> {property_slot,..} => {- if !self.try_build_init_object_literal_property(object, src, shape_cache_index, property_slot)? {+ if !self.try_build_init_object_literal_property(object, src, shape_cache_index, property_slot.into())? {return Ok(None);}}diff --git a/Libraries/LibJS/Rust/generate/instructions.rs b/Libraries/LibJS/Rust/generate/instructions.rsindex 05e20128760..e7572c5d1e1 100644--- a/Libraries/LibJS/Rust/generate/instructions.rs+++ b/Libraries/LibJS/Rust/generate/instructions.rs@@ -463,11 +463,18 @@ fn generate_instruction_dump_from_bytes(w," dumper.append_piece(|dumper| dumper.append_put_kind(\"{label}\", {rname}));")?,- "ArithFeedbackIndex" | "ValueFeedbackIndex" | "CallFeedbackIndex" | "KeyedFeedbackIndex" => writeln!(+ "ArithFeedbackIndex"+ | "ValueFeedbackIndex"+ | "CallFeedbackIndex"+ | "KeyedFeedbackIndex"+ | "PropertyLookupCacheIndex"+ | "GlobalVariableCacheIndex"+ | "EnvironmentCoordinateCacheIndex"+ | "ObjectShapeCacheIndex" => writeln!(w," dumper.append_piece(|dumper| dumper.append_number(\"{label}\", {rname}));")?,- _ if (ty == "i32" || ty == "u32" || ty == "u64" || ty == "u8")+ _ if (ty == "i32" || ty == "u32" || ty == "u64" || ty == "u8" || ty == "u16")&& !count_fields.contains(f.name.as_str()) =>{writeln!(diff --git a/Libraries/LibJS/Rust/src/bytecode/codegen/scope.rs b/Libraries/LibJS/Rust/src/bytecode/codegen/scope.rsindex 5472e11d598..3c09acd0e82 100644--- a/Libraries/LibJS/Rust/src/bytecode/codegen/scope.rs+++ b/Libraries/LibJS/Rust/src/bytecode/codegen/scope.rs@@ -1512,27 +1512,12 @@ impl Generator<'_> {let index = self.register_nested_function(row, NestedFunctionName::None);self.in_head(|generator| {if ident.local_type == Some(LocalType::Variable) {- generator.put(op::NewFunction {- dst: Operand::local(ident.local_index),- shared_function_data_index: index,- home_object: None,- lhs_name: None,- });+ generator.put_new_function(Operand::local(ident.local_index), index);} else if ident.local_type == Some(LocalType::Argument) {- generator.put(op::NewFunction {- dst: Operand::argument(ident.local_index),- shared_function_data_index: index,- home_object: None,- lhs_name: None,- });+ generator.put_new_function(Operand::argument(ident.local_index), index);} else {let function = generator.temporary();- generator.put(op::NewFunction {- dst: function,- shared_function_data_index: index,- home_object: None,- lhs_name: None,- });+ generator.put_new_function(function, index);let identifier = generator.intern_identifier(name);emit_set_variable_binding(generator, identifier, function);}@@ -1652,12 +1637,7 @@ impl Generator<'_> {is_strict: false,});let shared_function_data_index = self.register_nested_function(row, NestedFunctionName::None);- self.put(op::NewFunction {- dst,- shared_function_data_index,- lhs_name: None,- home_object: None,- });+ self.put_new_function(dst, shared_function_data_index);emit_initialize_lexical_binding(self, identifier, dst);self.leave_scope_environment(ScopeEnvironment {register,@@ -1707,21 +1687,11 @@ impl Generator<'_> {let ident = self.identifier_of_binding(binding);let index = self.register_nested_function(row, NestedFunctionName::None);if ident.is_local() {- self.put(op::NewFunction {- dst: Operand::local(ident.local_index),- shared_function_data_index: index,- lhs_name: None,- home_object: None,- });+ self.put_new_function(Operand::local(ident.local_index), index);self.mark_local_initialized(ident.local_index);} else {let dst = self.temporary();- self.put(op::NewFunction {- dst,- shared_function_data_index: index,- lhs_name: None,- home_object: None,- });+ self.put_new_function(dst, index);let identifier = self.intern_identifier(name);if is_first_of_name {emit_initialize_lexical_binding(self, identifier, dst);diff --git a/Libraries/LibJS/Rust/src/bytecode/codegen/stream.rs b/Libraries/LibJS/Rust/src/bytecode/codegen/stream.rsindex 0e036708000..498f58916e6 100644--- a/Libraries/LibJS/Rust/src/bytecode/codegen/stream.rs+++ b/Libraries/LibJS/Rust/src/bytecode/codegen/stream.rs@@ -3522,7 +3522,10 @@ impl Generator<'_> {let object = self.context.stream.values.last_mut().expect("an object is being built");let (dst, cache, slot) = (object.a, object.cache, object.name);object.name += 1;- if cache != u32::MAX {+ // NB: The properties of a literal past the first 65536 are put like those of a literal that is not simple.+ if let Ok(slot) = u16::try_from(slot)+ && cache != u32::MAX+ {self.put(op::InitObjectLiteralProperty {object: dst,property: key,@@ -3688,18 +3691,49 @@ impl Generator<'_> {) {let first_temporary = self.next_temporary();let dst = self.temporary();- self.put_with_destination(- op::NewFunction {+ if let Ok(index) = u16::try_from(shared_function_data_index) {+ self.put_with_destination(+ op::NewFunction {+ dst,+ shared_function_data_index: index,+ lhs_name,+ home_object,+ },dst,- shared_function_data_index,- lhs_name,- home_object,- },- dst,- );+ );+ } else {+ self.put_with_destination(+ op::NewFunctionWide {+ dst,+ shared_function_data_index,+ lhs_name,+ home_object,+ },+ dst,+ );+ }self.push_value(dst, first_temporary);}+ /// A function object for the function at index `shared_function_data_index`, in `dst`.+ pub(super) fn put_new_function(&mut self, dst: Operand, shared_function_data_index: u32) {+ if let Ok(index) = u16::try_from(shared_function_data_index) {+ self.put(op::NewFunction {+ dst,+ shared_function_data_index: index,+ lhs_name: None,+ home_object: None,+ });+ } else {+ self.put(op::NewFunctionWide {+ dst,+ shared_function_data_index,+ lhs_name: None,+ home_object: None,+ });+ }+ }+// --- Statements ---/// Whether the value of an expression statement is what the code completes with, should it be the last one.diff --git a/Libraries/LibJS/Rust/src/interpreter/slow_paths/calls.rs b/Libraries/LibJS/Rust/src/interpreter/slow_paths/calls.rsindex b1689f74511..f5a8792cd5a 100644--- a/Libraries/LibJS/Rust/src/interpreter/slow_paths/calls.rs+++ b/Libraries/LibJS/Rust/src/interpreter/slow_paths/calls.rs@@ -960,9 +960,25 @@ pub fn new_function(instruction: &op::NewFunction,values: &mut op::NewFunctionValues,) -> SlowPathControl {- let shared_data = vm- .current_executable()- .shared_function_data(instruction.shared_function_data_index);+ let home_object = instruction.home_object.get().map(|_| values.home_object);+ values.dst = new_function_object(vm, instruction.shared_function_data_index.into(), home_object);+ SlowPathControl::continue_at(pc + op::NewFunction::LENGTH)+}++pub fn new_function_wide(+ vm: &Vm,+ pc: u32,+ instruction: &op::NewFunctionWide,+ values: &mut op::NewFunctionWideValues,+) -> SlowPathControl {+ let home_object = instruction.home_object.get().map(|_| values.home_object);+ values.dst = new_function_object(vm, instruction.shared_function_data_index, home_object);+ SlowPathControl::continue_at(pc + op::NewFunctionWide::LENGTH)+}++/// The function object of a NewFunction, for the function at `shared_function_data_index` of the running executable.+fn new_function_object(vm: &Vm, shared_function_data_index: u32, home_object: Option<Value>) -> Value {+ let shared_data = vm.current_executable().shared_function_data(shared_function_data_index);let realm = vm.current_realm().expect("there is a current realm");let prototype = match shared_data.kind() {@@ -972,14 +988,14 @@ pub fn new_function(FunctionKind::AsyncGenerator => realm.async_generator_function_prototype(),};- let function = if instruction.home_object.get().is_some() {+ let function = if let Some(home_object) = home_object {EcmascriptFunctionObject::create_method(vm,realm,shared_data,vm.lexical_environment(),running_execution_context(vm).private_environment.get(),- values.home_object.as_object(),+ home_object.as_object(),prototype,)} else {@@ -993,8 +1009,7 @@ pub fn new_function()};- values.dst = Value::from_object(function);- SlowPathControl::continue_at(pc + op::NewFunction::LENGTH)+ Value::from_object(function)}/// Handles an exception a raw native function the interpreter called threw.diff --git a/Libraries/LibJS/Rust/src/interpreter/slow_paths/mod.rs b/Libraries/LibJS/Rust/src/interpreter/slow_paths/mod.rsindex fc3e713fcb4..3a9f6819278 100644--- a/Libraries/LibJS/Rust/src/interpreter/slow_paths/mod.rs+++ b/Libraries/LibJS/Rust/src/interpreter/slow_paths/mod.rs@@ -1409,6 +1409,15 @@ impl RuntimeFunctions for Runtime {calls::new_function(vm, pc, instruction, values)}+ fn new_function_wide(+ vm: &Vm,+ pc: u32,+ instruction: &op::NewFunctionWide,+ values: &mut op::NewFunctionWideValues,+ ) -> SlowPathControl {+ calls::new_function_wide(vm, pc, instruction, values)+ }+fn helper_handle_raw_native_exception(vm: u64, encoded_exception: u64) -> u64 {let vm = vm_from_helper_argument(vm);calls::handle_raw_native_exception(vm, Value::from_bits(encoded_exception)).0 as u64diff --git a/Libraries/LibJS/Rust/src/interpreter/slow_paths/property_access.rs b/Libraries/LibJS/Rust/src/interpreter/slow_paths/property_access.rsindex 6359cbe53d4..069ce136c0d 100644--- a/Libraries/LibJS/Rust/src/interpreter/slow_paths/property_access.rs+++ b/Libraries/LibJS/Rust/src/interpreter/slow_paths/property_access.rs@@ -785,7 +785,7 @@ pub fn init_object_literal_property(let object = values.object.as_object();let value = values.src;let executable = vm.current_executable();- let cache = executable.object_shape_cache(instruction.shape_cache_index);+ let cache = executable.object_shape_cache(instruction.shape_cache_index.into());let property_slot = instruction.property_slot as usize;let cached_shape = cache.shape.get();diff --git a/Tests/LibJS/Bytecode/expected/annex-b-function-in-if.txt b/Tests/LibJS/Bytecode/expected/annex-b-function-in-if.txtindex fda04c0988c..a0e26469d7b 100644--- a/Tests/LibJS/Bytecode/expected/annex-b-function-in-if.txt+++ b/Tests/LibJS/Bytecode/expected/annex-b-function-in-if.txt@@ -22,7 +22,7 @@ block0:[ 64] End value:reg5-annexBFunctionInIf$a36298ad annex-b-function-in-if.js:2:10+annexBFunctionInIf$62b19c69 annex-b-function-in-if.js:2:10Registers: 6Blocks: 4Locals: inner~0, inner~1, inner~2@@ -36,16 +36,16 @@ block0:block1:[ a] NewFunction dst:inner~1, shared_function_data_index:0- [ 14] Mov dst:inner~0, src:inner~1- [ 17] Jump target:block3+ [ 12] Mov dst:inner~0, src:inner~1+ [ 15] Jump target:block3block2:- [ 1c] NewFunction dst:inner~2, shared_function_data_index:1- [ 26] Mov dst:inner~0, src:inner~2+ [ 1a] NewFunction dst:inner~2, shared_function_data_index:1+ [ 22] Mov dst:inner~0, src:inner~2block3:- [ 29] Call value_feedback:0, call_feedback:0, dst:reg5, callee:inner~0, this_value:Undefined- [ 32] Return value:reg5+ [ 25] Call value_feedback:0, call_feedback:0, dst:reg5, callee:inner~0, this_value:Undefined+ [ 2e] Return value:reg5inner$e42ab1c1 annex-b-function-in-if.js:4:13diff --git a/Tests/LibJS/Bytecode/expected/annexb-function-existing-var.txt b/Tests/LibJS/Bytecode/expected/annexb-function-existing-var.txtindex 775d247a61d..9d0d2d275aa 100644--- a/Tests/LibJS/Bytecode/expected/annexb-function-existing-var.txt+++ b/Tests/LibJS/Bytecode/expected/annexb-function-existing-var.txt@@ -12,7 +12,7 @@ block0:[ 16] End value:reg5-test$e8f3bec6 annexb-function-existing-var.js:2:9+test$489b40a4 annexb-function-existing-var.js:2:9Registers: 5Blocks: 1Locals: f~0, f~1@@ -25,5 +25,5 @@ block0:[ 1] Mov dst:f~0, src:Undefined[ 4] Mov dst:f~0, src:Int32(123)[ 7] NewFunction dst:f~1, shared_function_data_index:0- [ 11] Mov dst:f~0, src:f~1- [ 14] Return value:f~0+ [ f] Mov dst:f~0, src:f~1+ [ 12] Return value:f~0diff --git a/Tests/LibJS/Bytecode/expected/annexb-var-coordinate-with-default-param.txt b/Tests/LibJS/Bytecode/expected/annexb-var-coordinate-with-default-param.txtindex 72a25aed330..fa88e80e5dd 100644--- a/Tests/LibJS/Bytecode/expected/annexb-var-coordinate-with-default-param.txt+++ b/Tests/LibJS/Bytecode/expected/annexb-var-coordinate-with-default-param.txt@@ -12,7 +12,7 @@ block0:[ 16] End value:reg5-f$ceb84148 annexb-var-coordinate-with-default-param.js:3:12+f$afc1bbae annexb-var-coordinate-with-default-param.js:3:12Registers: 7Blocks: 3Locals: g~0, g~1@@ -38,9 +38,9 @@ block2:[ 2f] CreateVariable `y`, is_immutable:false, is_global:false, is_strict:false[ 37] InitializeLexicalBinding `y`, src:Int32(2)[ 44] NewFunction dst:g~1, shared_function_data_index:0- [ 4e] Mov dst:g~0, src:g~1- [ 51] Call value_feedback:0, call_feedback:0, dst:reg6, callee:g~0, this_value:Undefined- [ 5a] Return value:reg6+ [ 4c] Mov dst:g~0, src:g~1+ [ 4f] Call value_feedback:0, call_feedback:0, dst:reg6, callee:g~0, this_value:Undefined+ [ 58] Return value:reg6g$66f9ea5f annexb-var-coordinate-with-default-param.js:7:13diff --git a/Tests/LibJS/Bytecode/expected/arguments-with-arguments-fn.txt b/Tests/LibJS/Bytecode/expected/arguments-with-arguments-fn.txtindex c6cf2ab7fab..6073d491c40 100644--- a/Tests/LibJS/Bytecode/expected/arguments-with-arguments-fn.txt+++ b/Tests/LibJS/Bytecode/expected/arguments-with-arguments-fn.txt@@ -12,7 +12,7 @@ block0:[ 16] End value:reg5-f$baed9c7b arguments-with-arguments-fn.js:1:12+f$5b461a9d arguments-with-arguments-fn.js:1:12Registers: 5Blocks: 3Locals: arguments~0@@ -30,4 +30,4 @@ block1:block2:[ e] Mov dst:arguments~0, src:Undefined[ 11] NewFunction dst:arguments~0, shared_function_data_index:0- [ 1b] End value:Undefined+ [ 19] End value:Undefineddiff --git a/Tests/LibJS/Bytecode/expected/assign-to-let-variable-tdz.txt b/Tests/LibJS/Bytecode/expected/assign-to-let-variable-tdz.txtindex 034d5418102..a79df3856ad 100644--- a/Tests/LibJS/Bytecode/expected/assign-to-let-variable-tdz.txt+++ b/Tests/LibJS/Bytecode/expected/assign-to-let-variable-tdz.txt@@ -1,4 +1,4 @@-$88686767 assign-to-let-variable-tdz.js:12:1+$47b76b23 assign-to-let-variable-tdz.js:12:1Registers: 8Blocks: 1Constants:@@ -11,9 +11,9 @@ block0:[ 4] GetGlobal value_feedback:0, dst:reg6, `f`[ d] NewObject dst:reg7[ 11] InitObjectLiteralProperty object:reg7, `location`, src:String("hello"), shape_cache_index:0, property_slot:0- [ 1f] CacheObjectShape object:reg7- [ 23] Call value_feedback:1, call_feedback:0, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7]- [ 2d] End value:reg5+ [ 1b] CacheObjectShape object:reg7+ [ 1f] Call value_feedback:1, call_feedback:0, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7]+ [ 29] End value:reg5f$4d812643 assign-to-let-variable-tdz.js:7:5diff --git a/Tests/LibJS/Bytecode/expected/block-function-declaration-order.txt b/Tests/LibJS/Bytecode/expected/block-function-declaration-order.txtindex 4ad0ab4bfb1..86434c4260f 100644--- a/Tests/LibJS/Bytecode/expected/block-function-declaration-order.txt+++ b/Tests/LibJS/Bytecode/expected/block-function-declaration-order.txt@@ -1,4 +1,4 @@-$b24a3009 block-function-declaration-order.js:1:1+$f2fb2c4d block-function-declaration-order.js:1:1Registers: 6Blocks: 1Locals: f1~0, f2~1@@ -9,7 +9,7 @@ block0:[ 0] Enter[ 1] Mov dst:reg5, src:Undefined[ 4] NewFunction dst:f1~0, shared_function_data_index:0- [ e] NewFunction dst:f2~1, shared_function_data_index:1- [ 18] SetVariableBindingOfBlockFunction `f1`, src:f1~0, program_environment_depth:0- [ 21] SetVariableBindingOfBlockFunction `f2`, src:f2~1, program_environment_depth:0- [ 2a] End value:reg5+ [ c] NewFunction dst:f2~1, shared_function_data_index:1+ [ 14] SetVariableBindingOfBlockFunction `f1`, src:f1~0, program_environment_depth:0+ [ 1d] SetVariableBindingOfBlockFunction `f2`, src:f2~1, program_environment_depth:0+ [ 26] End value:reg5diff --git a/Tests/LibJS/Bytecode/expected/block-scoped-function-no-tdz.txt b/Tests/LibJS/Bytecode/expected/block-scoped-function-no-tdz.txtindex 61aa7834c76..ee76e7b5263 100644--- a/Tests/LibJS/Bytecode/expected/block-scoped-function-no-tdz.txt+++ b/Tests/LibJS/Bytecode/expected/block-scoped-function-no-tdz.txt@@ -14,7 +14,7 @@ block0:[ 19] End value:reg5-test$20564be8 block-scoped-function-no-tdz.js:3:9+test$7ffdcdc6 block-scoped-function-no-tdz.js:3:9Registers: 6Blocks: 1Locals: result~0, foo~1@@ -25,8 +25,8 @@ block0:[ 0] Enter[ 1] Mov dst:result~0, src:Undefined[ 4] NewFunction dst:foo~1, shared_function_data_index:0- [ e] Call value_feedback:0, call_feedback:0, dst:result~0, callee:foo~1, this_value:Undefined- [ 17] Return value:result~0+ [ c] Call value_feedback:0, call_feedback:0, dst:result~0, callee:foo~1, this_value:Undefined+ [ 15] Return value:result~0foo$665150bf block-scoped-function-no-tdz.js:5:26diff --git a/Tests/LibJS/Bytecode/expected/block-scoping.txt b/Tests/LibJS/Bytecode/expected/block-scoping.txtindex 4b2479d6084..8e83e578ba4 100644--- a/Tests/LibJS/Bytecode/expected/block-scoping.txt+++ b/Tests/LibJS/Bytecode/expected/block-scoping.txt@@ -20,7 +20,7 @@ block0:[ 62] End value:reg5-closureOverBlockScope$2f8ececa block-scoping.js:2:15+closureOverBlockScope$703fcb0e block-scoping.js:2:15Registers: 8Blocks: 1Locals: fns~0@@ -38,21 +38,21 @@ block0:[ 1a] InitializeLexicalBinding `x`, src:Int32(1)[ 27] GetById value_feedback:0, dst:reg6, base:fns~0, `push`[ 31] NewFunction dst:reg7, shared_function_data_index:0- [ 3b] Call value_feedback:1, call_feedback:0, dst:reg6, callee:reg6, this_value:fns~0, arguments:[reg7]- [ 45] SetLexicalEnvironment environment:reg4- [ 47] CreateLexicalEnvironment dst:reg5, parent:reg4, capacity:1, is_catch_environment:false- [ 53] CreateVariable `y`, is_immutable:false, is_global:false, is_strict:false- [ 5b] InitializeLexicalBinding `y`, src:Int32(2)- [ 68] GetById value_feedback:2, dst:reg6, base:fns~0, `push`- [ 72] NewFunction dst:reg7, shared_function_data_index:1- [ 7c] Call value_feedback:3, call_feedback:1, dst:reg6, callee:reg6, this_value:fns~0, arguments:[reg7]- [ 86] SetLexicalEnvironment environment:reg4- [ 88] GetByValue value_feedback:4, keyed_feedback:0, dst:reg5, base:fns~0, property:Int32(0)- [ 92] Call value_feedback:5, call_feedback:2, dst:reg5, callee:reg5, this_value:fns~0- [ 9b] GetByValue value_feedback:6, keyed_feedback:1, dst:reg6, base:fns~0, property:Int32(1)- [ a5] Call value_feedback:7, call_feedback:3, dst:reg6, callee:reg6, this_value:fns~0- [ ae] Add arith_feedback:0, dst:reg5, lhs:reg5, rhs:reg6- [ b4] Return value:reg5+ [ 39] Call value_feedback:1, call_feedback:0, dst:reg6, callee:reg6, this_value:fns~0, arguments:[reg7]+ [ 43] SetLexicalEnvironment environment:reg4+ [ 45] CreateLexicalEnvironment dst:reg5, parent:reg4, capacity:1, is_catch_environment:false+ [ 51] CreateVariable `y`, is_immutable:false, is_global:false, is_strict:false+ [ 59] InitializeLexicalBinding `y`, src:Int32(2)+ [ 66] GetById value_feedback:2, dst:reg6, base:fns~0, `push`+ [ 70] NewFunction dst:reg7, shared_function_data_index:1+ [ 78] Call value_feedback:3, call_feedback:1, dst:reg6, callee:reg6, this_value:fns~0, arguments:[reg7]+ [ 82] SetLexicalEnvironment environment:reg4+ [ 84] GetByValue value_feedback:4, keyed_feedback:0, dst:reg5, base:fns~0, property:Int32(0)+ [ 8e] Call value_feedback:5, call_feedback:2, dst:reg5, callee:reg5, this_value:fns~0+ [ 97] GetByValue value_feedback:6, keyed_feedback:1, dst:reg6, base:fns~0, property:Int32(1)+ [ a1] Call value_feedback:7, call_feedback:3, dst:reg6, callee:reg6, this_value:fns~0+ [ aa] Add arith_feedback:0, dst:reg5, lhs:reg5, rhs:reg6+ [ b0] Return value:reg5$ae3a72e0 block-scoping.js:5:18@@ -75,7 +75,7 @@ block0:[ 10] Return value:reg5-breakThroughBlockScopes$72581873 block-scoping.js:16:9+breakThroughBlockScopes$d1ff9a51 block-scoping.js:16:9Registers: 7Blocks: 6Locals: result~0, i~1, f~2@@ -95,24 +95,24 @@ block1:[ 1a] CreateVariable `x`, is_immutable:false, is_global:false, is_strict:false[ 22] InitializeLexicalBinding `x`, src:i~1[ 2f] NewFunction dst:f~2, shared_function_data_index:0 (f)- [ 39] GetBinding value_feedback:0, dst:reg6, `x`- [ 48] JumpGreaterThanRhsInt32 arith_feedback:0, lhs:reg6, rhs:1, true_target:block2, false_target:block3+ [ 37] GetBinding value_feedback:0, dst:reg6, `x`+ [ 46] JumpGreaterThanRhsInt32 arith_feedback:0, lhs:reg6, rhs:1, true_target:block2, false_target:block3block2:- [ 58] Mov dst:result~0, src:f~2- [ 5b] SetLexicalEnvironment environment:reg4- [ 5d] Jump target:block5+ [ 56] Mov dst:result~0, src:f~2+ [ 59] SetLexicalEnvironment environment:reg4+ [ 5b] Jump target:block5block3:- [ 62] SetLexicalEnvironment environment:reg4- [ 64] Increment arith_feedback:1, dst:i~1+ [ 60] SetLexicalEnvironment environment:reg4+ [ 62] Increment arith_feedback:1, dst:i~1block4:- [ 68] JumpLessThanLoopRhsInt32 arith_feedback:2, lhs:i~1, rhs:3, true_target:block1, false_target:block5+ [ 66] JumpLessThanLoopRhsInt32 arith_feedback:2, lhs:i~1, rhs:3, true_target:block1, false_target:block5block5:- [ 78] Call value_feedback:1, call_feedback:0, dst:reg5, callee:result~0, this_value:Undefined- [ 81] Return value:reg5+ [ 76] Call value_feedback:1, call_feedback:0, dst:reg5, callee:result~0, this_value:Undefined+ [ 7f] Return value:reg5f$44bfa1d8 block-scoping.js:20:21diff --git a/Tests/LibJS/Bytecode/expected/captured-variables.txt b/Tests/LibJS/Bytecode/expected/captured-variables.txtindex f9c48b7518d..77715a0d465 100644--- a/Tests/LibJS/Bytecode/expected/captured-variables.txt+++ b/Tests/LibJS/Bytecode/expected/captured-variables.txt@@ -12,7 +12,7 @@ block0:[ 16] End value:reg5-outer$079e951e captured-variables.js:5:9+outer$674616fc captured-variables.js:5:9Registers: 6Blocks: 1Locals: inner~0@@ -25,9 +25,9 @@ block0:[ 1] CreateVariable `captured`, is_immutable:false, is_global:false, is_strict:false[ 9] Mov dst:inner~0, src:Undefined[ c] NewFunction dst:inner~0, shared_function_data_index:0- [ 16] InitializeLexicalBinding `captured`, src:Int32(1)- [ 23] Call value_feedback:0, call_feedback:0, dst:reg5, callee:inner~0, this_value:Undefined- [ 2c] Return value:reg5+ [ 14] InitializeLexicalBinding `captured`, src:Int32(1)+ [ 21] Call value_feedback:0, call_feedback:0, dst:reg5, callee:inner~0, this_value:Undefined+ [ 2a] Return value:reg5inner$878e6817 captured-variables.js:7:9diff --git a/Tests/LibJS/Bytecode/expected/class-computed-field-lhs-name.txt b/Tests/LibJS/Bytecode/expected/class-computed-field-lhs-name.txtindex 2e8c2295d49..103f268d069 100644--- a/Tests/LibJS/Bytecode/expected/class-computed-field-lhs-name.txt+++ b/Tests/LibJS/Bytecode/expected/class-computed-field-lhs-name.txt@@ -29,7 +29,7 @@ block0:[ 1] End value:Undefined-field$945111f9 class-computed-field-lhs-name.js:2:15+field$34a9901b class-computed-field-lhs-name.js:2:15Registers: 7Blocks: 1@@ -37,5 +37,5 @@ block0:[ 0] Enter[ 1] GetClassFieldInitializerName dst:reg5[ 3] NewFunction dst:reg6, shared_function_data_index:0- [ d] SetFunctionName function:reg6, name:reg5- [ 11] Return value:reg6+ [ b] SetFunctionName function:reg6, name:reg5+ [ f] Return value:reg6diff --git a/Tests/LibJS/Bytecode/expected/computed-member-compound-assign.txt b/Tests/LibJS/Bytecode/expected/computed-member-compound-assign.txtindex bb8b62b477e..47274a9c070 100644--- a/Tests/LibJS/Bytecode/expected/computed-member-compound-assign.txt+++ b/Tests/LibJS/Bytecode/expected/computed-member-compound-assign.txt@@ -1,4 +1,4 @@-$eb09be83 computed-member-compound-assign.js:15:1+$ad1cb34f computed-member-compound-assign.js:15:1Registers: 8Blocks: 1Constants:@@ -15,9 +15,9 @@ block0:[ 1c] GetGlobal value_feedback:2, dst:reg6, `compound_then_assign`[ 25] NewObject dst:reg7[ 29] InitObjectLiteralProperty object:reg7, `x`, src:Int32(1), shape_cache_index:0, property_slot:0- [ 37] CacheObjectShape object:reg7- [ 3b] Call value_feedback:3, call_feedback:1, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7, String("x")]- [ 46] End value:reg5+ [ 33] CacheObjectShape object:reg7+ [ 37] Call value_feedback:3, call_feedback:1, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7, String("x")]+ [ 42] End value:reg5compound_computed$48b6b4c7 computed-member-compound-assign.js:7:14diff --git a/Tests/LibJS/Bytecode/expected/destructuring-assignment.txt b/Tests/LibJS/Bytecode/expected/destructuring-assignment.txtindex e0995d6b929..d7c8218879d 100644--- a/Tests/LibJS/Bytecode/expected/destructuring-assignment.txt+++ b/Tests/LibJS/Bytecode/expected/destructuring-assignment.txt@@ -77,7 +77,7 @@ Exception handlers:[ 1c .. 5a] => handler block8-object_destructuring_with_function_default$cc5229c8 destructuring-assignment.js:11:9+object_destructuring_with_function_default$2ebd9cb6 destructuring-assignment.js:11:9Registers: 9Blocks: 3Locals: x~0@@ -97,11 +97,11 @@ block1:[ 21] NewFunction dst:reg7, shared_function_data_index:0 (x)block2:- [ 2b] Mov dst:x~0, src:reg7- [ 2e] Return value:x~0+ [ 29] Mov dst:x~0, src:reg7+ [ 2c] Return value:x~0-setter_parameter_resolution$6f5c4524 destructuring-assignment.js:17:9+setter_parameter_resolution$0fb4c346 destructuring-assignment.js:17:9Registers: 13Blocks: 12Constants:@@ -119,44 +119,44 @@ block0:block1:[ 30] NewObject dst:reg11[ 34] NewFunction dst:reg12, shared_function_data_index:0 (set y), home_object:reg11- [ 3e] PutById base:reg11, `y`, src:reg12, kind:Setter+ [ 3c] PutById base:reg11, `y`, src:reg12, kind:Setterblock2:- [ 47] IteratorNextUnpack dst_value:reg12, dst_done:reg7, iterator_object:reg8, iterator_next:reg9, iterator_done:reg10+ [ 45] IteratorNextUnpack dst_value:reg12, dst_done:reg7, iterator_object:reg8, iterator_next:reg9, iterator_done:reg10block3:- [ 4d] JumpFalse condition:reg7, target:block5+ [ 4b] JumpFalse condition:reg7, target:block5block4:- [ 53] Mov dst:reg12, src:Undefined+ [ 51] Mov dst:reg12, src:Undefinedblock5:- [ 56] PutById base:reg11, `y`, src:reg12, kind:Normal+ [ 54] PutById base:reg11, `y`, src:reg12, kind:Normalblock6:- [ 5f] JumpTrue condition:reg10, target:block11+ [ 5d] JumpTrue condition:reg10, target:block11block7:- [ 65] IteratorClose iterator_object:reg8, iterator_next:reg9, iterator_done:reg10, completion_value:Undefined- [ 6d] Jump target:block11+ [ 63] IteratorClose iterator_object:reg8, iterator_next:reg9, iterator_done:reg10, completion_value:Undefined+ [ 6b] Jump target:block11block8:- [ 72] Catch value_feedback:0, dst:reg11- [ 76] JumpTrue condition:reg10, target:block10+ [ 70] Catch value_feedback:0, dst:reg11+ [ 74] JumpTrue condition:reg10, target:block10block9:- [ 7c] IteratorClose iterator_object:reg8, iterator_next:reg9, iterator_done:reg10, completion_value:reg11+ [ 7a] IteratorClose iterator_object:reg8, iterator_next:reg9, iterator_done:reg10, completion_value:reg11block10:- [ 84] Throw src:reg11+ [ 82] Throw src:reg11block11:- [ 86] GetInitializedBinding value_feedback:1, dst:reg5, `setValue`- [ 95] Return value:reg5+ [ 84] GetInitializedBinding value_feedback:1, dst:reg5, `setValue`+ [ 93] Return value:reg5Exception handlers:- [ 30 .. 47] => handler block8- [ 4d .. 5f] => handler block8+ [ 30 .. 45] => handler block8+ [ 4b .. 5d] => handler block8set y$755940b9 destructuring-assignment.js:21:26diff --git a/Tests/LibJS/Bytecode/expected/destructuring-param-no-param-expressions.txt b/Tests/LibJS/Bytecode/expected/destructuring-param-no-param-expressions.txtindex 78ec93d6a1a..049ee08b0ea 100644--- a/Tests/LibJS/Bytecode/expected/destructuring-param-no-param-expressions.txt+++ b/Tests/LibJS/Bytecode/expected/destructuring-param-no-param-expressions.txt@@ -1,4 +1,4 @@-$5934a0d3 destructuring-param-no-param-expressions.js:10:1+$da96995b destructuring-param-no-param-expressions.js:10:1Registers: 8Blocks: 1Constants:@@ -12,13 +12,13 @@ block0:[ 4] GetGlobal value_feedback:0, dst:reg6, `f`[ d] NewObject dst:reg7[ 11] InitObjectLiteralProperty object:reg7, `captured`, src:Int32(1), shape_cache_index:0, property_slot:0- [ 1f] InitObjectLiteralProperty object:reg7, `local`, src:Int32(2), shape_cache_index:0, property_slot:1- [ 2d] CacheObjectShape object:reg7- [ 31] Call value_feedback:1, call_feedback:0, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7]- [ 3b] End value:reg5+ [ 1b] InitObjectLiteralProperty object:reg7, `local`, src:Int32(2), shape_cache_index:0, property_slot:1+ [ 25] CacheObjectShape object:reg7+ [ 29] Call value_feedback:1, call_feedback:0, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7]+ [ 33] End value:reg5-f$85b10e2a destructuring-param-no-param-expressions.js:6:12+f$e5589008 destructuring-param-no-param-expressions.js:6:12Registers: 7Blocks: 1Locals: local~0@@ -32,4 +32,4 @@ block0:[ 18] InitializeLexicalBinding `captured`, src:reg6[ 25] GetById value_feedback:1, dst:local~0, base:reg5, `local`[ 2f] NewFunction dst:reg5, shared_function_data_index:0- [ 39] Return value:reg5+ [ 37] Return value:reg5diff --git a/Tests/LibJS/Bytecode/expected/enclosing-function-bindings-with-eval-or-with.txt b/Tests/LibJS/Bytecode/expected/enclosing-function-bindings-with-eval-or-with.txtindex 16ff3387ea9..369b459e2b0 100644--- a/Tests/LibJS/Bytecode/expected/enclosing-function-bindings-with-eval-or-with.txt+++ b/Tests/LibJS/Bytecode/expected/enclosing-function-bindings-with-eval-or-with.txt@@ -12,7 +12,7 @@ block0:[ 16] End value:reg5-outer$092915f9 enclosing-function-bindings-with-eval-or-with.js:2:9+outer$49da123d enclosing-function-bindings-with-eval-or-with.js:2:9Registers: 11Blocks: 1Constants:@@ -25,24 +25,24 @@ block0:[ 9] CreateVariable `evaluates`, is_immutable:false, is_global:false, is_strict:false[ 11] InitializeVariableBinding `evaluates`, src:Undefined[ 1e] NewFunction dst:reg5, shared_function_data_index:0- [ 28] SetVariableBinding `evaluates`, src:reg5- [ 35] CreateVariable `withObject`, is_immutable:false, is_global:false, is_strict:false- [ 3d] InitializeVariableBinding `withObject`, src:Undefined- [ 4a] NewFunction dst:reg6, shared_function_data_index:1- [ 54] SetVariableBinding `withObject`, src:reg6- [ 61] InitializeLexicalBinding `a`, src:Int32(1)- [ 6e] GetCalleeAndThisFromEnvironment value_feedback:0, callee:reg7, this_value:reg8, `evaluates`- [ 7e] Call value_feedback:1, call_feedback:0, dst:reg7, callee:reg7, this_value:reg8- [ 87] Call value_feedback:2, call_feedback:1, dst:reg7, callee:reg7, this_value:Undefined- [ 90] GetCalleeAndThisFromEnvironment value_feedback:3, callee:reg8, this_value:reg9, `withObject`- [ a0] NewObject dst:reg10- [ a4] Call value_feedback:4, call_feedback:2, dst:reg8, callee:reg8, this_value:reg9, arguments:[reg10]- [ ae] Call value_feedback:5, call_feedback:3, dst:reg8, callee:reg8, this_value:Undefined- [ b7] NewArray dst:reg9, elements:[reg7, reg8]- [ bc] Return value:reg9---evaluates$9cd8c0ca enclosing-function-bindings-with-eval-or-with.js:4:13+ [ 26] SetVariableBinding `evaluates`, src:reg5+ [ 33] CreateVariable `withObject`, is_immutable:false, is_global:false, is_strict:false+ [ 3b] InitializeVariableBinding `withObject`, src:Undefined+ [ 48] NewFunction dst:reg6, shared_function_data_index:1+ [ 50] SetVariableBinding `withObject`, src:reg6+ [ 5d] InitializeLexicalBinding `a`, src:Int32(1)+ [ 6a] GetCalleeAndThisFromEnvironment value_feedback:0, callee:reg7, this_value:reg8, `evaluates`+ [ 7a] Call value_feedback:1, call_feedback:0, dst:reg7, callee:reg7, this_value:reg8+ [ 83] Call value_feedback:2, call_feedback:1, dst:reg7, callee:reg7, this_value:Undefined+ [ 8c] GetCalleeAndThisFromEnvironment value_feedback:3, callee:reg8, this_value:reg9, `withObject`+ [ 9c] NewObject dst:reg10+ [ a0] Call value_feedback:4, call_feedback:2, dst:reg8, callee:reg8, this_value:reg9, arguments:[reg10]+ [ aa] Call value_feedback:5, call_feedback:3, dst:reg8, callee:reg8, this_value:Undefined+ [ b3] NewArray dst:reg9, elements:[reg7, reg8]+ [ b8] Return value:reg9+++evaluates$fc8042a8 enclosing-function-bindings-with-eval-or-with.js:4:13Registers: 7Blocks: 1Constants:@@ -54,7 +54,7 @@ block0:[ 6] DynamicGetCalleeAndThisFromEnvironment value_feedback:0, callee:reg5, this_value:reg6, `eval`[ 10] CallDirectEval value_feedback:1, call_feedback:0, dst:reg5, callee:reg5, this_value:reg6, arguments:[String("")][ 1a] NewFunction dst:reg5, shared_function_data_index:0- [ 24] Return value:reg5+ [ 22] Return value:reg5eval$d8dbb89d@@ -79,7 +79,7 @@ block0:[ a] Return value:reg5-withObject$8f4a4fd7 enclosing-function-bindings-with-eval-or-with.js:8:9+withObject$ae40d571 enclosing-function-bindings-with-eval-or-with.js:8:9Registers: 7Blocks: 1@@ -88,8 +88,8 @@ block0:[ 1] GetLexicalEnvironment dst:reg4[ 3] EnterObjectEnvironment dst:reg5, object:arg0[ 6] NewFunction dst:reg6, shared_function_data_index:0- [ 10] SetLexicalEnvironment environment:reg4- [ 12] Return value:reg6+ [ e] SetLexicalEnvironment environment:reg4+ [ 10] Return value:reg6$caf2ed54 enclosing-function-bindings-with-eval-or-with.js:9:20diff --git a/Tests/LibJS/Bytecode/expected/enclosing-function-bindings.txt b/Tests/LibJS/Bytecode/expected/enclosing-function-bindings.txtindex efd5434b454..f2acc106caf 100644--- a/Tests/LibJS/Bytecode/expected/enclosing-function-bindings.txt+++ b/Tests/LibJS/Bytecode/expected/enclosing-function-bindings.txt@@ -19,7 +19,7 @@ block0:[ 3e] End value:reg5-outer$350dc193 enclosing-function-bindings.js:4:9+outer$f9e4a76f enclosing-function-bindings.js:4:9Registers: 7Blocks: 1Constants:@@ -33,21 +33,21 @@ block0:[ 1e] CreateVariable `callee`, is_immutable:false, is_global:false, is_strict:false[ 26] InitializeVariableBinding `callee`, src:Undefined[ 33] NewFunction dst:reg5, shared_function_data_index:0- [ 3d] SetVariableBinding `callee`, src:reg5- [ 4a] GetBinding value_feedback:0, dst:reg5, `a`- [ 59] InitializeLexicalBinding `b`, src:reg5- [ 66] NewFunction dst:reg6, shared_function_data_index:1- [ 70] Return value:reg6+ [ 3b] SetVariableBinding `callee`, src:reg5+ [ 48] GetBinding value_feedback:0, dst:reg5, `a`+ [ 57] InitializeLexicalBinding `b`, src:reg5+ [ 64] NewFunction dst:reg6, shared_function_data_index:1+ [ 6c] Return value:reg6-$8ff6246c enclosing-function-bindings.js:8:12+$ef9da64a enclosing-function-bindings.js:8:12Registers: 6Blocks: 1block0:[ 0] Enter[ 1] NewFunction dst:reg5, shared_function_data_index:0- [ b] Return value:reg5+ [ 9] Return value:reg5inner$580e0425 enclosing-function-bindings.js:10:15@@ -75,7 +75,7 @@ block0:[ 10] Return value:reg5-blockFunctions$c295f9c6 enclosing-function-bindings.js:16:9+blockFunctions$0346f60a enclosing-function-bindings.js:16:9Registers: 7Blocks: 1Locals: first~0@@ -91,11 +91,11 @@ block0:[ 18] CreateLexicalEnvironment dst:reg5, parent:reg4, capacity:1, is_catch_environment:false[ 24] CreateVariable `second`, is_immutable:false, is_global:false, is_strict:false[ 2c] NewFunction dst:first~0, shared_function_data_index:0- [ 36] NewFunction dst:reg6, shared_function_data_index:1- [ 40] InitializeLexicalBinding `second`, src:reg6- [ 4d] Call value_feedback:0, call_feedback:0, dst:reg6, callee:first~0, this_value:Undefined- [ 56] SetLexicalEnvironment environment:reg4- [ 58] Return value:reg6+ [ 34] NewFunction dst:reg6, shared_function_data_index:1+ [ 3c] InitializeLexicalBinding `second`, src:reg6+ [ 49] Call value_feedback:0, call_feedback:0, dst:reg6, callee:first~0, this_value:Undefined+ [ 52] SetLexicalEnvironment environment:reg4+ [ 54] Return value:reg6first$fd6705ac enclosing-function-bindings.js:19:13diff --git a/Tests/LibJS/Bytecode/expected/eval-prevents-locals.txt b/Tests/LibJS/Bytecode/expected/eval-prevents-locals.txtindex 7ecc44bc1fb..3772254de5a 100644--- a/Tests/LibJS/Bytecode/expected/eval-prevents-locals.txt+++ b/Tests/LibJS/Bytecode/expected/eval-prevents-locals.txt@@ -46,7 +46,7 @@ block0:[ 4] End value:reg5-outer_eval$41ea4b2d eval-prevents-locals.js:14:9+outer_eval$e242c94f eval-prevents-locals.js:14:9Registers: 9Blocks: 1Constants:@@ -61,12 +61,12 @@ block0:[ 14] CreateVariable `inner`, is_immutable:false, is_global:false, is_strict:false[ 1c] InitializeVariableBinding `inner`, src:Undefined[ 29] NewFunction dst:reg6, shared_function_data_index:0- [ 33] SetVariableBinding `inner`, src:reg6- [ 40] DynamicGetCalleeAndThisFromEnvironment value_feedback:0, callee:reg6, this_value:reg7, `eval`- [ 4a] CallDirectEval value_feedback:1, call_feedback:0, dst:reg6, callee:reg6, this_value:reg7, arguments:[String("")]- [ 54] GetCalleeAndThisFromEnvironment value_feedback:2, callee:reg7, this_value:reg8, `inner`- [ 64] Call value_feedback:3, call_feedback:1, dst:reg7, callee:reg7, this_value:reg8- [ 6d] Return value:reg7+ [ 31] SetVariableBinding `inner`, src:reg6+ [ 3e] DynamicGetCalleeAndThisFromEnvironment value_feedback:0, callee:reg6, this_value:reg7, `eval`+ [ 48] CallDirectEval value_feedback:1, call_feedback:0, dst:reg6, callee:reg6, this_value:reg7, arguments:[String("")]+ [ 52] GetCalleeAndThisFromEnvironment value_feedback:2, callee:reg7, this_value:reg8, `inner`+ [ 62] Call value_feedback:3, call_feedback:1, dst:reg7, callee:reg7, this_value:reg8+ [ 6b] Return value:reg7eval$d8dbb89ddiff --git a/Tests/LibJS/Bytecode/expected/eval-scope-optimization.txt b/Tests/LibJS/Bytecode/expected/eval-scope-optimization.txtindex 48bb1faedd4..974e494c017 100644--- a/Tests/LibJS/Bytecode/expected/eval-scope-optimization.txt+++ b/Tests/LibJS/Bytecode/expected/eval-scope-optimization.txt@@ -12,7 +12,7 @@ block0:[ 16] End value:reg5-outer$496e693e eval-scope-optimization.js:6:5+outer$deb72320 eval-scope-optimization.js:6:5Registers: 7Blocks: 1Constants:@@ -24,7 +24,7 @@ block0:[ 1] CreateVariable `inner`, is_immutable:false, is_global:false, is_strict:false[ 9] InitializeVariableBinding `inner`, src:Undefined[ 16] NewFunction dst:reg5, shared_function_data_index:0- [ 20] SetVariableBinding `inner`, src:reg5- [ 2d] GetGlobal value_feedback:0, dst:reg6, `Number`- [ 36] CallConstruct value_feedback:1, call_feedback:0, dst:reg6, callee:reg6, arguments:[Int32(42)]- [ 3f] Return value:reg6+ [ 1e] SetVariableBinding `inner`, src:reg5+ [ 2b] GetGlobal value_feedback:0, dst:reg6, `Number`+ [ 34] CallConstruct value_feedback:1, call_feedback:0, dst:reg6, callee:reg6, arguments:[Int32(42)]+ [ 3d] Return value:reg6diff --git a/Tests/LibJS/Bytecode/expected/for-in-lexical-scope.txt b/Tests/LibJS/Bytecode/expected/for-in-lexical-scope.txtindex 5d09c3ddccf..a5b5a68bcca 100644--- a/Tests/LibJS/Bytecode/expected/for-in-lexical-scope.txt+++ b/Tests/LibJS/Bytecode/expected/for-in-lexical-scope.txt@@ -1,4 +1,4 @@-$eaf0e6f7 for-in-lexical-scope.js:1:5+$09e76c91 for-in-lexical-scope.js:1:5Registers: 13Blocks: 5Locals: probeDecl~0@@ -14,28 +14,28 @@ block0:[ 12] CreateVariable `x`, is_immutable:false, is_global:false, is_strict:false[ 1a] NewObject dst:reg8[ 1e] InitObjectLiteralProperty object:reg8, `i`, src:Int32(0), shape_cache_index:0, property_slot:0- [ 2c] CacheObjectShape object:reg8- [ 30] Mov dst:reg6, src:reg8- [ 33] SetLexicalEnvironment environment:reg4- [ 35] Mov dst:reg5, src:Undefined- [ 38] JumpNullish condition:reg6, true_target:block4, false_target:block1+ [ 28] CacheObjectShape object:reg8+ [ 2c] Mov dst:reg6, src:reg8+ [ 2f] SetLexicalEnvironment environment:reg4+ [ 31] Mov dst:reg5, src:Undefined+ [ 34] JumpNullish condition:reg6, true_target:block4, false_target:block1block1:- [ 42] GetObjectPropertyIterator dst_keys:reg8, dst_receiver:reg7, object:reg6- [ 4a] Mov dst:reg9, src:Int32(0)+ [ 3e] GetObjectPropertyIterator dst_keys:reg8, dst_receiver:reg7, object:reg6+ [ 46] Mov dst:reg9, src:Int32(0)block2:- [ 4d] ObjectPropertyIteratorNext dst_value:reg10, dst_done:reg11, receiver:reg7, keys:reg8, cursor:reg9- [ 53] JumpTrue condition:reg11, target:block4+ [ 49] ObjectPropertyIteratorNext dst_value:reg10, dst_done:reg11, receiver:reg7, keys:reg8, cursor:reg9+ [ 4f] JumpTrue condition:reg11, target:block4block3:- [ 59] CreateLexicalEnvironment dst:reg12, parent:reg4, capacity:1, is_catch_environment:false- [ 65] CreateVariable `x`, is_immutable:false, is_global:false, is_strict:false- [ 6d] InitializeLexicalBinding `x`, src:reg10- [ 7a] NewFunction dst:probeDecl~0, shared_function_data_index:0- [ 84] SetVariableBindingOfBlockFunction `probeDecl`, src:probeDecl~0, program_environment_depth:1- [ 8d] SetLexicalEnvironment environment:reg4- [ 8f] JumpLoop target:block2+ [ 55] CreateLexicalEnvironment dst:reg12, parent:reg4, capacity:1, is_catch_environment:false+ [ 61] CreateVariable `x`, is_immutable:false, is_global:false, is_strict:false+ [ 69] InitializeLexicalBinding `x`, src:reg10+ [ 76] NewFunction dst:probeDecl~0, shared_function_data_index:0+ [ 7e] SetVariableBindingOfBlockFunction `probeDecl`, src:probeDecl~0, program_environment_depth:1+ [ 87] SetLexicalEnvironment environment:reg4+ [ 89] JumpLoop target:block2block4:- [ 94] End value:reg5+ [ 8e] End value:reg5diff --git a/Tests/LibJS/Bytecode/expected/for-in-register-lifetime.txt b/Tests/LibJS/Bytecode/expected/for-in-register-lifetime.txtindex 6b11471d747..a18dc646265 100644--- a/Tests/LibJS/Bytecode/expected/for-in-register-lifetime.txt+++ b/Tests/LibJS/Bytecode/expected/for-in-register-lifetime.txt@@ -1,4 +1,4 @@-$67e760f2 for-in-register-lifetime.js:1:5+$a04c8a06 for-in-register-lifetime.js:1:5Registers: 16Blocks: 5Constants:@@ -15,34 +15,34 @@ block0:[ 4] SetGlobal `result`, src:String("")[ b] NewObject dst:reg6[ f] InitObjectLiteralProperty object:reg6, `a`, src:Int32(1), shape_cache_index:0, property_slot:0- [ 1d] InitObjectLiteralProperty object:reg6, `b`, src:Int32(2), shape_cache_index:0, property_slot:1- [ 2b] InitObjectLiteralProperty object:reg6, `c`, src:Int32(3), shape_cache_index:0, property_slot:2- [ 39] CacheObjectShape object:reg6- [ 3d] SetGlobal `obj`, src:reg6- [ 44] GetGlobal value_feedback:0, dst:reg6, `obj`- [ 4d] Mov dst:reg5, src:Undefined- [ 50] JumpNullish condition:reg6, true_target:block4, false_target:block1+ [ 19] InitObjectLiteralProperty object:reg6, `b`, src:Int32(2), shape_cache_index:0, property_slot:1+ [ 23] InitObjectLiteralProperty object:reg6, `c`, src:Int32(3), shape_cache_index:0, property_slot:2+ [ 2d] CacheObjectShape object:reg6+ [ 31] SetGlobal `obj`, src:reg6+ [ 38] GetGlobal value_feedback:0, dst:reg6, `obj`+ [ 41] Mov dst:reg5, src:Undefined+ [ 44] JumpNullish condition:reg6, true_target:block4, false_target:block1block1:- [ 5a] GetObjectPropertyIterator dst_keys:reg8, dst_receiver:reg7, object:reg6- [ 62] Mov dst:reg9, src:Int32(0)+ [ 4e] GetObjectPropertyIterator dst_keys:reg8, dst_receiver:reg7, object:reg6+ [ 56] Mov dst:reg9, src:Int32(0)block2:- [ 65] ObjectPropertyIteratorNext dst_value:reg10, dst_done:reg11, receiver:reg7, keys:reg8, cursor:reg9- [ 6b] JumpTrue condition:reg11, target:block4+ [ 59] ObjectPropertyIteratorNext dst_value:reg10, dst_done:reg11, receiver:reg7, keys:reg8, cursor:reg9+ [ 5f] JumpTrue condition:reg11, target:block4block3:- [ 71] SetGlobal `k`, src:reg10- [ 78] GetGlobal value_feedback:1, dst:reg12, `result`- [ 81] GetGlobal value_feedback:2, dst:reg13, `k`- [ 8a] GetGlobal value_feedback:3, dst:reg14, `obj`- [ 93] GetGlobal value_feedback:4, dst:reg15, `k`- [ 9c] GetByValue value_feedback:5, keyed_feedback:0, dst:reg14, base:reg14, property:reg15- [ a6] Add arith_feedback:0, dst:reg13, lhs:reg13, rhs:reg14- [ ac] Add arith_feedback:1, dst:reg14, lhs:reg12, rhs:reg13- [ b2] SetGlobal `result`, src:reg14- [ b9] Mov dst:reg5, src:reg14- [ bc] JumpLoop target:block2+ [ 65] SetGlobal `k`, src:reg10+ [ 6c] GetGlobal value_feedback:1, dst:reg12, `result`+ [ 75] GetGlobal value_feedback:2, dst:reg13, `k`+ [ 7e] GetGlobal value_feedback:3, dst:reg14, `obj`+ [ 87] GetGlobal value_feedback:4, dst:reg15, `k`+ [ 90] GetByValue value_feedback:5, keyed_feedback:0, dst:reg14, base:reg14, property:reg15+ [ 9a] Add arith_feedback:0, dst:reg13, lhs:reg13, rhs:reg14+ [ a0] Add arith_feedback:1, dst:reg14, lhs:reg12, rhs:reg13+ [ a6] SetGlobal `result`, src:reg14+ [ ad] Mov dst:reg5, src:reg14+ [ b0] JumpLoop target:block2block4:- [ c1] End value:reg5+ [ b5] End value:reg5diff --git a/Tests/LibJS/Bytecode/expected/for-in-var-function-lhs-name.txt b/Tests/LibJS/Bytecode/expected/for-in-var-function-lhs-name.txtindex 8a38aa65f6c..f782acc6f83 100644--- a/Tests/LibJS/Bytecode/expected/for-in-var-function-lhs-name.txt+++ b/Tests/LibJS/Bytecode/expected/for-in-var-function-lhs-name.txt@@ -12,7 +12,7 @@ block0:[ 16] End value:reg5-fn$563d19e7 for-in-var-function-lhs-name.js:4:14+fn$e33a0099 for-in-var-function-lhs-name.js:4:14Registers: 11Blocks: 5Locals: f~0@@ -24,21 +24,21 @@ block0:[ 0] Enter[ 1] Mov dst:f~0, src:Undefined[ 4] NewFunction dst:f~0, shared_function_data_index:0 (f)- [ e] NewObject dst:reg6- [ 12] Mov dst:reg5, src:reg6- [ 15] JumpNullish condition:reg5, true_target:block4, false_target:block1+ [ c] NewObject dst:reg6+ [ 10] Mov dst:reg5, src:reg6+ [ 13] JumpNullish condition:reg5, true_target:block4, false_target:block1block1:- [ 1f] GetObjectPropertyIterator dst_keys:reg7, dst_receiver:reg6, object:reg5- [ 27] Mov dst:reg8, src:Int32(0)+ [ 1d] GetObjectPropertyIterator dst_keys:reg7, dst_receiver:reg6, object:reg5+ [ 25] Mov dst:reg8, src:Int32(0)block2:- [ 2a] ObjectPropertyIteratorNext dst_value:reg9, dst_done:reg10, receiver:reg6, keys:reg7, cursor:reg8- [ 30] JumpTrue condition:reg10, target:block4+ [ 28] ObjectPropertyIteratorNext dst_value:reg9, dst_done:reg10, receiver:reg6, keys:reg7, cursor:reg8+ [ 2e] JumpTrue condition:reg10, target:block4block3:- [ 36] Mov dst:f~0, src:reg9- [ 39] JumpLoop target:block2+ [ 34] Mov dst:f~0, src:reg9+ [ 37] JumpLoop target:block2block4:- [ 3e] End value:Undefined+ [ 3c] End value:Undefineddiff --git a/Tests/LibJS/Bytecode/expected/for-loop-scoping.txt b/Tests/LibJS/Bytecode/expected/for-loop-scoping.txtindex 063c7276063..81750586d5b 100644--- a/Tests/LibJS/Bytecode/expected/for-loop-scoping.txt+++ b/Tests/LibJS/Bytecode/expected/for-loop-scoping.txt@@ -15,7 +15,7 @@ block0:[ 33] End value:reg5-forLetClosure$4e806cb4 for-loop-scoping.js:2:15+forLetClosure$8f3168f8 for-loop-scoping.js:2:15Registers: 8Blocks: 4Locals: fns~0@@ -39,26 +39,26 @@ block0:block1:[ 5e] GetById value_feedback:1, dst:reg6, base:fns~0, `push`[ 68] NewFunction dst:reg7, shared_function_data_index:0- [ 72] Call value_feedback:2, call_feedback:0, dst:reg6, callee:reg6, this_value:fns~0, arguments:[reg7]- [ 7c] GetBinding value_feedback:3, dst:reg6, `i`- [ 8b] SetLexicalEnvironment environment:reg4- [ 8d] CreateLexicalEnvironment dst:reg5, parent:reg4, capacity:1, is_catch_environment:false- [ 99] CreateVariable `i`, is_immutable:false, is_global:false, is_strict:false- [ a1] InitializeLexicalBinding `i`, src:reg6- [ ae] GetBinding value_feedback:4, dst:reg6, `i`- [ bd] PostfixIncrement arith_feedback:0, dst:reg7, src:reg6- [ c2] SetLexicalBinding `i`, src:reg6+ [ 70] Call value_feedback:2, call_feedback:0, dst:reg6, callee:reg6, this_value:fns~0, arguments:[reg7]+ [ 7a] GetBinding value_feedback:3, dst:reg6, `i`+ [ 89] SetLexicalEnvironment environment:reg4+ [ 8b] CreateLexicalEnvironment dst:reg5, parent:reg4, capacity:1, is_catch_environment:false+ [ 97] CreateVariable `i`, is_immutable:false, is_global:false, is_strict:false+ [ 9f] InitializeLexicalBinding `i`, src:reg6+ [ ac] GetBinding value_feedback:4, dst:reg6, `i`+ [ bb] PostfixIncrement arith_feedback:0, dst:reg7, src:reg6+ [ c0] SetLexicalBinding `i`, src:reg6block2:- [ cf] GetBinding value_feedback:5, dst:reg6, `i`- [ de] JumpLessThanLoopRhsInt32 arith_feedback:1, lhs:reg6, rhs:3, true_target:block1, false_target:block3+ [ cd] GetBinding value_feedback:5, dst:reg6, `i`+ [ dc] JumpLessThanLoopRhsInt32 arith_feedback:1, lhs:reg6, rhs:3, true_target:block1, false_target:block3block3:- [ ee] SetLexicalEnvironment environment:reg4- [ f0] GetById value_feedback:6, dst:reg5, base:fns~0, `map`- [ fa] NewFunction dst:reg6, shared_function_data_index:1- [ 104] Call value_feedback:7, call_feedback:1, dst:reg5, callee:reg5, this_value:fns~0, arguments:[reg6]- [ 10e] Return value:reg5+ [ ec] SetLexicalEnvironment environment:reg4+ [ ee] GetById value_feedback:6, dst:reg5, base:fns~0, `map`+ [ f8] NewFunction dst:reg6, shared_function_data_index:1+ [ 100] Call value_feedback:7, call_feedback:1, dst:reg5, callee:reg5, this_value:fns~0, arguments:[reg6]+ [ 10a] Return value:reg5map$55eca889 BuiltinFile:275:11diff --git a/Tests/LibJS/Bytecode/expected/for-of-continue-with-block-scope.txt b/Tests/LibJS/Bytecode/expected/for-of-continue-with-block-scope.txtindex 09661799f01..4b03f123db8 100644--- a/Tests/LibJS/Bytecode/expected/for-of-continue-with-block-scope.txt+++ b/Tests/LibJS/Bytecode/expected/for-of-continue-with-block-scope.txt@@ -13,7 +13,7 @@ block0:[ 1a] End value:reg5-f$e86a2487 for-of-continue-with-block-scope.js:2:15+f$85feb199 for-of-continue-with-block-scope.js:2:15Registers: 14Blocks: 7Locals: t~0, o~1@@ -50,19 +50,19 @@ block3:block4:[ 97] GetById value_feedback:4, dst:reg12, base:t~0, `find`[ a1] NewFunction dst:reg13, shared_function_data_index:0- [ ab] Call value_feedback:5, call_feedback:1, dst:reg12, callee:reg12, this_value:t~0, arguments:[reg13]- [ b5] Mov dst:o~1, src:reg12- [ b8] SetLexicalEnvironment environment:reg4- [ ba] JumpLoop target:block1+ [ a9] Call value_feedback:5, call_feedback:1, dst:reg12, callee:reg12, this_value:t~0, arguments:[reg13]+ [ b3] Mov dst:o~1, src:reg12+ [ b6] SetLexicalEnvironment environment:reg4+ [ b8] JumpLoop target:block1block5:- [ bf] Catch value_feedback:6, dst:reg11- [ c3] SetLexicalEnvironment environment:reg4- [ c5] IteratorClose iterator_object:reg6, iterator_next:reg7, iterator_done:reg8, completion_value:reg11- [ cd] Throw src:reg11+ [ bd] Catch value_feedback:6, dst:reg11+ [ c1] SetLexicalEnvironment environment:reg4+ [ c3] IteratorClose iterator_object:reg6, iterator_next:reg7, iterator_done:reg8, completion_value:reg11+ [ cb] Throw src:reg11block6:- [ cf] Return value:t~0+ [ cd] Return value:t~0Exception handlers:- [ 34 .. bf] => handler block5+ [ 34 .. bd] => handler block5diff --git a/Tests/LibJS/Bytecode/expected/generator-yield-call.txt b/Tests/LibJS/Bytecode/expected/generator-yield-call.txtindex 0f65b8c037f..56ba286be8b 100644--- a/Tests/LibJS/Bytecode/expected/generator-yield-call.txt+++ b/Tests/LibJS/Bytecode/expected/generator-yield-call.txt@@ -1,4 +1,4 @@-$5d0c90cb generator-yield-call.js:9:1+$e97e4d93 generator-yield-call.js:9:1Registers: 9Blocks: 1Constants:@@ -12,12 +12,12 @@ block0:[ 4] GetGlobal value_feedback:0, dst:reg6, `f`[ d] NewObject dst:reg7[ 11] InitObjectLiteralProperty object:reg7, `x`, src:Int32(1), shape_cache_index:0, property_slot:0- [ 1f] CacheObjectShape object:reg7- [ 23] NewObject dst:reg8- [ 27] InitObjectLiteralProperty object:reg8, `y`, src:Int32(2), shape_cache_index:1, property_slot:0- [ 35] CacheObjectShape object:reg8- [ 39] Call value_feedback:1, call_feedback:0, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7, reg8]- [ 44] End value:reg5+ [ 1b] CacheObjectShape object:reg7+ [ 1f] NewObject dst:reg8+ [ 23] InitObjectLiteralProperty object:reg8, `y`, src:Int32(2), shape_cache_index:1, property_slot:0+ [ 2d] CacheObjectShape object:reg8+ [ 31] Call value_feedback:1, call_feedback:0, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7, reg8]+ [ 3c] End value:reg5f$4b34a73b generator-yield-call.js:6:5diff --git a/Tests/LibJS/Bytecode/expected/indexed-append-guards.txt b/Tests/LibJS/Bytecode/expected/indexed-append-guards.txtindex 642f6572c38..42923c36e6b 100644--- a/Tests/LibJS/Bytecode/expected/indexed-append-guards.txt+++ b/Tests/LibJS/Bytecode/expected/indexed-append-guards.txt@@ -1,4 +1,4 @@-$f2d870d1 indexed-append-guards.js:1:1+$76fe5a69 indexed-append-guards.js:1:1Registers: 10Blocks: 7Constants:@@ -25,56 +25,56 @@ block0:[ 31] DynamicInitializeLexicalBinding `object`, src:reg6[ 38] GetGlobal value_feedback:3, dst:reg6, `expect_type_error`[ 41] NewFunction dst:reg7, shared_function_data_index:0- [ 4b] Call value_feedback:4, call_feedback:1, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7]- [ 55] GetGlobal value_feedback:5, dst:reg6, `object`- [ 5e] GetByValue value_feedback:6, keyed_feedback:1, dst:reg6, base:reg6, property:Int32(1)- [ 68] StrictlyInequals arith_feedback:0, dst:reg6, lhs:reg6, rhs:Undefined- [ 6e] Mov dst:reg5, src:Undefined- [ 71] JumpFalse condition:reg6, target:block2+ [ 49] Call value_feedback:4, call_feedback:1, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7]+ [ 53] GetGlobal value_feedback:5, dst:reg6, `object`+ [ 5c] GetByValue value_feedback:6, keyed_feedback:1, dst:reg6, base:reg6, property:Int32(1)+ [ 66] StrictlyInequals arith_feedback:0, dst:reg6, lhs:reg6, rhs:Undefined+ [ 6c] Mov dst:reg5, src:Undefined+ [ 6f] JumpFalse condition:reg6, target:block2block1:- [ 77] GetGlobal value_feedback:7, dst:reg6, `Error`- [ 80] CallConstruct value_feedback:8, call_feedback:2, dst:reg6, callee:reg6, arguments:[String("Indexed object append mutated")]- [ 89] Throw src:reg6+ [ 75] GetGlobal value_feedback:7, dst:reg6, `Error`+ [ 7e] CallConstruct value_feedback:8, call_feedback:2, dst:reg6, callee:reg6, arguments:[String("Indexed object append mutated")]+ [ 87] Throw src:reg6block2:- [ 8b] NewPrimitiveArray dst:reg6, elements:[1, 2]- [ a1] DynamicInitializeLexicalBinding `array`, src:reg6- [ a8] GetGlobal value_feedback:9, dst:reg6, `Object`- [ b1] GetById value_feedback:10, dst:reg7, base:reg6, `defineProperty`- [ bb] GetGlobal value_feedback:11, dst:reg8, `array`- [ c4] NewObject dst:reg9- [ c8] InitObjectLiteralProperty object:reg9, `writable`, src:Bool(false), shape_cache_index:0, property_slot:0- [ d6] CacheObjectShape object:reg9- [ da] Call value_feedback:12, call_feedback:3, dst:reg5, callee:reg7, this_value:reg6, arguments:[reg8, String("length"), reg9]- [ e6] GetGlobal value_feedback:13, dst:reg6, `expect_type_error`- [ ef] NewFunction dst:reg7, shared_function_data_index:1- [ f9] Call value_feedback:14, call_feedback:4, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7]- [ 103] GetGlobal value_feedback:15, dst:reg6, `array`- [ 10c] GetLength value_feedback:16, keyed_feedback:2, dst:reg6, base:reg6- [ 115] StrictlyInequalsRhsInt32 arith_feedback:1, dst:reg6, lhs:reg6, rhs:2- [ 11e] Mov dst:reg5, src:Undefined- [ 121] JumpFalse condition:reg6, target:block4+ [ 89] NewPrimitiveArray dst:reg6, elements:[1, 2]+ [ 9f] DynamicInitializeLexicalBinding `array`, src:reg6+ [ a6] GetGlobal value_feedback:9, dst:reg6, `Object`+ [ af] GetById value_feedback:10, dst:reg7, base:reg6, `defineProperty`+ [ b9] GetGlobal value_feedback:11, dst:reg8, `array`+ [ c2] NewObject dst:reg9+ [ c6] InitObjectLiteralProperty object:reg9, `writable`, src:Bool(false), shape_cache_index:0, property_slot:0+ [ d0] CacheObjectShape object:reg9+ [ d4] Call value_feedback:12, call_feedback:3, dst:reg5, callee:reg7, this_value:reg6, arguments:[reg8, String("length"), reg9]+ [ e0] GetGlobal value_feedback:13, dst:reg6, `expect_type_error`+ [ e9] NewFunction dst:reg7, shared_function_data_index:1+ [ f1] Call value_feedback:14, call_feedback:4, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7]+ [ fb] GetGlobal value_feedback:15, dst:reg6, `array`+ [ 104] GetLength value_feedback:16, keyed_feedback:2, dst:reg6, base:reg6+ [ 10d] StrictlyInequalsRhsInt32 arith_feedback:1, dst:reg6, lhs:reg6, rhs:2+ [ 116] Mov dst:reg5, src:Undefined+ [ 119] JumpFalse condition:reg6, target:block4block3:- [ 127] GetGlobal value_feedback:17, dst:reg6, `Error`- [ 130] CallConstruct value_feedback:18, call_feedback:5, dst:reg6, callee:reg6, arguments:[String("Array length changed")]- [ 139] Throw src:reg6+ [ 11f] GetGlobal value_feedback:17, dst:reg6, `Error`+ [ 128] CallConstruct value_feedback:18, call_feedback:5, dst:reg6, callee:reg6, arguments:[String("Array length changed")]+ [ 131] Throw src:reg6block4:- [ 13b] GetGlobal value_feedback:19, dst:reg6, `array`- [ 144] GetByValue value_feedback:20, keyed_feedback:3, dst:reg6, base:reg6, property:Int32(2)- [ 14e] StrictlyInequals arith_feedback:2, dst:reg6, lhs:reg6, rhs:Undefined- [ 154] Mov dst:reg5, src:Undefined- [ 157] JumpFalse condition:reg6, target:block6+ [ 133] GetGlobal value_feedback:19, dst:reg6, `array`+ [ 13c] GetByValue value_feedback:20, keyed_feedback:3, dst:reg6, base:reg6, property:Int32(2)+ [ 146] StrictlyInequals arith_feedback:2, dst:reg6, lhs:reg6, rhs:Undefined+ [ 14c] Mov dst:reg5, src:Undefined+ [ 14f] JumpFalse condition:reg6, target:block6block5:- [ 15d] GetGlobal value_feedback:21, dst:reg6, `Error`- [ 166] CallConstruct value_feedback:22, call_feedback:6, dst:reg6, callee:reg6, arguments:[String("Array append mutated")]- [ 16f] Throw src:reg6+ [ 155] GetGlobal value_feedback:21, dst:reg6, `Error`+ [ 15e] CallConstruct value_feedback:22, call_feedback:6, dst:reg6, callee:reg6, arguments:[String("Array append mutated")]+ [ 167] Throw src:reg6block6:- [ 171] End value:reg5+ [ 169] End value:reg5expect_type_error$16c63544 indexed-append-guards.js:4:9diff --git a/Tests/LibJS/Bytecode/expected/invalid-lhs-assignment-no-dead-code.txt b/Tests/LibJS/Bytecode/expected/invalid-lhs-assignment-no-dead-code.txtindex f3af1c1bbf4..71d7fad766b 100644--- a/Tests/LibJS/Bytecode/expected/invalid-lhs-assignment-no-dead-code.txt+++ b/Tests/LibJS/Bytecode/expected/invalid-lhs-assignment-no-dead-code.txt@@ -1,4 +1,4 @@-$d3d6371b invalid-lhs-assignment-no-dead-code.js:8:1+$337db8f9 invalid-lhs-assignment-no-dead-code.js:8:1Registers: 8Blocks: 4Constants:@@ -12,19 +12,19 @@ block0:block1:[ 7] GetGlobal value_feedback:0, dst:reg6, `f`[ 10] NewFunction dst:reg7, shared_function_data_index:0- [ 1a] Call value_feedback:1, call_feedback:0, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7]- [ 24] Jump target:block3+ [ 18] Call value_feedback:1, call_feedback:0, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7]+ [ 22] Jump target:block3block2:- [ 29] Catch value_feedback:2, dst:reg6- [ 2d] Mov dst:reg5, src:Undefined- [ 30] Jump target:block3+ [ 27] Catch value_feedback:2, dst:reg6+ [ 2b] Mov dst:reg5, src:Undefined+ [ 2e] Jump target:block3block3:- [ 35] End value:reg5+ [ 33] End value:reg5Exception handlers:- [ 7 .. 29] => handler block2+ [ 7 .. 27] => handler block2f$0daba2b9 invalid-lhs-assignment-no-dead-code.js:5:6diff --git a/Tests/LibJS/Bytecode/expected/lexical-env-teardown.txt b/Tests/LibJS/Bytecode/expected/lexical-env-teardown.txtindex be49c67f75a..609a6a13591 100644--- a/Tests/LibJS/Bytecode/expected/lexical-env-teardown.txt+++ b/Tests/LibJS/Bytecode/expected/lexical-env-teardown.txt@@ -1,4 +1,4 @@-$4e922434 lexical-env-teardown.js:13:1+$ae39a612 lexical-env-teardown.js:13:1Registers: 9Blocks: 1Constants:@@ -36,18 +36,18 @@ block0:[ f1] CreateLexicalEnvironment dst:reg7, parent:reg4, capacity:1, is_catch_environment:false[ fd] CreateVariable `myName`, is_immutable:true, is_global:false, is_strict:false[ 105] NewFunction dst:reg6, shared_function_data_index:0- [ 10f] InitializeLexicalBinding `myName`, src:reg6- [ 11c] SetLexicalEnvironment environment:reg4- [ 11e] SetGlobal `namedFn`, src:reg6- [ 125] GetGlobal value_feedback:25, dst:reg6, `console`- [ 12e] GetById value_feedback:26, dst:reg7, base:reg6, `log`- [ 138] GetGlobal value_feedback:27, dst:reg8, `namedFn`- [ 141] Call value_feedback:28, call_feedback:10, dst:reg8, callee:reg8, this_value:Undefined- [ 14a] Call value_feedback:29, call_feedback:11, dst:reg5, callee:reg7, this_value:reg6, arguments:[reg8]- [ 154] End value:reg5---withTeardown$54ae836d lexical-env-teardown.js:7:9+ [ 10d] InitializeLexicalBinding `myName`, src:reg6+ [ 11a] SetLexicalEnvironment environment:reg4+ [ 11c] SetGlobal `namedFn`, src:reg6+ [ 123] GetGlobal value_feedback:25, dst:reg6, `console`+ [ 12c] GetById value_feedback:26, dst:reg7, base:reg6, `log`+ [ 136] GetGlobal value_feedback:27, dst:reg8, `namedFn`+ [ 13f] Call value_feedback:28, call_feedback:10, dst:reg8, callee:reg8, this_value:Undefined+ [ 148] Call value_feedback:29, call_feedback:11, dst:reg5, callee:reg7, this_value:reg6, arguments:[reg8]+ [ 152] End value:reg5+++withTeardown$13fd8729 lexical-env-teardown.js:7:9Registers: 9Blocks: 1Locals: inner~0@@ -62,14 +62,14 @@ block0:[ b] InitializeLexicalBinding `outer`, src:Int32(1)[ 18] NewObject dst:reg5[ 1c] InitObjectLiteralProperty object:reg5, `x`, src:Int32(10), shape_cache_index:0, property_slot:0- [ 2a] CacheObjectShape object:reg5- [ 2e] EnterObjectEnvironment dst:reg6, object:reg5- [ 31] DynamicGetBinding value_feedback:0, dst:reg7, `x`- [ 3a] DynamicGetBinding value_feedback:1, dst:reg8, `outer`- [ 43] Add arith_feedback:0, dst:inner~0, lhs:reg7, rhs:reg8- [ 49] SetLexicalEnvironment environment:reg4- [ 4b] GetBinding value_feedback:2, dst:reg5, `outer`- [ 5a] Return value:reg5+ [ 26] CacheObjectShape object:reg5+ [ 2a] EnterObjectEnvironment dst:reg6, object:reg5+ [ 2d] DynamicGetBinding value_feedback:0, dst:reg7, `x`+ [ 36] DynamicGetBinding value_feedback:1, dst:reg8, `outer`+ [ 3f] Add arith_feedback:0, dst:inner~0, lhs:reg7, rhs:reg8+ [ 45] SetLexicalEnvironment environment:reg4+ [ 47] GetBinding value_feedback:2, dst:reg5, `outer`+ [ 56] Return value:reg5blockTeardown$e0c89ee5 lexical-env-teardown.js:17:9@@ -87,7 +87,7 @@ block0:[ 7] Return value:outer~0-forInTeardown$862f5bad lexical-env-teardown.js:28:9+forInTeardown$04cd6325 lexical-env-teardown.js:28:9Registers: 11Blocks: 5Locals: outer~0, k~1@@ -104,25 +104,25 @@ block0:[ 4] Mov dst:k~1, src:<Empty>[ 7] NewObject dst:reg6[ b] InitObjectLiteralProperty object:reg6, `a`, src:Int32(1), shape_cache_index:0, property_slot:0- [ 19] InitObjectLiteralProperty object:reg6, `b`, src:Int32(2), shape_cache_index:0, property_slot:1- [ 27] CacheObjectShape object:reg6- [ 2b] Mov dst:reg5, src:reg6- [ 2e] JumpNullish condition:reg5, true_target:block4, false_target:block1+ [ 15] InitObjectLiteralProperty object:reg6, `b`, src:Int32(2), shape_cache_index:0, property_slot:1+ [ 1f] CacheObjectShape object:reg6+ [ 23] Mov dst:reg5, src:reg6+ [ 26] JumpNullish condition:reg5, true_target:block4, false_target:block1block1:- [ 38] GetObjectPropertyIterator dst_keys:reg7, dst_receiver:reg6, object:reg5- [ 40] Mov dst:reg8, src:Int32(0)+ [ 30] GetObjectPropertyIterator dst_keys:reg7, dst_receiver:reg6, object:reg5+ [ 38] Mov dst:reg8, src:Int32(0)block2:- [ 43] ObjectPropertyIteratorNext dst_value:reg9, dst_done:reg10, receiver:reg6, keys:reg7, cursor:reg8- [ 49] JumpTrue condition:reg10, target:block4+ [ 3b] ObjectPropertyIteratorNext dst_value:reg9, dst_done:reg10, receiver:reg6, keys:reg7, cursor:reg8+ [ 41] JumpTrue condition:reg10, target:block4block3:- [ 4f] Mov dst:k~1, src:reg9- [ 52] JumpLoop target:block2+ [ 47] Mov dst:k~1, src:reg9+ [ 4a] JumpLoop target:block2block4:- [ 57] Return value:outer~0+ [ 4f] Return value:outer~0forOfTeardown$2d0584ea lexical-env-teardown.js:38:9diff --git a/Tests/LibJS/Bytecode/expected/logical-assignment-register-order.txt b/Tests/LibJS/Bytecode/expected/logical-assignment-register-order.txtindex b45887d2661..cfe44703729 100644--- a/Tests/LibJS/Bytecode/expected/logical-assignment-register-order.txt+++ b/Tests/LibJS/Bytecode/expected/logical-assignment-register-order.txt@@ -1,4 +1,4 @@-$722cc25a logical-assignment-register-order.js:2:1+$1285407c logical-assignment-register-order.js:2:1Registers: 9Blocks: 3Constants:@@ -13,8 +13,8 @@ block0:block1:[ 16] NewFunction dst:reg7, shared_function_data_index:0 (value)- [ 20] SetGlobal `value`, src:reg7+ [ 1e] SetGlobal `value`, src:reg7block2:- [ 27] Mov dst:reg5, src:reg7- [ 2a] End value:reg5+ [ 25] Mov dst:reg5, src:reg7+ [ 28] End value:reg5diff --git a/Tests/LibJS/Bytecode/expected/module-level-bindings.txt b/Tests/LibJS/Bytecode/expected/module-level-bindings.txtindex 18926b14fa4..09da3236518 100644--- a/Tests/LibJS/Bytecode/expected/module-level-bindings.txt+++ b/Tests/LibJS/Bytecode/expected/module-level-bindings.txt@@ -1,11 +1,11 @@-outer$7c4bb032 module-level-bindings.mjs:6:5+outer$1ca42e54 module-level-bindings.mjs:6:5Registers: 6Blocks: 1block0:[ 0] Enter[ 1] NewFunction dst:reg5, shared_function_data_index:0- [ b] Return value:reg5+ [ 9] Return value:reg5inner$8b85ab43 module-level-bindings.mjs:7:18diff --git a/Tests/LibJS/Bytecode/expected/named-function-expression-unused-name.txt b/Tests/LibJS/Bytecode/expected/named-function-expression-unused-name.txtindex 962770b4598..3228c710f56 100644--- a/Tests/LibJS/Bytecode/expected/named-function-expression-unused-name.txt+++ b/Tests/LibJS/Bytecode/expected/named-function-expression-unused-name.txt@@ -15,7 +15,7 @@ block0:[ 29] End value:reg5-outer$fba488d4 named-function-expression-unused-name.js:6:20+outer$dcae033a named-function-expression-unused-name.js:6:20Registers: 7Blocks: 1Locals: unused~0, used~1, nested~2@@ -26,23 +26,23 @@ block0:[ 9] InitializeLexicalBinding `x`, src:arg0[ 16] GetLexicalEnvironment dst:reg4[ 18] NewFunction dst:unused~0, shared_function_data_index:0- [ 22] CreateLexicalEnvironment dst:reg6, parent:reg4, capacity:1, is_catch_environment:false- [ 2e] CreateVariable `g`, is_immutable:true, is_global:false, is_strict:false- [ 36] NewFunction dst:reg5, shared_function_data_index:1- [ 40] InitializeLexicalBinding `g`, src:reg5- [ 4d] SetLexicalEnvironment environment:reg4- [ 4f] Mov dst:used~1, src:reg5- [ 52] CreateLexicalEnvironment dst:reg6, parent:reg4, capacity:1, is_catch_environment:false- [ 5e] CreateVariable `h`, is_immutable:true, is_global:false, is_strict:false- [ 66] NewFunction dst:reg5, shared_function_data_index:2- [ 70] InitializeLexicalBinding `h`, src:reg5- [ 7d] SetLexicalEnvironment environment:reg4- [ 7f] Mov dst:nested~2, src:reg5- [ 82] NewArray dst:reg5, elements:[unused~0, used~1, nested~2]- [ 88] Return value:reg5+ [ 20] CreateLexicalEnvironment dst:reg6, parent:reg4, capacity:1, is_catch_environment:false+ [ 2c] CreateVariable `g`, is_immutable:true, is_global:false, is_strict:false+ [ 34] NewFunction dst:reg5, shared_function_data_index:1+ [ 3c] InitializeLexicalBinding `g`, src:reg5+ [ 49] SetLexicalEnvironment environment:reg4+ [ 4b] Mov dst:used~1, src:reg5+ [ 4e] CreateLexicalEnvironment dst:reg6, parent:reg4, capacity:1, is_catch_environment:false+ [ 5a] CreateVariable `h`, is_immutable:true, is_global:false, is_strict:false+ [ 62] NewFunction dst:reg5, shared_function_data_index:2+ [ 6a] InitializeLexicalBinding `h`, src:reg5+ [ 77] SetLexicalEnvironment environment:reg4+ [ 79] Mov dst:nested~2, src:reg5+ [ 7c] NewArray dst:reg5, elements:[unused~0, used~1, nested~2]+ [ 82] Return value:reg5-outerWithEval$d3ad325c named-function-expression-unused-name.js:19:5+outerWithEval$7405b07e named-function-expression-unused-name.js:19:5Registers: 7Blocks: 1@@ -52,6 +52,6 @@ block0:[ 3] CreateLexicalEnvironment dst:reg6, parent:reg4, capacity:1, is_catch_environment:false[ f] CreateVariable `i`, is_immutable:true, is_global:false, is_strict:false[ 17] NewFunction dst:reg5, shared_function_data_index:0- [ 21] InitializeLexicalBinding `i`, src:reg5- [ 2e] SetLexicalEnvironment environment:reg4- [ 30] Return value:reg5+ [ 1f] InitializeLexicalBinding `i`, src:reg5+ [ 2c] SetLexicalEnvironment environment:reg4+ [ 2e] Return value:reg5diff --git a/Tests/LibJS/Bytecode/expected/named-function-expression.txt b/Tests/LibJS/Bytecode/expected/named-function-expression.txtindex e50bb5c0b93..1225ace4116 100644--- a/Tests/LibJS/Bytecode/expected/named-function-expression.txt+++ b/Tests/LibJS/Bytecode/expected/named-function-expression.txt@@ -1,4 +1,4 @@-$1ee22cd3 named-function-expression.js:4:1+$7e89aeb1 named-function-expression.js:4:1Registers: 9Blocks: 4Constants:@@ -13,20 +13,20 @@ block0:[ d] CreateLexicalEnvironment dst:reg8, parent:reg4, capacity:1, is_catch_environment:false[ 19] CreateVariable `Oops`, is_immutable:true, is_global:false, is_strict:false[ 21] NewFunction dst:reg7, shared_function_data_index:0- [ 2b] InitializeLexicalBinding `Oops`, src:reg7- [ 38] SetLexicalEnvironment environment:reg4- [ 3a] JumpIf condition:reg6, true_target:block1, false_target:block2+ [ 29] InitializeLexicalBinding `Oops`, src:reg7+ [ 36] SetLexicalEnvironment environment:reg4+ [ 38] JumpIf condition:reg6, true_target:block1, false_target:block2block1:- [ 44] SetGlobal `Oops`, src:reg7- [ 4b] Jump target:block3+ [ 42] SetGlobal `Oops`, src:reg7+ [ 49] Jump target:block3block2:- [ 50] SetResolvedBinding environment:Null, `Oops`, src:reg7- [ 56] Jump target:block3+ [ 4e] SetResolvedBinding environment:Null, `Oops`, src:reg7+ [ 54] Jump target:block3block3:- [ 5b] Mov dst:reg5, src:reg7- [ 5e] GetGlobal value_feedback:0, dst:reg6, `Oops`- [ 67] GetById value_feedback:1, dst:reg5, base:reg6, `x`- [ 71] End value:reg5+ [ 59] Mov dst:reg5, src:reg7+ [ 5c] GetGlobal value_feedback:0, dst:reg6, `Oops`+ [ 65] GetById value_feedback:1, dst:reg5, base:reg6, `x`+ [ 6f] End value:reg5diff --git a/Tests/LibJS/Bytecode/expected/nested-function-decl-source-order.txt b/Tests/LibJS/Bytecode/expected/nested-function-decl-source-order.txtindex 9c322a4168b..31e0955b051 100644--- a/Tests/LibJS/Bytecode/expected/nested-function-decl-source-order.txt+++ b/Tests/LibJS/Bytecode/expected/nested-function-decl-source-order.txt@@ -18,7 +18,7 @@ block0:[ 47] End value:reg5-outer$b425af5c nested-function-decl-source-order.js:6:5+outer$6b28dfe8 nested-function-decl-source-order.js:6:5Registers: 11Blocks: 1Locals: alpha~0, beta~1, dup~2, gamma~3, delta~4@@ -29,22 +29,22 @@ block0:[ 0] Enter[ 1] Mov dst:alpha~0, src:Undefined[ 4] NewFunction dst:alpha~0, shared_function_data_index:0- [ e] Mov dst:beta~1, src:Undefined- [ 11] NewFunction dst:beta~1, shared_function_data_index:1- [ 1b] Mov dst:dup~2, src:Undefined- [ 1e] NewFunction dst:dup~2, shared_function_data_index:2- [ 28] Mov dst:gamma~3, src:Undefined- [ 2b] NewFunction dst:gamma~3, shared_function_data_index:3- [ 35] NewFunction dst:dup~2, shared_function_data_index:4- [ 3f] Mov dst:delta~4, src:Undefined- [ 42] NewFunction dst:delta~4, shared_function_data_index:5- [ 4c] Call value_feedback:0, call_feedback:0, dst:reg5, callee:alpha~0, this_value:Undefined- [ 55] Call value_feedback:1, call_feedback:1, dst:reg6, callee:beta~1, this_value:Undefined- [ 5e] Call value_feedback:2, call_feedback:2, dst:reg7, callee:gamma~3, this_value:Undefined- [ 67] Call value_feedback:3, call_feedback:3, dst:reg8, callee:delta~4, this_value:Undefined- [ 70] Call value_feedback:4, call_feedback:4, dst:reg9, callee:dup~2, this_value:Undefined- [ 79] NewArray dst:reg10, elements:[reg5, reg6, reg7, reg8, reg9]- [ 81] Return value:reg10+ [ c] Mov dst:beta~1, src:Undefined+ [ f] NewFunction dst:beta~1, shared_function_data_index:1+ [ 17] Mov dst:dup~2, src:Undefined+ [ 1a] NewFunction dst:dup~2, shared_function_data_index:2+ [ 22] Mov dst:gamma~3, src:Undefined+ [ 25] NewFunction dst:gamma~3, shared_function_data_index:3+ [ 2d] NewFunction dst:dup~2, shared_function_data_index:4+ [ 35] Mov dst:delta~4, src:Undefined+ [ 38] NewFunction dst:delta~4, shared_function_data_index:5+ [ 40] Call value_feedback:0, call_feedback:0, dst:reg5, callee:alpha~0, this_value:Undefined+ [ 49] Call value_feedback:1, call_feedback:1, dst:reg6, callee:beta~1, this_value:Undefined+ [ 52] Call value_feedback:2, call_feedback:2, dst:reg7, callee:gamma~3, this_value:Undefined+ [ 5b] Call value_feedback:3, call_feedback:3, dst:reg8, callee:delta~4, this_value:Undefined+ [ 64] Call value_feedback:4, call_feedback:4, dst:reg9, callee:dup~2, this_value:Undefined+ [ 6d] NewArray dst:reg10, elements:[reg5, reg6, reg7, reg8, reg9]+ [ 75] Return value:reg10alpha$6c0b33e4 nested-function-decl-source-order.js:6:24diff --git a/Tests/LibJS/Bytecode/expected/nested-member-base-identifier.txt b/Tests/LibJS/Bytecode/expected/nested-member-base-identifier.txtindex 0bb7b0193e3..2559e45b96e 100644--- a/Tests/LibJS/Bytecode/expected/nested-member-base-identifier.txt+++ b/Tests/LibJS/Bytecode/expected/nested-member-base-identifier.txt@@ -1,4 +1,4 @@-$ca87c7f9 nested-member-base-identifier.js:9:1+$0b38c43d nested-member-base-identifier.js:9:1Registers: 9Blocks: 1Constants:@@ -11,10 +11,10 @@ block0:[ 4] GetGlobal value_feedback:0, dst:reg6, `assign_nested`[ d] NewObject dst:reg7[ 11] InitObjectLiteralProperty object:reg7, `shader`, src:Int32(1), shape_cache_index:0, property_slot:0- [ 1f] CacheObjectShape object:reg7- [ 23] NewArray dst:reg8, elements:[reg7]- [ 27] Call value_feedback:1, call_feedback:0, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg8, Int32(1)]- [ 32] End value:reg5+ [ 1b] CacheObjectShape object:reg7+ [ 1f] NewArray dst:reg8, elements:[reg7]+ [ 23] Call value_feedback:1, call_feedback:0, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg8, Int32(1)]+ [ 2e] End value:reg5assign_nested$5173aed7 nested-member-base-identifier.js:6:8diff --git a/Tests/LibJS/Bytecode/expected/numeric-getter-no-lhs-name.txt b/Tests/LibJS/Bytecode/expected/numeric-getter-no-lhs-name.txtindex c4d03b22270..d6a53aa2e8a 100644--- a/Tests/LibJS/Bytecode/expected/numeric-getter-no-lhs-name.txt+++ b/Tests/LibJS/Bytecode/expected/numeric-getter-no-lhs-name.txt@@ -1,4 +1,4 @@-$1b0a3cdb numeric-getter-no-lhs-name.js:1:5+$7ab1beb9 numeric-getter-no-lhs-name.js:1:5Registers: 8Blocks: 1Constants:@@ -10,12 +10,12 @@ block0:[ 1] Mov dst:reg5, src:Undefined[ 4] NewObject dst:reg6[ 8] NewFunction dst:reg7, shared_function_data_index:0 (get 0), home_object:reg6- [ 12] PutByValue keyed_feedback:0, base:reg6, property:Int32(0), src:reg7, kind:Getter- [ 1b] SetGlobal `obj`, src:reg6- [ 22] GetGlobal value_feedback:0, dst:reg6, `obj`- [ 2b] GetByValue value_feedback:1, keyed_feedback:1, dst:reg6, base:reg6, property:Int32(0)- [ 35] Mov dst:reg5, src:reg6- [ 38] End value:reg5+ [ 10] PutByValue keyed_feedback:0, base:reg6, property:Int32(0), src:reg7, kind:Getter+ [ 19] SetGlobal `obj`, src:reg6+ [ 20] GetGlobal value_feedback:0, dst:reg6, `obj`+ [ 29] GetByValue value_feedback:1, keyed_feedback:1, dst:reg6, base:reg6, property:Int32(0)+ [ 33] Mov dst:reg5, src:reg6+ [ 36] End value:reg5get 0$1dbd230a numeric-getter-no-lhs-name.js:3:9diff --git a/Tests/LibJS/Bytecode/expected/object-destructuring-rebinds-source-variable.txt b/Tests/LibJS/Bytecode/expected/object-destructuring-rebinds-source-variable.txtindex b82ca7230be..644d7a0e695 100644--- a/Tests/LibJS/Bytecode/expected/object-destructuring-rebinds-source-variable.txt+++ b/Tests/LibJS/Bytecode/expected/object-destructuring-rebinds-source-variable.txt@@ -1,4 +1,4 @@-$99b9a749 object-destructuring-rebinds-source-variable.js:5:1+$d21ed05d object-destructuring-rebinds-source-variable.js:5:1Registers: 10Blocks: 1Constants:@@ -15,12 +15,12 @@ block0:[ 17] GetGlobal value_feedback:2, dst:reg8, `run`[ 20] NewObject dst:reg9[ 24] InitObjectLiteralProperty object:reg9, `first`, src:Int32(1), shape_cache_index:0, property_slot:0- [ 32] InitObjectLiteralProperty object:reg9, `second`, src:Int32(2), shape_cache_index:0, property_slot:1- [ 40] InitObjectLiteralProperty object:reg9, `third`, src:Int32(3), shape_cache_index:0, property_slot:2- [ 4e] CacheObjectShape object:reg9- [ 52] Call value_feedback:3, call_feedback:0, dst:reg8, callee:reg8, this_value:Undefined, arguments:[reg9]- [ 5c] Call value_feedback:4, call_feedback:1, dst:reg5, callee:reg7, this_value:reg6, arguments:[reg8]- [ 66] End value:reg5+ [ 2e] InitObjectLiteralProperty object:reg9, `second`, src:Int32(2), shape_cache_index:0, property_slot:1+ [ 38] InitObjectLiteralProperty object:reg9, `third`, src:Int32(3), shape_cache_index:0, property_slot:2+ [ 42] CacheObjectShape object:reg9+ [ 46] Call value_feedback:3, call_feedback:0, dst:reg8, callee:reg8, this_value:Undefined, arguments:[reg9]+ [ 50] Call value_feedback:4, call_feedback:1, dst:reg5, callee:reg7, this_value:reg6, arguments:[reg8]+ [ 5a] End value:reg5run$aca4c3b1 object-destructuring-rebinds-source-variable.js:2:5diff --git a/Tests/LibJS/Bytecode/expected/object-rest-computed-key.txt b/Tests/LibJS/Bytecode/expected/object-rest-computed-key.txtindex 31dc653ff87..10656d070d2 100644--- a/Tests/LibJS/Bytecode/expected/object-rest-computed-key.txt+++ b/Tests/LibJS/Bytecode/expected/object-rest-computed-key.txt@@ -1,4 +1,4 @@-$70be5e0c object-rest-computed-key.js:1:5+$ef5c6584 object-rest-computed-key.js:1:5Registers: 10Blocks: 1Constants:@@ -13,13 +13,13 @@ block0:[ 4] SetGlobal `a`, src:String("foo")[ b] NewObject dst:reg6[ f] InitObjectLiteralProperty object:reg6, `foo`, src:Int32(1), shape_cache_index:0, property_slot:0- [ 1d] InitObjectLiteralProperty object:reg6, `bar`, src:Int32(2), shape_cache_index:0, property_slot:1- [ 2b] CacheObjectShape object:reg6- [ 2f] ThrowIfNullish src:reg6- [ 31] GetGlobal value_feedback:0, dst:reg7, `a`- [ 3a] ToPrimitiveWithStringHint dst:reg8, value:reg7- [ 3d] GetByValue value_feedback:1, keyed_feedback:0, dst:reg9, base:reg6, property:reg8- [ 47] SetGlobal `b`, src:reg9- [ 4e] CopyObjectExcludingProperties dst:reg9, from_object:reg6, excluded_names_are_in_array:false, excluded_names:[reg8]- [ 54] SetGlobal `rest`, src:reg9- [ 5b] End value:reg5+ [ 19] InitObjectLiteralProperty object:reg6, `bar`, src:Int32(2), shape_cache_index:0, property_slot:1+ [ 23] CacheObjectShape object:reg6+ [ 27] ThrowIfNullish src:reg6+ [ 29] GetGlobal value_feedback:0, dst:reg7, `a`+ [ 32] ToPrimitiveWithStringHint dst:reg8, value:reg7+ [ 35] GetByValue value_feedback:1, keyed_feedback:0, dst:reg9, base:reg6, property:reg8+ [ 3f] SetGlobal `b`, src:reg9+ [ 46] CopyObjectExcludingProperties dst:reg9, from_object:reg6, excluded_names_are_in_array:false, excluded_names:[reg8]+ [ 4c] SetGlobal `rest`, src:reg9+ [ 53] End value:reg5diff --git a/Tests/LibJS/Bytecode/expected/optional-chain-base-identifier.txt b/Tests/LibJS/Bytecode/expected/optional-chain-base-identifier.txtindex fe0123af8df..a0aa7220cd6 100644--- a/Tests/LibJS/Bytecode/expected/optional-chain-base-identifier.txt+++ b/Tests/LibJS/Bytecode/expected/optional-chain-base-identifier.txt@@ -1,4 +1,4 @@-$d8b1b31a optional-chain-base-identifier.js:1:5+$574fba92 optional-chain-base-identifier.js:1:5Registers: 8Blocks: 4Constants:@@ -11,21 +11,21 @@ block0:[ 4] NewObject dst:reg6[ 8] NewObject dst:reg7[ c] InitObjectLiteralProperty object:reg7, `b`, src:Int32(44), shape_cache_index:1, property_slot:0- [ 1a] CacheObjectShape object:reg7- [ 1e] InitObjectLiteralProperty object:reg6, `a`, src:reg7, shape_cache_index:0, property_slot:0- [ 2c] CacheObjectShape object:reg6- [ 30] SetGlobal `obj`, src:reg6- [ 37] GetGlobal value_feedback:0, dst:reg6, `obj`- [ 40] GetById value_feedback:1, dst:reg6, base:reg6, `a`- [ 4a] JumpNullish condition:reg6, true_target:block2, false_target:block1+ [ 16] CacheObjectShape object:reg7+ [ 1a] InitObjectLiteralProperty object:reg6, `a`, src:reg7, shape_cache_index:0, property_slot:0+ [ 24] CacheObjectShape object:reg6+ [ 28] SetGlobal `obj`, src:reg6+ [ 2f] GetGlobal value_feedback:0, dst:reg6, `obj`+ [ 38] GetById value_feedback:1, dst:reg6, base:reg6, `a`+ [ 42] JumpNullish condition:reg6, true_target:block2, false_target:block1block1:- [ 54] GetById value_feedback:2, dst:reg6, base:reg6, `b`- [ 5e] Jump target:block3+ [ 4c] GetById value_feedback:2, dst:reg6, base:reg6, `b`+ [ 56] Jump target:block3block2:- [ 63] Mov dst:reg6, src:Undefined+ [ 5b] Mov dst:reg6, src:Undefinedblock3:- [ 66] Mov dst:reg5, src:reg6- [ 69] End value:reg5+ [ 5e] Mov dst:reg5, src:reg6+ [ 61] End value:reg5diff --git a/Tests/LibJS/Bytecode/expected/parameter-createvariable-order.txt b/Tests/LibJS/Bytecode/expected/parameter-createvariable-order.txtindex 881b7433ac6..1fa81a188e2 100644--- a/Tests/LibJS/Bytecode/expected/parameter-createvariable-order.txt+++ b/Tests/LibJS/Bytecode/expected/parameter-createvariable-order.txt@@ -15,7 +15,7 @@ block0:[ 19] End value:reg5-f$ff772bb8 parameter-createvariable-order.js:2:9+f$5f1ead96 parameter-createvariable-order.js:2:9Registers: 6Blocks: 1Locals: inner~0@@ -32,8 +32,8 @@ block0:[ 33] InitializeLexicalBinding `c`, src:arg2[ 40] Mov dst:inner~0, src:Undefined[ 43] NewFunction dst:inner~0, shared_function_data_index:0 (inner)- [ 4d] Call value_feedback:0, call_feedback:0, dst:reg5, callee:inner~0, this_value:Undefined- [ 56] Return value:reg5+ [ 4b] Call value_feedback:0, call_feedback:0, dst:reg5, callee:inner~0, this_value:Undefined+ [ 54] Return value:reg5inner$558f3bdd parameter-createvariable-order.js:3:9diff --git a/Tests/LibJS/Bytecode/expected/parameter-environment-capacity.txt b/Tests/LibJS/Bytecode/expected/parameter-environment-capacity.txtindex 4eef611fc0d..c5c8f73bac6 100644--- a/Tests/LibJS/Bytecode/expected/parameter-environment-capacity.txt+++ b/Tests/LibJS/Bytecode/expected/parameter-environment-capacity.txt@@ -23,7 +23,7 @@ block0:[ 69] End value:reg5-sloppy$6a7b4937 parameter-environment-capacity.js:6:17+sloppy$8971ced1 parameter-environment-capacity.js:6:17Registers: 6Blocks: 3Constants:@@ -41,7 +41,7 @@ block1:block2:[ 1b] InitializeLexicalBinding `a`, src:arg0[ 28] NewFunction dst:reg5, shared_function_data_index:0- [ 32] Return value:reg5+ [ 30] Return value:reg5Strict$3395ae05@@ -55,7 +55,7 @@ block0:[ 1] End value:Undefined-method$3610faf2 parameter-environment-capacity.js:11:12+method$95b87cd0 parameter-environment-capacity.js:11:12Registers: 7Blocks: 3Constants:@@ -82,4 +82,4 @@ block2:[ 58] StrictlyEquals arith_feedback:0, dst:reg6, lhs:reg6, rhs:String("a")[ 5e] InitializeLexicalBinding `active`, src:reg6[ 6b] NewFunction dst:reg6, shared_function_data_index:0- [ 75] Return value:reg6+ [ 73] Return value:reg6diff --git a/Tests/LibJS/Bytecode/expected/resolve-this-caching.txt b/Tests/LibJS/Bytecode/expected/resolve-this-caching.txtindex 5c4a6a40718..03854e11962 100644--- a/Tests/LibJS/Bytecode/expected/resolve-this-caching.txt+++ b/Tests/LibJS/Bytecode/expected/resolve-this-caching.txt@@ -12,7 +12,7 @@ block0:[ 16] End value:reg5-foo$746baa32 resolve-this-caching.js:2:5+foo$d4132c10 resolve-this-caching.js:2:5Registers: 6Blocks: 1Constants:@@ -21,8 +21,8 @@ foo$746baa32 resolve-this-caching.js:2:5block0:[ 0] Enter[ 1] NewFunction dst:reg5, shared_function_data_index:0- [ b] Call value_feedback:0, call_feedback:0, dst:reg5, callee:reg5, this_value:Undefined- [ 14] Return value:reg5+ [ 9] Call value_feedback:0, call_feedback:0, dst:reg5, callee:reg5, this_value:Undefined+ [ 12] Return value:reg5$bdabf504 resolve-this-caching.js:2:13diff --git a/Tests/LibJS/Bytecode/expected/super-method-call-order.txt b/Tests/LibJS/Bytecode/expected/super-method-call-order.txtindex 51b1b264ec9..03d4bde21d0 100644--- a/Tests/LibJS/Bytecode/expected/super-method-call-order.txt+++ b/Tests/LibJS/Bytecode/expected/super-method-call-order.txt@@ -1,4 +1,4 @@-$083fdf14 super-method-call-order.js:1:5+$8156046c super-method-call-order.js:1:5Registers: 8Blocks: 1Constants:@@ -9,27 +9,27 @@ block0:[ 1] Mov dst:reg5, src:Undefined[ 4] NewObject dst:reg6[ 8] NewFunction dst:reg7, shared_function_data_index:0 (m), home_object:reg6- [ 12] PutById base:reg6, `m`, src:reg7, kind:Own- [ 1b] SetGlobal `proto`, src:reg6- [ 22] NewObject dst:reg6- [ 26] GetGlobal value_feedback:0, dst:reg7, `proto`- [ 2f] PutById base:reg6, `__proto__`, src:reg7, kind:Prototype- [ 38] NewFunction dst:reg7, shared_function_data_index:1 (test), home_object:reg6- [ 42] PutById base:reg6, `test`, src:reg7, kind:Own- [ 4b] NewFunction dst:reg7, shared_function_data_index:2 (get x), home_object:reg6- [ 55] PutById base:reg6, `x`, src:reg7, kind:Getter- [ 5e] NewFunction dst:reg7, shared_function_data_index:3 (test2), home_object:reg6- [ 68] PutById base:reg6, `test2`, src:reg7, kind:Own- [ 71] SetGlobal `obj`, src:reg6- [ 78] GetGlobal value_feedback:1, dst:reg6, `obj`- [ 81] GetById value_feedback:2, dst:reg7, base:reg6, `test`- [ 8b] Call value_feedback:3, call_feedback:0, dst:reg5, callee:reg7, this_value:reg6- [ 94] GetGlobal value_feedback:4, dst:reg6, `obj`- [ 9d] GetById value_feedback:5, dst:reg5, base:reg6, `x`- [ a7] GetGlobal value_feedback:6, dst:reg6, `obj`- [ b0] GetById value_feedback:7, dst:reg7, base:reg6, `test2`- [ ba] Call value_feedback:8, call_feedback:1, dst:reg5, callee:reg7, this_value:reg6- [ c3] End value:reg5+ [ 10] PutById base:reg6, `m`, src:reg7, kind:Own+ [ 19] SetGlobal `proto`, src:reg6+ [ 20] NewObject dst:reg6+ [ 24] GetGlobal value_feedback:0, dst:reg7, `proto`+ [ 2d] PutById base:reg6, `__proto__`, src:reg7, kind:Prototype+ [ 36] NewFunction dst:reg7, shared_function_data_index:1 (test), home_object:reg6+ [ 3e] PutById base:reg6, `test`, src:reg7, kind:Own+ [ 47] NewFunction dst:reg7, shared_function_data_index:2 (get x), home_object:reg6+ [ 4f] PutById base:reg6, `x`, src:reg7, kind:Getter+ [ 58] NewFunction dst:reg7, shared_function_data_index:3 (test2), home_object:reg6+ [ 60] PutById base:reg6, `test2`, src:reg7, kind:Own+ [ 69] SetGlobal `obj`, src:reg6+ [ 70] GetGlobal value_feedback:1, dst:reg6, `obj`+ [ 79] GetById value_feedback:2, dst:reg7, base:reg6, `test`+ [ 83] Call value_feedback:3, call_feedback:0, dst:reg5, callee:reg7, this_value:reg6+ [ 8c] GetGlobal value_feedback:4, dst:reg6, `obj`+ [ 95] GetById value_feedback:5, dst:reg5, base:reg6, `x`+ [ 9f] GetGlobal value_feedback:6, dst:reg6, `obj`+ [ a8] GetById value_feedback:7, dst:reg7, base:reg6, `test2`+ [ b2] Call value_feedback:8, call_feedback:1, dst:reg5, callee:reg7, this_value:reg6+ [ bb] End value:reg5test$c574adfd super-method-call-order.js:5:9diff --git a/Tests/LibJS/Bytecode/expected/switch-scoping.txt b/Tests/LibJS/Bytecode/expected/switch-scoping.txtindex 51eed8975e6..c633ec83435 100644--- a/Tests/LibJS/Bytecode/expected/switch-scoping.txt+++ b/Tests/LibJS/Bytecode/expected/switch-scoping.txt@@ -22,7 +22,7 @@ block0:[ 64] End value:reg5-switchWithBlockDecl$a49636dd switch-scoping.js:2:9+switchWithBlockDecl$63e53a99 switch-scoping.js:2:9Registers: 8Blocks: 6Locals: result~0@@ -52,16 +52,16 @@ block2:block3:[ 44] InitializeLexicalBinding `a`, src:String("one")[ 51] NewFunction dst:result~0, shared_function_data_index:0 (result)- [ 5b] Jump target:block5+ [ 59] Jump target:block5block4:- [ 60] InitializeLexicalBinding `b`, src:String("two")- [ 6d] NewFunction dst:result~0, shared_function_data_index:1 (result)+ [ 5e] InitializeLexicalBinding `b`, src:String("two")+ [ 6b] NewFunction dst:result~0, shared_function_data_index:1 (result)block5:- [ 77] SetLexicalEnvironment environment:reg4- [ 79] Call value_feedback:0, call_feedback:0, dst:reg5, callee:result~0, this_value:Undefined- [ 82] Return value:reg5+ [ 73] SetLexicalEnvironment environment:reg4+ [ 75] Call value_feedback:0, call_feedback:0, dst:reg5, callee:result~0, this_value:Undefined+ [ 7e] Return value:reg5result$e15525de switch-scoping.js:6:22diff --git a/Tests/LibJS/Bytecode/expected/switch-with-block-scope-return.txt b/Tests/LibJS/Bytecode/expected/switch-with-block-scope-return.txtindex f20315a927a..86e50e39055 100644--- a/Tests/LibJS/Bytecode/expected/switch-with-block-scope-return.txt+++ b/Tests/LibJS/Bytecode/expected/switch-with-block-scope-return.txt@@ -13,7 +13,7 @@ block0:[ 17] End value:reg5-f$10e9a7d1 switch-with-block-scope-return.js:2:13+f$f1f32237 switch-with-block-scope-return.js:2:13Registers: 8Blocks: 6Constants:@@ -45,10 +45,10 @@ block3:block4:[ 3d] InitializeLexicalBinding `y`, src:String("two")[ 4a] NewFunction dst:reg7, shared_function_data_index:0- [ 54] Call value_feedback:0, call_feedback:0, dst:reg7, callee:reg7, this_value:Undefined- [ 5d] SetLexicalEnvironment environment:reg4- [ 5f] Return value:reg7+ [ 52] Call value_feedback:0, call_feedback:0, dst:reg7, callee:reg7, this_value:Undefined+ [ 5b] SetLexicalEnvironment environment:reg4+ [ 5d] Return value:reg7block5:- [ 61] SetLexicalEnvironment environment:reg4- [ 63] Return value:String("other")+ [ 5f] SetLexicalEnvironment environment:reg4+ [ 61] Return value:String("other")diff --git a/Tests/LibJS/Bytecode/expected/tagged-template-base-identifier.txt b/Tests/LibJS/Bytecode/expected/tagged-template-base-identifier.txtindex 0777fbc7c3a..854b220e3db 100644--- a/Tests/LibJS/Bytecode/expected/tagged-template-base-identifier.txt+++ b/Tests/LibJS/Bytecode/expected/tagged-template-base-identifier.txt@@ -1,4 +1,4 @@-$3f88a495 tagged-template-base-identifier.js:1:5+$64070c4f tagged-template-base-identifier.js:1:5Registers: 9Blocks: 1Constants:@@ -10,14 +10,14 @@ block0:[ 1] Mov dst:reg5, src:Undefined[ 4] NewObject dst:reg6[ 8] NewFunction dst:reg7, shared_function_data_index:0 (f)- [ 12] InitObjectLiteralProperty object:reg6, `f`, src:reg7, shape_cache_index:0, property_slot:0- [ 20] CacheObjectShape object:reg6- [ 24] SetGlobal `obj`, src:reg6- [ 2b] GetGlobal value_feedback:0, dst:reg6, `obj`- [ 34] GetById value_feedback:1, dst:reg7, base:reg6, `f`- [ 3e] GetTemplateObject dst:reg8, strings_are_in_array:false, strings:[String(""), String("")]- [ 48] Call value_feedback:2, call_feedback:0, dst:reg5, callee:reg7, this_value:reg6, arguments:[reg8]- [ 52] End value:reg5+ [ 10] InitObjectLiteralProperty object:reg6, `f`, src:reg7, shape_cache_index:0, property_slot:0+ [ 1a] CacheObjectShape object:reg6+ [ 1e] SetGlobal `obj`, src:reg6+ [ 25] GetGlobal value_feedback:0, dst:reg6, `obj`+ [ 2e] GetById value_feedback:1, dst:reg7, base:reg6, `f`+ [ 38] GetTemplateObject dst:reg8, strings_are_in_array:false, strings:[String(""), String("")]+ [ 42] Call value_feedback:2, call_feedback:0, dst:reg5, callee:reg7, this_value:reg6, arguments:[reg8]+ [ 4c] End value:reg5f$bdc39382 tagged-template-base-identifier.js:3:9diff --git a/Tests/LibJS/Bytecode/expected/tdz-reset-in-loop.txt b/Tests/LibJS/Bytecode/expected/tdz-reset-in-loop.txtindex d83028c538d..0b0af2fc8f4 100644--- a/Tests/LibJS/Bytecode/expected/tdz-reset-in-loop.txt+++ b/Tests/LibJS/Bytecode/expected/tdz-reset-in-loop.txt@@ -16,7 +16,7 @@ block0:[ 30] End value:reg5-checked$eba82271 tdz-reset-in-loop.js:5:10+checked$ccb19cd7 tdz-reset-in-loop.js:5:10Registers: 8Blocks: 4Locals: i~0, value~1, plain~2@@ -34,21 +34,21 @@ block1:[ 9] Mov dst:value~1, src:<Empty>[ c] GetByValue value_feedback:0, keyed_feedback:0, dst:reg5, base:arg0, property:i~0[ 16] NewFunction dst:reg6, shared_function_data_index:0- [ 20] ThrowIfTDZ src:value~1- [ 22] Typeof dst:reg7, src:value~1- [ 25] Call value_feedback:1, call_feedback:0, dst:reg5, callee:reg5, this_value:arg0, arguments:[reg6, reg7]- [ 30] Mov dst:value~1, src:i~0- [ 33] AddRhsInt32 arith_feedback:0, dst:plain~2, lhs:value~1, rhs:1- [ 3c] GetByValue value_feedback:2, keyed_feedback:1, dst:reg5, base:arg0, property:i~0- [ 46] Call value_feedback:3, call_feedback:1, dst:reg5, callee:reg5, this_value:arg0, arguments:[plain~2]- [ 50] Increment arith_feedback:1, dst:i~0+ [ 1e] ThrowIfTDZ src:value~1+ [ 20] Typeof dst:reg7, src:value~1+ [ 23] Call value_feedback:1, call_feedback:0, dst:reg5, callee:reg5, this_value:arg0, arguments:[reg6, reg7]+ [ 2e] Mov dst:value~1, src:i~0+ [ 31] AddRhsInt32 arith_feedback:0, dst:plain~2, lhs:value~1, rhs:1+ [ 3a] GetByValue value_feedback:2, keyed_feedback:1, dst:reg5, base:arg0, property:i~0+ [ 44] Call value_feedback:3, call_feedback:1, dst:reg5, callee:reg5, this_value:arg0, arguments:[plain~2]+ [ 4e] Increment arith_feedback:1, dst:i~0block2:- [ 54] GetLength value_feedback:4, keyed_feedback:2, dst:reg5, base:arg0- [ 5d] JumpLessThanLoop arith_feedback:2, lhs:i~0, rhs:reg5, true_target:block1, false_target:block3+ [ 52] GetLength value_feedback:4, keyed_feedback:2, dst:reg5, base:arg0+ [ 5b] JumpLessThanLoop arith_feedback:2, lhs:i~0, rhs:reg5, true_target:block1, false_target:block3block3:- [ 6a] End value:Undefined+ [ 68] End value:Undefinednested$13eb2c16 tdz-reset-in-loop.js:14:5diff --git a/Tests/LibJS/Bytecode/expected/using-declaration-non-local-env.txt b/Tests/LibJS/Bytecode/expected/using-declaration-non-local-env.txtindex f8571b41670..21cb8fae578 100644--- a/Tests/LibJS/Bytecode/expected/using-declaration-non-local-env.txt+++ b/Tests/LibJS/Bytecode/expected/using-declaration-non-local-env.txt@@ -1,4 +1,4 @@-$bf0181c6 using-declaration-non-local-env.js:1:1+$1ea903a4 using-declaration-non-local-env.js:1:1Registers: 7Blocks: 4Locals: e~0@@ -13,24 +13,24 @@ block0:block1:[ 7] NewFunction dst:reg6, shared_function_data_index:0- [ 11] Call value_feedback:0, call_feedback:0, dst:reg5, callee:reg6, this_value:Undefined- [ 1a] Jump target:block3+ [ f] Call value_feedback:0, call_feedback:0, dst:reg5, callee:reg6, this_value:Undefined+ [ 18] Jump target:block3block2:- [ 1f] Catch value_feedback:1, dst:reg6- [ 23] Mov dst:reg5, src:Undefined- [ 26] Mov dst:e~0, src:<Empty>- [ 29] Mov dst:e~0, src:reg6- [ 2c] Jump target:block3+ [ 1d] Catch value_feedback:1, dst:reg6+ [ 21] Mov dst:reg5, src:Undefined+ [ 24] Mov dst:e~0, src:<Empty>+ [ 27] Mov dst:e~0, src:reg6+ [ 2a] Jump target:block3block3:- [ 31] End value:reg5+ [ 2f] End value:reg5Exception handlers:- [ 7 .. 1f] => handler block2+ [ 7 .. 1d] => handler block2-$5dade768 using-declaration-non-local-env.js:1:19+$fe06658a using-declaration-non-local-env.js:1:19Registers: 10Blocks: 6Constants:@@ -50,25 +50,25 @@ block1:[ 1d] AddDisposableResource stack:reg6, value:reg9, hint:0[ 24] InitializeLexicalBinding `x`, src:reg9[ 31] NewFunction dst:reg9, shared_function_data_index:0- [ 3b] Call value_feedback:0, call_feedback:0, dst:reg9, callee:reg9, this_value:Undefined- [ 44] Mov dst:reg7, src:Int32(0)- [ 47] Jump target:block3+ [ 39] Call value_feedback:0, call_feedback:0, dst:reg9, callee:reg9, this_value:Undefined+ [ 42] Mov dst:reg7, src:Int32(0)+ [ 45] Jump target:block3block2:- [ 4c] Catch value_feedback:1, dst:reg8- [ 50] SetLexicalEnvironment environment:reg5- [ 52] Mov dst:reg7, src:Int32(1)+ [ 4a] Catch value_feedback:1, dst:reg8+ [ 4e] SetLexicalEnvironment environment:reg5+ [ 50] Mov dst:reg7, src:Int32(1)block3:- [ 55] DisposeResources stack:reg6, completion_type:reg7, completion_value:reg8- [ 59] JumpStrictlyEqualsRhsInt32 arith_feedback:0, lhs:reg7, rhs:0, true_target:block5, false_target:block4+ [ 53] DisposeResources stack:reg6, completion_type:reg7, completion_value:reg8+ [ 57] JumpStrictlyEqualsRhsInt32 arith_feedback:0, lhs:reg7, rhs:0, true_target:block5, false_target:block4block4:- [ 69] Throw src:reg8+ [ 67] Throw src:reg8block5:- [ 6b] SetLexicalEnvironment environment:reg4- [ 6d] End value:Undefined+ [ 69] SetLexicalEnvironment environment:reg4+ [ 6b] End value:UndefinedException handlers:- [ 19 .. 4c] => handler block2+ [ 19 .. 4a] => handler block2diff --git a/Tests/LibJS/Bytecode/expected/var-binding-access.txt b/Tests/LibJS/Bytecode/expected/var-binding-access.txtindex 4669fb2994d..d5d15c7402e 100644--- a/Tests/LibJS/Bytecode/expected/var-binding-access.txt+++ b/Tests/LibJS/Bytecode/expected/var-binding-access.txt@@ -14,7 +14,7 @@ block0:[ 28] End value:reg5-var_access$c494e0d1 var-binding-access.js:5:9+var_access$64ed5ef3 var-binding-access.js:5:9Registers: 6Blocks: 1Constants:@@ -27,11 +27,11 @@ block0:[ 9] InitializeVariableBinding `x`, src:Undefined[ 16] SetLexicalBinding `x`, src:Int32(1)[ 23] NewFunction dst:reg5, shared_function_data_index:0- [ 2d] GetInitializedBinding value_feedback:0, dst:reg5, `x`- [ 3c] Return value:reg5+ [ 2b] GetInitializedBinding value_feedback:0, dst:reg5, `x`+ [ 3a] Return value:reg5-let_access$ff90badd var-binding-access.js:14:9+let_access$e09a3543 var-binding-access.js:14:9Registers: 6Blocks: 1Constants:@@ -42,5 +42,5 @@ block0:[ 1] CreateVariable `x`, is_immutable:false, is_global:false, is_strict:false[ 9] InitializeLexicalBinding `x`, src:Int32(1)[ 16] NewFunction dst:reg5, shared_function_data_index:0- [ 20] GetBinding value_feedback:0, dst:reg5, `x`- [ 2f] Return value:reg5+ [ 1e] GetBinding value_feedback:0, dst:reg5, `x`+ [ 2d] Return value:reg5diff --git a/Tests/LibJS/Bytecode/expected/with-return.txt b/Tests/LibJS/Bytecode/expected/with-return.txtindex 6d68588a10b..cbb9558f1e4 100644--- a/Tests/LibJS/Bytecode/expected/with-return.txt+++ b/Tests/LibJS/Bytecode/expected/with-return.txt@@ -1,4 +1,4 @@-$bba013c1 with-return.js:10:1+$fc511005 with-return.js:10:1Registers: 8Blocks: 1Constants:@@ -11,9 +11,9 @@ block0:[ 4] GetGlobal value_feedback:0, dst:reg6, `with_return`[ d] NewObject dst:reg7[ 11] InitObjectLiteralProperty object:reg7, `x`, src:Int32(42), shape_cache_index:0, property_slot:0- [ 1f] CacheObjectShape object:reg7- [ 23] Call value_feedback:1, call_feedback:0, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7]- [ 2d] End value:reg5+ [ 1b] CacheObjectShape object:reg7+ [ 1f] Call value_feedback:1, call_feedback:0, dst:reg5, callee:reg6, this_value:Undefined, arguments:[reg7]+ [ 29] End value:reg5with_return$8eb08379 with-return.js:5:5diff --git a/Tests/LibJS/Bytecode/expected/with-statement.txt b/Tests/LibJS/Bytecode/expected/with-statement.txtindex f1fcc79d45f..d67c63fc836 100644--- a/Tests/LibJS/Bytecode/expected/with-statement.txt+++ b/Tests/LibJS/Bytecode/expected/with-statement.txt@@ -12,7 +12,7 @@ block0:[ 16] End value:reg5-withBlock$fd12279c with-statement.js:2:9+withBlock$3aff32d0 with-statement.js:2:9Registers: 9Blocks: 1Locals: obj~0@@ -25,15 +25,15 @@ block0:[ 1] GetLexicalEnvironment dst:reg4[ 3] NewObject dst:reg5[ 7] InitObjectLiteralProperty object:reg5, `x`, src:Int32(42), shape_cache_index:0, property_slot:0- [ 15] CacheObjectShape object:reg5- [ 19] Mov dst:obj~0, src:reg5- [ 1c] EnterObjectEnvironment dst:reg5, object:obj~0- [ 1f] DynamicGetBinding value_feedback:0, dst:reg6, `console`- [ 28] GetById value_feedback:1, dst:reg7, base:reg6, `log`- [ 32] DynamicGetBinding value_feedback:2, dst:reg8, `x`- [ 3b] Call value_feedback:3, call_feedback:0, dst:reg6, callee:reg7, this_value:reg6, arguments:[reg8]- [ 45] SetLexicalEnvironment environment:reg4- [ 47] End value:Undefined+ [ 11] CacheObjectShape object:reg5+ [ 15] Mov dst:obj~0, src:reg5+ [ 18] EnterObjectEnvironment dst:reg5, object:obj~0+ [ 1b] DynamicGetBinding value_feedback:0, dst:reg6, `console`+ [ 24] GetById value_feedback:1, dst:reg7, base:reg6, `log`+ [ 2e] DynamicGetBinding value_feedback:2, dst:reg8, `x`+ [ 37] Call value_feedback:3, call_feedback:0, dst:reg6, callee:reg7, this_value:reg6, arguments:[reg8]+ [ 41] SetLexicalEnvironment environment:reg4+ [ 43] End value:Undefined42diff --git a/Tests/LibJS/Runtime/many-functions-and-literal-properties.js b/Tests/LibJS/Runtime/many-functions-and-literal-properties.jsnew file mode 100644index 00000000000..d28a49df364--- /dev/null+++ b/Tests/LibJS/Runtime/many-functions-and-literal-properties.js@@ -0,0 +1,52 @@+// Bytecode holds the index of a function and the slot of an object literal property in 16 bits. Past that, the code+// takes another way, which must give the same results.++test("functions of an executable past the first 65536", () => {+ const count = 66000;+ let source = "return [";+ for (let i = 0; i < count; ++i) source += `() => ${i},`;+ source +=+ "function named() { return 'named'; }, { method() { return super.toString === Object.prototype.toString; } }];";+ const functions = new Function(source)();+ expect(functions).toHaveLength(count + 2);+ for (const i of [0, 1, 65534, 65535, 65536, 65537, count - 1]) {+ expect(functions[i]()).toBe(i);+ }+ expect(functions[count]()).toBe("named");+ expect(functions[count].name).toBe("named");+ expect(functions[count + 1].method()).toBeTrue();+});++test("properties of an object literal past the first 65536", () => {+ const count = 66000;+ let source = "return {";+ for (let i = 0; i < count; ++i) source += `p${i}: ${i},`;+ source += "};";+ const make = new Function(source);+ // NB: The second and later literals start out with the shape the first one ended up with.+ for (let run = 0; run < 3; ++run) {+ const object = make();+ const keys = Object.keys(object);+ expect(keys).toHaveLength(count);+ for (const i of [0, 1, 65534, 65535, 65536, 65537, count - 1]) {+ expect(keys[i]).toBe(`p${i}`);+ expect(object[`p${i}`]).toBe(i);+ }+ }+});++test("object literals of an executable past the last shape cache slot", () => {+ const count = 66000;+ let source = "const objects = [];";+ for (let i = 0; i < count; ++i) source += `objects.push({ a: ${i}, b: ${i + 1} });`;+ source += "return objects;";+ const make = new Function(source);+ for (let run = 0; run < 3; ++run) {+ const objects = make();+ for (const i of [0, 65534, 65535, 65536, count - 1]) {+ expect(Object.keys(objects[i])).toEqual(["a", "b"]);+ expect(objects[i].a).toBe(i);+ expect(objects[i].b).toBe(i + 1);+ }+ }+});