|
38 | 38 | /* |
39 | 39 | TODO: |
40 | 40 | - regexp: better error position info |
41 | | - - use a specific MTAG for short functions intead of an immediate value |
| 41 | + - use a specific MTAG for short functions instead of an immediate value |
42 | 42 | - use hash table for atoms |
43 | 43 | - set the length accessors as non configurable so that the |
44 | 44 | 'get_length' instruction optimizations are always safe. |
|
51 | 51 | saved bytecode ? |
52 | 52 | - reduced memory usage: |
53 | 53 | - reduce JSFunctionBytecode size (remove source_pos) |
54 | | - - do not explictely store function names for get/set/bound |
| 54 | + - do not explicitly store function names for get/set/bound |
55 | 55 | - use JSSTDLibraryDef fields instead of copying them to JSContext ? |
56 | 56 | */ |
57 | 57 |
|
@@ -1583,7 +1583,7 @@ static BOOL is_utf8_right_surrogate(const uint8_t *p) |
1583 | 1583 |
|
1584 | 1584 | typedef struct { |
1585 | 1585 | JSValue buffer; /* string, JSByteBuffer or JS_EXCEPTION */ |
1586 | | - int len; /* currrent string length (in bytes) */ |
| 1586 | + int len; /* current string length (in bytes) */ |
1587 | 1587 | BOOL is_ascii; |
1588 | 1588 | } StringBuffer; |
1589 | 1589 |
|
@@ -3845,7 +3845,7 @@ static uint32_t get_ugolomb(const uint8_t *buf, uint32_t buf_len, |
3845 | 3845 | break; |
3846 | 3846 | i++; |
3847 | 3847 | if (i == 32) { |
3848 | | - /* errror */ |
| 3848 | + /* error */ |
3849 | 3849 | *pindex = index; |
3850 | 3850 | return 0xffffffff; |
3851 | 3851 | } |
@@ -5820,7 +5820,7 @@ JSValue JS_Call(JSContext *ctx, int call_flags) |
5820 | 5820 | goto get_field_slow; |
5821 | 5821 | for(;;) { |
5822 | 5822 | /* no array check is necessary because 'prop' is |
5823 | | - guaranted not to be a numeric property */ |
| 5823 | + guaranteed not to be a numeric property */ |
5824 | 5824 | /* XXX: slow due to short ints */ |
5825 | 5825 | pr = find_own_property_inlined(ctx, p, prop); |
5826 | 5826 | if (pr) { |
@@ -5918,7 +5918,7 @@ JSValue JS_Call(JSContext *ctx, int call_flags) |
5918 | 5918 | if (unlikely(p->mtag != JS_MTAG_OBJECT)) |
5919 | 5919 | goto put_field_slow; |
5920 | 5920 | /* no array check is necessary because 'prop' is |
5921 | | - guaranted not to be a numeric property */ |
| 5921 | + guaranteed not to be a numeric property */ |
5922 | 5922 | /* XXX: slow due to short ints */ |
5923 | 5923 | pr = find_own_property_inlined(ctx, p, prop); |
5924 | 5924 | if (unlikely(!pr)) |
@@ -9160,10 +9160,10 @@ static JSValue js_parse_pop_val(JSParseState *s) |
9160 | 9160 | } |
9161 | 9161 |
|
9162 | 9162 | /* WARNING: local variables are not preserved across PARSE_CALL(). So |
9163 | | - they must be explicitely saved and restored */ |
| 9163 | + they must be explicitly saved and restored */ |
9164 | 9164 | #define PARSE_CALL(s, cur_state, func, param) return (cur_state | (PARSE_FUNC_ ## func << 8) | ((param) << 16)); parse_state ## cur_state : ; |
9165 | 9165 |
|
9166 | | -/* preserve var1, ... accross the call */ |
| 9166 | +/* preserve var1, ... across the call */ |
9167 | 9167 | #define PARSE_CALL_SAVE1(s, cur_state, func, param, var1) \ |
9168 | 9168 | PARSE_PUSH_INT(s, var1); \ |
9169 | 9169 | PARSE_CALL(s, cur_state, func, param); \ |
@@ -11227,13 +11227,13 @@ static void compute_stack_size_push(JSParseState *s, |
11227 | 11227 | js_printf(s->ctx, "%5d: %d\n", pos, stack_len); |
11228 | 11228 | #endif |
11229 | 11229 | if (pos >= (uint32_t)arr->size) |
11230 | | - js_parse_error(s, "bytecode buffer overlow (pc=%d)", pos); |
| 11230 | + js_parse_error(s, "bytecode buffer overflow (pc=%d)", pos); |
11231 | 11231 | /* XXX: could avoid the division */ |
11232 | 11232 | short_stack_len = 1 + ((unsigned)stack_len % 255); |
11233 | 11233 | if (explore_tab[pos] != 0) { |
11234 | 11234 | /* already explored: check that the stack size is consistent */ |
11235 | 11235 | if (explore_tab[pos] != short_stack_len) { |
11236 | | - js_parse_error(s, "unconsistent stack size: %d %d (pc=%d)", explore_tab[pos] - 1, short_stack_len - 1, (int)pos); |
| 11236 | + js_parse_error(s, "inconsistent stack size: %d %d (pc=%d)", explore_tab[pos] - 1, short_stack_len - 1, (int)pos); |
11237 | 11237 | } |
11238 | 11238 | } else { |
11239 | 11239 | explore_tab[pos] = short_stack_len; |
@@ -11291,7 +11291,7 @@ static void compute_stack_size(JSParseState *s, JSValue *pfunc) |
11291 | 11291 | oi = &opcode_info[op]; |
11292 | 11292 | op_len = oi->size; |
11293 | 11293 | if ((pos + op_len - 1) > arr->size) { |
11294 | | - js_parse_error(s, "bytecode buffer overlow (pc=%d)", (int)(pos - 1)); |
| 11294 | + js_parse_error(s, "bytecode buffer overflow (pc=%d)", (int)(pos - 1)); |
11295 | 11295 | } |
11296 | 11296 | n_pop = oi->n_pop; |
11297 | 11297 | if (oi->fmt == OP_FMT_npop) |
@@ -14797,7 +14797,7 @@ JSValue js_array_sort(JSContext *ctx, JSValue *this_val, |
14797 | 14797 |
|
14798 | 14798 | p = JS_VALUE_TO_PTR(*this_val); |
14799 | 14799 | arr = JS_VALUE_TO_PTR(p->u.array.tab); |
14800 | | - /* XXX: could resize the array in case it was shrinked by the compare function */ |
| 14800 | + /* XXX: could resize the array in case it was shrank by the compare function */ |
14801 | 14801 | len = min_int(len, p->u.array.len); |
14802 | 14802 | for(i = 0; i < len; i++) { |
14803 | 14803 | arr->arr[i] = tab->arr[2 * i]; |
|
0 commit comments