1563 Commits

Author SHA1 Message Date
Andrey Shitov
382b2b48b7 Optimize lit_find_literal_by_utf8_string by adding hash comparison.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-07-28 16:04:00 +03:00
Andrey Shitov
9766feda2e Change jerry_api_string_to_char_buffer so it doesn't add '\0' to the end of output buffer.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-07-28 15:54:55 +03:00
Andrey Shitov
656908ecaf Optimize lit_char_is_unicode_letter.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-07-28 14:48:45 +03:00
Ruben Ayrapetyan
502f4c4623 Split opcode and instruction entities and perform related renamings: opcode_t is now vm_instr_t, opcode position is instruction position, etc.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-28 13:43:43 +03:00
Ruben Ayrapetyan
1990762cf0 Add opcode description table containing an opcode's name, name and possible type of the opcode's arguments.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-28 13:43:43 +03:00
Peter Gal
25450d8a12 Error constructor prototypes should be Function
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2015-07-28 12:16:38 +02:00
Dániel Bátyai
f1248b9780 Fix Number.prototype.toString() when radix is undefined.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-07-28 12:04:41 +02:00
Szilard Ledan
b5da46f2aa Fix segmentation fault in Date helper functions
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
2015-07-28 10:19:56 +02:00
Peter Gal
e34ab90e61 RegExp: treat undefined argument as empty.
new RegExp() and new RegExp(undefined) calls now results in the
same 'source' pattern.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2015-07-27 15:58:38 +02:00
Roland Takacs
336db40ed0 Segmentation fault in JSON.stringify()
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
2015-07-27 15:29:55 +02:00
Dániel Bátyai
2e0334ccb2 Returned array of Array.prototype.map() should have same length as original.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-07-27 10:41:50 +02:00
Dániel Bátyai
fc45b80579 Fix Array.prototype.toLocaleString() when toLocaleString returns non-string.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-07-24 17:43:16 +02:00
Dániel Bátyai
b11007055d Fix buffer size calculation in Number.prototype.toString()
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-07-24 17:21:04 +02:00
Dániel Bátyai
fec5933a3d Fix Array.prototype.push() and unshift() in case result length is larger than UINT_MAX
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-07-24 17:16:34 +02:00
Peter Gal
b5de03a808 Improve Infinity handling in Math.min/max methods.
In Math.max case: if we already found an infinity value update the result
only when the previous value was a negative infinity.

In Math.min case: if we already found an infinity value update the result
only when the previous value was a positive infinity.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2015-07-24 16:22:50 +02:00
László Langó
3c71daaf84 Use unicode iterators in RegExp engine and implement \d, \D, \w, \W, \s, \S, \x, \u matching in RegExp.
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2015-07-24 16:07:25 +02:00
Dániel Bátyai
6567651b6c Fix Array index normalize helper when index is large.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-07-24 15:01:12 +02:00
Peter Gal
ee8d65063f Fix parseInt when passing empty string.
Before allocating buffer for the string first
we check that the length of it is greater then 0.
If not then the result is a NaN.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2015-07-24 14:39:12 +02:00
Zsolt Borbély
33be4883a2 Fix Array.prototype.splice() deletecount calculation
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
2015-07-24 13:55:56 +02:00
Laszlo Vidacs
64c81cc44d Implement String.prototype.indexOf()
JerryScript-DCO-1.0-Signed-off-by: Laszlo Vidacs lvidacs.u-szeged@partner.samsung.com
2015-07-24 13:35:26 +02:00
Roland Takacs
ed16f09019 Implement Date.prototype.toJSON()
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
2015-07-24 12:50:02 +02:00
Peter Gal
021fc62652 Fix endian detection on 32bit
When using the -std=c99 the gcc does not defines the i386 macro
just the __i386 and __ i386 __.

Fixes issue #355

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2015-07-24 11:00:24 +02:00
Dániel Bátyai
9513808647 Fix Array.prototype.concat() when 'this' is not an array.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-07-24 10:12:02 +02:00
Dániel Bátyai
27161d31df Fix leak in Array.prototype.indexOf() when 'fromIndex' can't coerce to primitive value.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-07-24 10:31:37 +03:00
Peter Gal
11c310322b Implement String.prototype.match
Added implementation for the String.prototype.match method.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2015-07-23 10:42:13 +03:00
Roland Takacs
63083b3b51 Implement date.prototype.toISOString() and date.prototype.toUTCString()
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
2015-07-22 15:42:49 +03:00
Ruben Ayrapetyan
d11dfc5703 Fix syntax check of literal duplication in FormalParameterList (strict mode).
Related issue: #381

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-22 15:22:40 +03:00
Zsolt Borbély
352e8f5c04 Minor stylefixes for the Array builtin
Related issue: #110

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
2015-07-22 15:01:11 +03:00
Zsolt Borbély
cdf361c2bd Reorder Array builtin functions
Sort the functions according by the chapters of the standard.

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
2015-07-22 15:01:11 +03:00
Ruben Ayrapetyan
6ade8dfebb Fix preparse_scope - consider nesting level during search for identifier tokens.
Related issue: #440

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-22 14:50:57 +03:00
Ruben Ayrapetyan
31894da098 Move ecma-stack to vm component, renaming it to vm-stack.
ECMA-stack is related to VM and is not related to ECMA component, except for GC.
Dependency between vm-stack and GC would be solved after GC would be extracted to a separate compoment.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-22 14:36:23 +03:00
Ruben Ayrapetyan
7dcaf06793 Rename int_data_t -> vm_frame_ctx_t, vm_frame_ctx_t* variables from int_data / int_data_p -> frame_ctx_p.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-22 14:36:23 +03:00
Dániel Bátyai
a2c6663d43 Array.prototype.sort() now handles defined properties only.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-07-22 14:18:24 +03:00
Dániel Bátyai
9d6e7bf336 Array.prototype.sort() should sort in place.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-07-22 14:18:24 +03:00
Szilard Ledan
7c1622855d Fix the infinite loop in ecma_date_year_from_time
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
2015-07-21 14:04:44 +02:00
Szilard Ledan
9edae36b00 Fix assertion fail in ecma_date_make_day
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
2015-07-21 14:04:44 +02:00
Laszlo Vidacs
c7a47c1791 Implement String.prototype.charCodeAt()
JerryScript-DCO-1.0-Signed-off-by: Laszlo Vidacs lvidacs.u-szeged@partner.samsung.com
2015-07-20 16:10:45 +02:00
Ruben Ayrapetyan
7b3042fdc9 Remove usage of isalpha, isdigit, isxdigit, isspace in the whole engine except implementation of JSON built-in, moving the functions to JSON built-in's module.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-20 15:47:19 +03:00
Zoltan Herczeg
bcedc901cd Add \u parse support for the JSON object. Buffer overrun issues were fixed as well.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg@inf.u-szeged.hu
2015-07-20 01:09:13 -07:00
Szilard Ledan
bbfddea032 Fix Date(Number.POSITIVE_INFINITY) assertion fail in the Date constructor
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
2015-07-17 17:38:00 +02:00
Akos Kiss
6038173e76 Rename make target build_all to $(BUILD_ALL)
The current `Makefile` works "as is" since `$(BUILD_ALL)` is
`build_all`. However, the target `build` depends on `$(BUILD_ALL)`,
so should that variable ever be changed, it will break.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2015-07-16 23:39:49 +02:00
Akos Kiss
8d9658913b Get all phony targets declared
It is generally a good practice to have the `.PHONY` declarations
close to the affected targets themselves (instead of declaring them
phony in one group at the end of the `Makefile`) so as not to miss
any. (As it already happened to the `log`, `precommit`,
`build_all`, etc., targets.) Thus, removed the one big declaration
from the end of the file and prepended all phony targets with a
declaration separately.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2015-07-16 23:39:48 +02:00
Akos Kiss
f8ee565016 Split independent commands in make recipes
Mostly, there is no need for joining commands with `&&` in recipes
since make already applies the exit-on-error functionality to each
executed line, unless there is a shell interdependency between them
(like setting environment variables in one command and using it in
another, or changing the working directory, which would not work
because of the new-subshell-per-line behaviour of make). Thus, some
independent commands can be split in the `Makefile` to improve
readability.

(Some space/tab inconsistensies are also fixed.)

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2015-07-16 23:39:48 +02:00
Akos Kiss
1a4e66a013 Extend non-quiet make mode with log echo
If `VERBOSE` is defined, cmake, sub-make, and tool logs are also
echoed on stdout. Default behaviour is still quiet mode, however.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2015-07-16 23:39:48 +02:00
Akos Kiss
f4c24f063d Enable non-quiet make
Replace most of echo-suppressing `@`s with `$(Q)`. `$(Q)` defaults
to `@` to preserve current behaviour, however, should anyone need
or prefer echoed lines, defining `VERBOSE` on the command line for
make makes it possible.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2015-07-16 23:39:48 +02:00
Ruben Ayrapetyan
68b9fb54d5 Turn off Date and RegExp built-in objects in compact profile.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-16 20:24:10 +03:00
Szilard Ledan
351df6184c Add locale part of the toString in the Date object
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
2015-07-16 13:04:41 +02:00
Dániel Bátyai
b414329ce8 Fix Array.prototype.concat() argument array length.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-07-16 10:22:52 +03:00
Peter Gal
db9b74a114 Fix buffer size calculation in parseInt.
Fixes issue #279.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2015-07-16 10:14:22 +03:00
Szilard Ledan
d2457b1fc6 Add missing RegExp case in the token_type_to_string
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
2015-07-16 10:04:03 +03:00