📄 changelog
字号:
* gram.js (JSC$stmt_if_count_locals): Changed the way how the
number of locals is counted. We don't need #if + #else, but we
need max(#if, #else).
* parser.js (JSC$parser_parse_stmt): Implemented the `throw'
statement.
* gram.js (JSC$stmt_throw): Implemented the `throw' statement.
* asm.js (JSC$ASM_throw): Implemented operand `throw'.
* defs.js: Defined new statement JSC$STMT_THROW.
1998-05-14 Markku Rossi <mtr@ngs.fi>
* parser.js (JSC$parser_parse_stmt): Implemented the `try...catch'
statement.
Fixed a typo where function syntax_error() was called instead of
JSC$parser_syntax_error().
* gram.js (JSC$ContBreak$try_return_nesting): New function to
count how many try_pop's the return statement should invoke.
(JSC$stmt_return_asm): Changed to invoke try_pop's if the return
occurs inside a try-block.
(JSC$stmt_try): Implemented the `try...catch' statement.
* asm.js: Implemented new operands try_push and try_pop to
implement the `try...catch' statement.
(JSC$asm_is_local_jump): Added JSC$OP_TRY_PUSH.
(JSC$asm_optimize): Changed to stop `dup...pop' searching on
`try_pop' operand.
* defs.js: Defined tokens for the ECMA Script's future reserved
keywords.
Defined new statement JSC$STMT_TRY.
* lexer.js (JSC$lexer): Added support for the ECMA Script's future
reserved keywords.
* gram.js: Cleaned up the `continue' and `break' statement
handling. Now there is an instance of class JSC$ContBreak that
holds the state of the currently active looping constructs.
1998-05-13 Markku Rossi <mtr@ngs.fi>
* gram.js: Checked all XXX's and fixed them.
1998-05-12 Markku Rossi <mtr@ngs.fi>
* parser.js (JSC$parser_parse_iteration_stmt): Implemented
`for...in' statements.
* gram.js (JSC$stmt_for_in): Implemented `for...in' statements.
* defs.js: New statement type JSC$STMT_FOR_IN.
* asm.js: Reorganized byte-code operands.
(JSC$ASM_roll): New operand to roll the n uppermost items in the
stack.
(JSC$ASM_nth): New operand to return the nth item from array,
object, or string.
1998-05-11 Markku Rossi <mtr@ngs.fi>
* asm.js (JSC$ASM_delete_property): New function for the
`delete_property' operand.
(JSC$ASM_delete_array): New function for the `delete_array'
operand.
The new functions JSC$ASM_delete_property and JSC$ASM_delete_array
replace the old `delete' operand.
* gram.js (JSC$expr_unary_asm): Implemented (correctly) the delete
operator.
1998-05-07 Markku Rossi <mtr@ngs.fi>
* asm.js (JSC$asm_optimize): Fixed a bug from the peep-hole
optimization. We must not optimize over subroutine calls like:
jsr, new, call_method or return operands.
* lexer.js (JSC$lexer_read_string): Fixed to handle
backslash+newline like C does.
1998-04-16 Markku Rossi <mtr@ngs.fi>
* lexer.js (JSC$lexer): Implemented decimal literals.
* asm.js (JSC$ASM_const_bytecode): Implemented float and NaN
constants.
* entry.js: New flag JSC$FLAG_WARN_WITH_CLOBBER to control
warnings about the with-lookup clobbering.
* gram.js (JSC$asm_expr_lvalue_load_asm): Added warnings for
symbols which with-lookup is clobbered by a local variable or a
function argument declaration.
1998-04-15 Markku Rossi <mtr@ngs.fi>
* asm.js (JSC$ASM_with_pop): Added argument `value' that specifies
how many with-frames the operand pops.
* gram.js (JSC$stmt_with_asm): Finished with statement. Now it
handles break and continue statements within the with block.
1998-03-31 Markku Rossi <mtr@ngs.fi>
* entry.js: Renamed flag JSC$FLAG_OPTIMIZE_JUMPS_TO_JUMPS to
JSC$FLAG_OPTIMIZE_JUMPS.
1998-03-26 Markku Rossi <mtr@ngs.fi>
* Added tests for the compiler.
* defs.js: Changed JSC$alloc_id() calls with constant values.
1998-03-25 Markku Rossi <mtr@ngs.fi>
* asm.js (JSC$asm_optimize): Replaced individual `dup nnn pop =>
nnn' optimizations with one generic dup-pop optimizations. This
new optimizations handles all the optimizable dup-pop cases.
1998-03-24 Markku Rossi <mtr@ngs.fi>
* asm.js (JSC$asm_optimize): New optimizations for `while (true)'
and `while (false)' cases.
1998-03-05 Markku Rossi <mtr@ngs.fi>
* parser.js (JSC$parser_parse_left_hand_side_expr): Fixed few
typos where JSC$parser_get_token() was called without arguments.
* lexer.js (JSC$lexer): Implemented some character constants. Now
the lexer supports all character constants that can be found from
the ANSI-C reference.
* gram.js: Added language types for all expressions that know
them.
Changed to generate type aware assembler operands for expressions
and statements for which the type is known.
* entry.js (JSC$compile_stream): Added unconditional
optimizations: constant folding and type optimizations.
* defs.js: Added language primitive types.
* asm.js: Implemented type aware iffalse_b and iftrue_b operands.
1998-03-04 Markku Rossi <mtr@ngs.fi>
* gram.js (JSC$expr_real_asm): Implemented.
1998-03-03 Markku Rossi <mtr@ngs.fi>
* asm.js (JSC$optimize_heavy): New function to perform
optimizations that require the liveness information of local
variables and arguments.
* entry.js: New flag JSC$FLAG_OPTIMIZE_HEAVY for heavy
optimizations.
* asm.js: Re-organized assembler operands.
Implemented all missing operands.
* entry.js: New flag JSC$FLAG_ARGUMENT_COUNT_CHECKS.
* gram.js (JSC$function_declaration_asm): Added argument count
checks.
Renamed shift operands.
1998-03-02 Markku Rossi <mtr@ngs.fi>
* parser.js: Fixes some bugs, shown by the new function argument
count check.
* gram.js: Changed all `new JSC$ASM_*()' constructors to
explicitly call the link() method.
* asm.js: Removed call to JSC$asm_append() from all asm
constructors. The linking is now implemented with the link()
method that is defined to all assembler operands, labels and
symbols.
* gram.js (JSC$function_declaration): Added lbrace_ln to hold the
line number of the opening lbrace of the body.
(JSC$function_declaration_asm): Set locals' linenumber to be
lbrace_ln.
1998-02-27 Markku Rossi <mtr@ngs.fi>
* asm.js (JSC$asm_bytecode): Added debugging information.
* entry.js: Renamed to entry.js from main.js.
New flag JSC$FLAG_ANNOTATE_ASSEMBLER.
(JSC$compile_stream): Changed to handle
JSC$FLAG_ANNOTATE_ASSEMBLER flag.
New flag JSC$FLAG_GENERATE_DEBUG_INFO.
(JSC$compile_stream): Changed to handle
JSC$FLAG_GENERATE_DEBUG_INFO flga.
* streams.js: Added rewind and readln methods to all streams.
* asm.js (JSC$asm_print): If requested, annotate the generated
assembler listing with the original source code.
* gram.js: Added line number information to all assembler
operands.
* parser.js: Added line number information to all statements and
expressions.
1998-02-26 Markku Rossi <mtr@ngs.fi>
* asm.js (JSC$asm_optimize): Implemented new optimization for
assembler, generated from statements like `i++' and `i--'.
1998-02-24 Markku Rossi <mtr@ngs.fi>
* asm.js (JSC$ASM_xor): Implemented xor opcode.
(JSC$ASM_with_push): Implemented with statements.
(JSC$asm_generate): Changed to ensure that the evaluation of the
global section returns some sane value to the caller.
(JSC$asm_optimize): New peephole optimization for apop + pop.
(JSC$ASM_locals): Changed the argument to be a 16 bit integer.
* parser.js (JSC$parser_parse): Fixed an infinite loop. We must
check that parse_source_element() returns true. Otherwise we have
encountered a syntax error.
* gram.js (JSC$expr_unary_asm): Implemented rest unary
expressions.
(JSC$stmt_with): Implemented with statement.
* lexer.js (JSC$lexer): Made `#!' a single line commment starter.
(JSC$lexer): Implemented '\ooo' notations to top-level and to
string constants.
1998-02-23 Markku Rossi <mtr@ngs.fi>
* namespace.js: Changed namespace to report errors and warnings
about different variable and argument definition illegalities.
* main.js (JSC$compile_stream): Changed to raise an error if the
input stream couldn't be opened.
* gram.js (JSC$stmt_variable_asm): Removed warnings about multiply
defined variables. They are now reported directly from
namespace.
* asm.js (JSC$asm_optimize): Added argument flags that tells which
optimizations the function should perform.
1998-02-20 Markku Rossi <mtr@ngs.fi>
* parser.js (JSC$parser_reset): New function to reset all global
variables.
* main.js (JSC$compiler_reset): New function to reset the whole
compiler.
* gram.js (JSC$gram_reset): New function to reset all global
variables.
* asm.js (JSC$asm_reset): New function to reset all global
variables. This replaces the old JSC$asm_clear() function.
* Changed all errors to be reported with the error() global
method.
1998-02-18 Markku Rossi <mtr@ngs.fi>
* main.js (JSC$compile_stream): Made error messages more
informative.
* streams.js: Added property `error' for all streams.
* namespace.js (JSC$NameSpace_define_symbol): Changed to return a
boolean status code that identify whether the symbol was already
defined or not.
* gram.js: Added line number information for statements.
1998-02-16 Markku Rossi <mtr@ngs.fi>
* gram.js (JSC$stmt_continue): Implemented `continue' statement.
(JSC$stmt_break): Implemented `break' statement.
* asm.js (JSC$asm_bytecode): Changed to use String.append()
instead of the plus operand. This saves memory usage noticeably.
1998-02-13 Markku Rossi <mtr@ngs.fi>
* asm.js (JSC$asm_optimize): Made heavy optimizations to depend on
the JSC$optimize_heavy variable.
* main.js: Create a new public interface to the compiler.
Made all diagnostics messages to depend on the JSC$verbose
variable.
* asm.js (JSC$asm_optimize): Cleaned up the optimization code.
Run the dead code elimination optimizations in a loop until no
more changes can be done.
(JSC$asm_generate): Added support for local variables in the
global statements.
* parser.js (JSC$parser_parse_left_hand_side_expr): Implemented
array references.
1998-02-11 Markku Rossi <mtr@ngs.fi>
* The JavaScript compiler is now self-hosting. It can generate
valid byte-code files which can be executed with the virtual
machine. The perl assembler is no longer needed.
* gram.js: Changed to generate internal assembler objects instead
of dumping the assembler code to the stdout.
* asm.js: New file to implement the assembler.
1998-02-09 Markku Rossi <mtr@ngs.fi>
* streams.js (JSC$StreamString): Implemented string stream.
* The JavaScript JavaScript compiler can now compile itself.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -