NativeExecutable* NativeExecutable::create(VM& vm, Ref<JITCode>&& callThunk, TaggedNativeFunction function, Ref<JITCode>&& constructThunk, TaggedNativeFunction constructor, const String& name) { NativeExecutable* executable; executable = new (NotNull, allocateCell<NativeExecutable>(vm.heap)) NativeExecutable(vm, function, constructor); executable->finishCreation(vm, WTFMove(callThunk), WTFMove(constructThunk), name); return executable; }
NativeExecutable* NativeExecutable::create(VM& vm, PassRefPtr<JITCode> callThunk, NativeFunction function, PassRefPtr<JITCode> constructThunk, NativeFunction constructor, Intrinsic intrinsic, const String& name) { NativeExecutable* executable; executable = new (NotNull, allocateCell<NativeExecutable>(vm.heap)) NativeExecutable(vm, function, constructor, intrinsic); executable->finishCreation(vm, callThunk, constructThunk, name); return executable; }
void ExecutableBase::dump(PrintStream& out) const { ExecutableBase* realThis = const_cast<ExecutableBase*>(this); if (classInfo() == NativeExecutable::info()) { NativeExecutable* native = jsCast<NativeExecutable*>(realThis); out.print("NativeExecutable:", RawPointer(bitwise_cast<void*>(native->function())), "/", RawPointer(bitwise_cast<void*>(native->constructor()))); return; } if (classInfo() == EvalExecutable::info()) { EvalExecutable* eval = jsCast<EvalExecutable*>(realThis); if (CodeBlock* codeBlock = eval->codeBlock()) out.print(*codeBlock); else out.print("EvalExecutable w/o CodeBlock"); return; } if (classInfo() == ProgramExecutable::info()) { ProgramExecutable* eval = jsCast<ProgramExecutable*>(realThis); if (CodeBlock* codeBlock = eval->codeBlock()) out.print(*codeBlock); else out.print("ProgramExecutable w/o CodeBlock"); return; } if (classInfo() == ModuleProgramExecutable::info()) { ModuleProgramExecutable* executable = jsCast<ModuleProgramExecutable*>(realThis); if (CodeBlock* codeBlock = executable->codeBlock()) out.print(*codeBlock); else out.print("ModuleProgramExecutable w/o CodeBlock"); return; } FunctionExecutable* function = jsCast<FunctionExecutable*>(realThis); if (!function->eitherCodeBlock()) out.print("FunctionExecutable w/o CodeBlock"); else { CommaPrinter comma("/"); if (function->codeBlockForCall()) out.print(comma, *function->codeBlockForCall()); if (function->codeBlockForConstruct()) out.print(comma, *function->codeBlockForConstruct()); } }