mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 22:02:44 +00:00 
			
		
		
		
	LibJS/Bytecode: Remove the PushDeclarativeEnvironment instruction
This commit is contained in:
		
							parent
							
								
									c810d4784e
								
							
						
					
					
						commit
						dd466ec83a
					
				
					 3 changed files with 0 additions and 39 deletions
				
			
		|  | @ -89,7 +89,6 @@ | ||||||
|     O(NewString)                       \ |     O(NewString)                       \ | ||||||
|     O(NewTypeError)                    \ |     O(NewTypeError)                    \ | ||||||
|     O(Not)                             \ |     O(Not)                             \ | ||||||
|     O(PushDeclarativeEnvironment)      \ |  | ||||||
|     O(PutById)                         \ |     O(PutById)                         \ | ||||||
|     O(PutByIdWithThis)                 \ |     O(PutByIdWithThis)                 \ | ||||||
|     O(PutByValue)                      \ |     O(PutByValue)                      \ | ||||||
|  |  | ||||||
|  | @ -1038,14 +1038,6 @@ ThrowCompletionOr<void> ContinuePendingUnwind::execute_impl(Bytecode::Interprete | ||||||
|     __builtin_unreachable(); |     __builtin_unreachable(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| ThrowCompletionOr<void> PushDeclarativeEnvironment::execute_impl(Bytecode::Interpreter& interpreter) const |  | ||||||
| { |  | ||||||
|     auto environment = interpreter.vm().heap().allocate_without_realm<DeclarativeEnvironment>(interpreter.vm().lexical_environment()); |  | ||||||
|     interpreter.vm().running_execution_context().lexical_environment = environment; |  | ||||||
|     interpreter.vm().running_execution_context().variable_environment = environment; |  | ||||||
|     return {}; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| ThrowCompletionOr<void> Yield::execute_impl(Bytecode::Interpreter& interpreter) const | ThrowCompletionOr<void> Yield::execute_impl(Bytecode::Interpreter& interpreter) const | ||||||
| { | { | ||||||
|     auto yielded_value = interpreter.accumulator().value_or(js_undefined()); |     auto yielded_value = interpreter.accumulator().value_or(js_undefined()); | ||||||
|  | @ -1592,21 +1584,6 @@ DeprecatedString ContinuePendingUnwind::to_deprecated_string_impl(Bytecode::Exec | ||||||
|     return DeprecatedString::formatted("ContinuePendingUnwind resume:{}", m_resume_target); |     return DeprecatedString::formatted("ContinuePendingUnwind resume:{}", m_resume_target); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| DeprecatedString PushDeclarativeEnvironment::to_deprecated_string_impl(Bytecode::Executable const& executable) const |  | ||||||
| { |  | ||||||
|     StringBuilder builder; |  | ||||||
|     builder.append("PushDeclarativeEnvironment"sv); |  | ||||||
|     if (!m_variables.is_empty()) { |  | ||||||
|         builder.append(" {"sv); |  | ||||||
|         Vector<DeprecatedString> names; |  | ||||||
|         for (auto& it : m_variables) |  | ||||||
|             names.append(executable.get_string(it.key)); |  | ||||||
|         builder.append('}'); |  | ||||||
|         builder.join(", "sv, names); |  | ||||||
|     } |  | ||||||
|     return builder.to_deprecated_string(); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| DeprecatedString Yield::to_deprecated_string_impl(Bytecode::Executable const&) const | DeprecatedString Yield::to_deprecated_string_impl(Bytecode::Executable const&) const | ||||||
| { | { | ||||||
|     if (m_continuation_label.has_value()) |     if (m_continuation_label.has_value()) | ||||||
|  |  | ||||||
|  | @ -1319,21 +1319,6 @@ private: | ||||||
|     Label m_continuation_label; |     Label m_continuation_label; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| class PushDeclarativeEnvironment final : public Instruction { |  | ||||||
| public: |  | ||||||
|     explicit PushDeclarativeEnvironment(HashMap<u32, Variable> variables) |  | ||||||
|         : Instruction(Type::PushDeclarativeEnvironment, sizeof(*this)) |  | ||||||
|         , m_variables(move(variables)) |  | ||||||
|     { |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     ThrowCompletionOr<void> execute_impl(Bytecode::Interpreter&) const; |  | ||||||
|     DeprecatedString to_deprecated_string_impl(Bytecode::Executable const&) const; |  | ||||||
| 
 |  | ||||||
| private: |  | ||||||
|     HashMap<u32, Variable> m_variables; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| class GetIterator final : public Instruction { | class GetIterator final : public Instruction { | ||||||
| public: | public: | ||||||
|     GetIterator(IteratorHint hint = IteratorHint::Sync) |     GetIterator(IteratorHint hint = IteratorHint::Sync) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Simon Wanner
						Simon Wanner