Coder Social home page Coder Social logo

Comments (7)

moqi2011 avatar moqi2011 commented on August 16, 2024

我在v2ex上面看到一个人头像和名字都和你一样,是你吗?

from quickjs.

kvenux avatar kvenux commented on August 16, 2024

@moqi2011 Yes....

from quickjs.

HelloAlone avatar HelloAlone commented on August 16, 2024

refer this repo (support msvc 2017 or 2019): https://github.com/c-smile/quickjs/

from quickjs.

kvenux avatar kvenux commented on August 16, 2024

refer this repo (support msvc 2017 or 2019): https://github.com/c-smile/quickjs/

another official repo?

from quickjs.

alexdowad avatar alexdowad commented on August 16, 2024

This evals a 1.4MB string in such a way that QuickJS generates an enormous number of OP_with_get_var opcodes when compiling that source string. When compiling a function (or eval'd string), QuickJS must determine how much space it needs for its evaluation stack. Since OP_with_get_var does a conditional forward jump, compute_stack_size_rec recurses to check what the maximum required evaluation stack size is both when the conditional jump is taken, and when it is not taken.

Generate a function with lots and lots of OP_with_get_var opcodes, and the recursion tree for compute_stack_size_rec will be enormous.

This is unfortunate, since the recursive code for compute_stack_size_rec is quite simple and straightforward. From a cursory examination, it looks like any fix will make the function significantly less readable.

from quickjs.

bellard avatar bellard commented on August 16, 2024

fixed

from quickjs.

alexdowad avatar alexdowad commented on August 16, 2024

OK, so explicit recursion is no longer used to explore different paths through a function and calculate the required stack size. Instead, paths which still need to be searched are pushed onto a queue.

I must say that the fix is simpler and less intrusive than what I had imagined. Nice!

from quickjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.