mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 13:02:45 +00:00 
			
		
		
		
	 1c43442be4
			
		
	
	
		1c43442be4
		
	
	
	
	
		
			
			Taking a big step towards a world of multiple global object, this patch adds a new JS::VM object that houses the JS::Heap. This means that the Heap moves out of Interpreter, and the same Heap can now be used by multiple Interpreters, and can also outlive them. The VM keeps a stack of Interpreter pointers. We push/pop on this stack when entering/exiting execution with a given Interpreter. This allows us to make this change without disturbing too much of the existing code. There is still a 1-to-1 relationship between Interpreter and the global object. This will change in the future. Ultimately, the goal here is to make Interpreter a transient object that only needs to exist while you execute some code. Getting there will take a lot more work though. :^) Note that in LibWeb, the global JS::VM is called main_thread_vm(), to distinguish it from future worker VM's.
		
			
				
	
	
		
			81 lines
		
	
	
	
		
			2.2 KiB
		
	
	
	
		
			CMake
		
	
	
	
	
	
			
		
		
	
	
			81 lines
		
	
	
	
		
			2.2 KiB
		
	
	
	
		
			CMake
		
	
	
	
	
	
| set(SOURCES
 | |
|     AST.cpp
 | |
|     Console.cpp
 | |
|     Heap/Handle.cpp
 | |
|     Heap/HeapBlock.cpp
 | |
|     Heap/Heap.cpp
 | |
|     Interpreter.cpp
 | |
|     Lexer.cpp
 | |
|     MarkupGenerator.cpp
 | |
|     Parser.cpp
 | |
|     Runtime/Array.cpp
 | |
|     Runtime/ArrayConstructor.cpp
 | |
|     Runtime/ArrayIterator.cpp
 | |
|     Runtime/ArrayIteratorPrototype.cpp
 | |
|     Runtime/ArrayPrototype.cpp
 | |
|     Runtime/BigInt.cpp
 | |
|     Runtime/BigIntConstructor.cpp
 | |
|     Runtime/BigIntObject.cpp
 | |
|     Runtime/BigIntPrototype.cpp
 | |
|     Runtime/BooleanConstructor.cpp
 | |
|     Runtime/BooleanObject.cpp
 | |
|     Runtime/BooleanPrototype.cpp
 | |
|     Runtime/BoundFunction.cpp
 | |
|     Runtime/Cell.cpp
 | |
|     Runtime/ConsoleObject.cpp
 | |
|     Runtime/DateConstructor.cpp
 | |
|     Runtime/Date.cpp
 | |
|     Runtime/DatePrototype.cpp
 | |
|     Runtime/ErrorConstructor.cpp
 | |
|     Runtime/Error.cpp
 | |
|     Runtime/ErrorPrototype.cpp
 | |
|     Runtime/ErrorTypes.cpp
 | |
|     Runtime/Exception.cpp
 | |
|     Runtime/FunctionConstructor.cpp
 | |
|     Runtime/Function.cpp
 | |
|     Runtime/FunctionPrototype.cpp
 | |
|     Runtime/GlobalObject.cpp
 | |
|     Runtime/IndexedProperties.cpp
 | |
|     Runtime/IteratorOperations.cpp
 | |
|     Runtime/IteratorPrototype.cpp
 | |
|     Runtime/JSONObject.cpp
 | |
|     Runtime/LexicalEnvironment.cpp
 | |
|     Runtime/MarkedValueList.cpp
 | |
|     Runtime/MathObject.cpp
 | |
|     Runtime/NativeFunction.cpp
 | |
|     Runtime/NativeProperty.cpp
 | |
|     Runtime/NumberConstructor.cpp
 | |
|     Runtime/NumberObject.cpp
 | |
|     Runtime/NumberPrototype.cpp
 | |
|     Runtime/ObjectConstructor.cpp
 | |
|     Runtime/Object.cpp
 | |
|     Runtime/ObjectPrototype.cpp
 | |
|     Runtime/PrimitiveString.cpp
 | |
|     Runtime/PropertyAttributes.cpp
 | |
|     Runtime/ProxyConstructor.cpp
 | |
|     Runtime/ProxyObject.cpp
 | |
|     Runtime/ProxyPrototype.cpp
 | |
|     Runtime/Reference.cpp
 | |
|     Runtime/ReflectObject.cpp
 | |
|     Runtime/RegExpConstructor.cpp
 | |
|     Runtime/RegExpObject.cpp
 | |
|     Runtime/RegExpPrototype.cpp
 | |
|     Runtime/ScriptFunction.cpp
 | |
|     Runtime/Shape.cpp
 | |
|     Runtime/StringConstructor.cpp
 | |
|     Runtime/StringIterator.cpp
 | |
|     Runtime/StringIteratorPrototype.cpp
 | |
|     Runtime/StringObject.cpp
 | |
|     Runtime/StringPrototype.cpp
 | |
|     Runtime/Symbol.cpp
 | |
|     Runtime/SymbolConstructor.cpp
 | |
|     Runtime/SymbolObject.cpp
 | |
|     Runtime/SymbolPrototype.cpp
 | |
|     Runtime/Uint8ClampedArray.cpp
 | |
|     Runtime/VM.cpp
 | |
|     Runtime/Value.cpp
 | |
|     Token.cpp
 | |
| )
 | |
| 
 | |
| serenity_lib(LibJS js)
 | |
| target_link_libraries(LibJS LibM LibCore LibCrypto)
 |