summaryrefslogtreecommitdiff
path: root/module/language/js-il
AgeCommit message (Collapse)AuthorFilesLines
2017-08-28Update Copyright HeadersIan Price4-0/+80
* module/Makefile.am: * module/language/cps/compile-js.scm: * module/language/cps/spec.scm: * module/language/javascript.scm: * module/language/javascript/spec.scm: * module/language/js-il.scm: * module/language/js-il/compile-javascript.scm: * module/language/js-il/inlining.scm: * module/language/js-il/runtime.js: Update copyright headers
2017-08-27Keywords cannot be both keyword and optionalIan Price1-2/+46
* module/language/js-il/compile-javascript.scm (compile-jump-table, bind-opt-kw-args): Keywords should not be parsed as optional arguments when both are present.
2017-08-17Implement variable-bound? builtinIan Price1-0/+4
* module/language/js-il/runtime.js(variable-bound?): Implement builtin
2017-08-17pop-fluid uses field of frame not fluidIan Price1-1/+1
* module/language/js-il/runtime.js(pop-fluid): Fix primitive.
2017-08-17Argument to make-fluid is optionalIan Price1-0/+3
* module/language/js-il/runtime.js(make-fluid): Supply default argument
2017-08-17*features* is an empty listIan Price1-1/+1
* module/language/js-il/runtime.js(*features*): Stop stubbing
2017-08-17Implement list builtinsIan Price1-4/+36
* module/language/js-il/runtime.js (cons, memq, member, delete!): Implement builtins
2017-08-17Implement Hook BuiltinsIan Price1-1/+28
* module/language/js-il/runtime.js: (scheme.Hook): new constructor (make-hook, run-hook): Implement builtins.
2017-08-16Search for variables in imports.Ian Price1-1/+44
* module/language/js-il/runtime.js: (scm_module_variable): Look in imports if not in obarray. (module_imported_variable): New procedure. (scm_module_index_obarray, scm_module_index_uses, scm_module_index_import_obarray): New variables.
2017-08-16Separate public / private module lookupsIan Price1-3/+20
* module/language/js-il/runtime.js: (scm_public_variable, scm_module_public_interface, module_public_interface_var, scm_post_boot_init_modules): Implement Public Variable Lookup (scm_private_lookup, scm_private_variable): Implement Private Lookup
2017-08-16scheme.HashTable uses ES6 Map objectsIan Price1-52/+72
* module/language/js-il/runtime.js: (scheme.HashTable): Change object interface. (cached-module-box): Update primitive. (scm_module_ensure_local_variable, def_guile_val): Update helpers (scm_hash): Remove helper. (make-weak-key-hash-table, hash-clear!, hashq-remove! hashq-ref, hashq-set!, hash-for-each): Update builtins. (make-weak-value-hash-table, hash-map->list): New builtins.
2017-08-14Reimplement JS module system primitives.Ian Price1-71/+231
* module/language/js-il/runtime.js (scm_hash, scheme.HashTable): moved for bootstrapping purposes. (define!, cached-toplevel-box, cached-module-box, current-module, resolve): Reimplement primitives. (define!, module-local-variable, module-variable, %get-pre-modules-obarray, set-current-module): Reimplement builtin procedures. (make-undefined-variable): New builtin procedure. (scm_pre_modules_obarray, the_root_module, scm_public_lookup, scm_public_variable, scm_private_lookup, scm_current_module, scm_lookup, scm_module_ensure_local_variable, scm_module_variable, scm_module_define, module_system_is_booted, module_make_local_var_x_var, the_module, k_ensure, resolve_module_var, scm_post_boot_init_modules): New helper variables and procedures, designed to resemble C versions. (scheme.call): New helper procedure (def_guile0, def_guile_val): Reimplement helper procedure.
2017-08-14Implement unboxed integer primitives.Ian Price1-0/+8
* module/language/js-il/runtime.js (u64-=, u64->scm): New primitives.
2017-08-14Implement basic `equal?' implementationIan Price1-2/+18
* module/language/js-il/runtime.js (equal?): Remove primitive. Implement as builtin procedure. This version Only handles pairs.
2017-08-11modules should be passed current continuationIan Price1-2/+1
* module/language/js-il/runtime.js (primitive-load-path): modules should be passed the current continuation.
2017-08-09Add `guild jslink' to bundle JS programsIan Price1-11/+10
* module/Makefile.am (SOURCES): Install runtime.js and jslink.scm * module/language/js-il/compile-javascript.scm (compile-exp): Compilation units take a continuation to facilitate linking. * module/scripts/jslink.scm: New script.
2017-08-03Unwind prompt framesIan Price1-1/+2
* module/language/js-il/runtime.js(unwind): Unwind prompts.
2017-08-03struct-set! primitive returns no valuesIan Price1-1/+2
* module/language/js-il/runtime.js (struct-set!): Don't return a value.
2017-08-03Make child structs applicable.Ian Price1-0/+16
* module/language/js-il/runtime.js (scheme.Struct): When certain flags are set, child structs should be marked as applicable.
2017-08-03Implement misc built-insIan Price1-0/+53
* module/language/js-il/runtime.js (scm->u64): New primitive (integer?, char=?, make-fluid, read-hash-extend, make-hook, simple-format, scm-error): Implement built-ins. (syntax-session-id, macroexpand, %exception-handler, print-exception, *features*, %load-hook, current-reader): Stubbed variables.
2017-08-03Implement module built-ins.Ian Price1-3/+72
* module/language/js-il/runtime.js (variable?): New Primitive. (primitive-load-path, module-local-variable, module-variable, %get-pre-modules-obarray, set-current-module): Implement built-ins.
2017-08-03Implement procedure built-ins.Ian Price1-0/+13
* module/language/js-il/runtime.js (procedure?, set-procedure-property!, make-procedure-with-setter): Implement.
2017-08-03Implement hashtable built-insIan Price1-0/+79
* module/language/js-il/runtime.js (scheme.HashTable): New Constructor. (make-hash-table, hash-clear!, hashq-remove!, hashq-ref, hashq-set!, hash-for-each): Implement built-ins.
2017-08-02scm_struct_init skips hidden fields.Ian Price1-1/+1
* module/language/js-il/runtime.js (scm_struct_init): skip 'h' fields.
2017-08-02define! primitive only takes one argument.Ian Price1-2/+2
* module/language/js-il/runtime.js (define!): Ignore argument.
2017-08-02Implement struct built-ins.Ian Price1-0/+28
* module/language/js-il/runtime.js (struct?): New primitive. (<applicable-struct-vtable>, record-type-vtable, set-struct-vtable-name!, make-struct): Implement built-ins.
2017-08-02Implement built-in string procedures.Ian Price1-2/+26
* module/language/js-il/runtime.js (string-append): Extend to more than 2 arguments. (string-join): New procedure.
2017-08-02Implement built-in symbol procedures.Ian Price1-0/+16
* module/language/js-il/runtime.js (symbol->string, gensym): New procedures.
2017-08-02Implement built-in syntax procedures.Ian Price1-0/+21
* module/language/js-il/runtime.js (syntax?, make-syntax, syntax-expression, syntax-wrap, syntax-module): New procedures.
2017-08-02Implement builtin list procedures.Ian Price1-0/+90
* module/language/js-il/runtime.js (make-list, length, list?, reverse, append, memq, member, delete!): New procedures
2017-08-02Implement immediate version of vector primitives.Ian Price1-3/+15
* module/language/js-il/runtime.js (make-vector/immediate, vector-set!/immediate, vector-ref/immediate): New Primitives.
2017-06-28Implement structs in runtime.jsIan Price1-7/+131
* module/language/js-il/runtime.js: (scheme.Struct): new type. (allocate-struct/immediate, struct-vtable, struct-set!, struct-ref, struct-set!/immediate, struct-ref/immediate): Implement primitives. (def_guile_val): New helper. (string=?, string-append): Implement string functions. (standard-vtable-fields, <standard-vtable>, vtable-index-layout, vtable-index-printer, vtable-offset-user, make-struct/no-tail, make-vtable, struct-vtable?): Implement struct functions.
2017-06-28Implement Winding & UnwindingIan Price1-6/+65
* module/language/js-il/runtime.js (wind, unwind): Implement. (callcc): Wind when invoking continuation.
2017-06-28Add macro type in runtime.jsIan Price1-0/+12
* module/language/js-il/runtime.js (scheme.Macro): Add type. (make-syntax-transformer): Add guile procedure.
2017-06-22Implement cached-module-boxIan Price1-1/+58
* module/language/js-il/runtime.js (scheme): Add module_cache field. (scheme.primitives) Add cached-module-box primitive. (def_guile0) Convenience for adding to (guile) module cache.
2017-06-20Add more variables to no-values-primitivesIan Price1-0/+3
* module/language/js-il/inlining.scm (no-values-primitives): Add primitives
2017-06-20Compile Syntax Objects to JavascriptIan Price2-0/+16
* module/language/js-il/compile-javascript.scm (compile-const): Handle the new syntax object struct. * module/language/js-il/runtime.js(scheme.Syntax): Add Syntax Object type
2017-06-16Add some primitives to runtime.jsIan Price1-1/+43
* module/language/js-il/runtime.js(add/immediate, sub/immediate, load-u64, u64-=-scm, handle-interrupts): Add primitives.
2017-06-16JS-IL inliner has different count-calls for different clausesIan Price1-17/+26
* module/language/js-il/inlining.scm(inline-single-calls): Factor into another function inline-clause, so that count-calls is only called on the clause.
2017-06-15Add #:js-inline? and #:js-flatten? debugging optionsIan Price1-2/+6
* module/language/js-il/compile-javascript.scm (compile-javascript): Check for #:js-inline? and #:js-flatten?, and turn off inline-single-calls and flatten-blocks respectively.
2017-06-15Update primitives in no-values-primitivesIan Price1-1/+2
* module/language/js-il/inlining.scm (no-values-primitives): Update.
2015-06-24Explicitly test for undefined arguments to handle false values like 0Ian Price1-4/+7
2015-06-23Handle more identifier charactersIan Price1-1/+10
2015-06-22Change local type representation and remove var typeIan Price2-16/+16
2015-06-22Change function type representationIan Price2-23/+21
2015-06-22Change program type representationIan Price2-15/+23
2015-06-22Rewrite js-il inlinerIan Price3-38/+207
2015-06-22Different types for Continuation and Variable identifiersIan Price2-32/+54
2015-06-18Implement fluid primitivesIan Price1-3/+31
2015-06-18Use scheme.frame.Prompt objects for prompts on dynstackIan Price1-5/+16