4 ms·
> Irregexp[1] compiles on V8 byte code I was thinking: but V8 doesn't have byte code. Then opened the link: "After optimization we generate native machine co
by z92 13y ago
> Irregexp[1] compiles on V8 byte code
I was thinking: but V8 doesn't have byte code.
Then opened the link:
"After optimization we generate native machine code which uses backtracking to try different alternatives."
- pmelendez 13y agoWell I might got it wrong but I got the bytecode reference from here: http://v8.googlecode.com/svn/trunk/src/interpreter-irregexp.cc http://v8.googlecode.com/svn/trunk/src/interpreter-irregexp.... Skimming the code it does look like they are interpreting byte code from Irregexp but I would need to read further to say it for sure.
- ahomescu1 13y agoIt's not JavaScript bytecode, but regex bytecode. V8 parses regular expressions to regex ASTs, takes them through some more intermediate forms, then finally to a special regex bytecode. That bytecode is either interpreted, or JIT compiled (depending of some build options, I think). You can look at a list of bytecodes in [1], and at the x64 JIT in [2]. 1 - http://code.google.com/p/v8/source/browse/trunk/src/bytecodes-irregexp.h http://code.google.com/p/v8/source/browse/trunk/src/bytecode... 2 - http://code.google.com/p/v8/source/browse/trunk/src/x64/regexp-macro-assembler-x64.cc http://code.google.com/p/v8/source/browse/trunk/src/x64/rege...