Commit Graph

123 Commits

Author SHA1 Message Date
tball@google.com 5f320829e7 Updated GetTimeZoneName() to return "" if localtime_r fails or has a NULL for its tm_zone value, like V8 does. Also updated GetTimeZoneOffsetInSeconds() to return 0 on localtime_r failure, like V8.
BUG=5943

Review URL: https://codereview.chromium.org//11267051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14112 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-25 23:38:45 +00:00
turnidge@google.com 8b68d343c7 Enforce length/size limits for variable size heap object in order to
avoid overflow.

For each variable size heap object, compute the maximum number of
elements and use that in the ::New functions to avoid overflow.  If a
bad length/size reaches a ::New function, that is a FATAL error -- the
problem should have been caught earlier by the dart api or by the
library code.

Add "border guards" in the dart api and in library calls which cause
new variable size heap objects to be allocated.  We check for invalid
length/size and throw explanatory error messages.
Review URL: https://chromiumcodereview.appspot.com//10782016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10130 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-01 18:22:30 +00:00
asiva@google.com f4e3396989 Address some leftover review comments from previous CL.
Review URL: https://chromiumcodereview.appspot.com//10792019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9721 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-17 21:16:08 +00:00
asiva@google.com ac914d3b8a Don't create a Bigint object first for every integer while parsing the sources, instead first check to see if it can be represented as a Smi or Mint. This avoids unnecessary creation of Bigint objects.
Review URL: https://chromiumcodereview.appspot.com//10703150

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9607 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 19:22:33 +00:00
turnidge@google.com 9cbae35238 Don't allow OS::SNPrint or OS::VSNPrint to return negative values.
If we encounter conditions that would have caused vsnprintf to return
a negative value, then something pretty wild is going on.  We choose
to terminate the vm when this occurs.

This fixes security bug 1745.
Review URL: https://chromiumcodereview.appspot.com//10696165

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9558 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 17:54:24 +00:00
asiva@google.com f05e3736d8 Fix issue 1968, replace usage of inline 'asm' constructs in 'stack alignment', 'jump to exception handler' and 'jump to error handler' code with calls to appropriate stubs.
Review URL: https://chromiumcodereview.appspot.com//10664004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9071 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-25 17:35:20 +00:00
floitsch@google.com dd61a23829 Reapply "Refactor Date implementation in VM."
This reapplies fixed versions of commit 7542 and commit 8544.
Original review URLs:
https://chromiumcodereview.appspot.com//10533068
https://chromiumcodereview.appspot.com//10544109

Review URL: https://chromiumcodereview.appspot.com//10534114

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8655 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-14 13:05:22 +00:00
floitsch@google.com eb92af4080 Revert "Refactor Date implementation in VM."
Also revert "Round days-computation to get rid of daylight-savings differences."

This reverts commit 7542 and commit 8544.

Review URL: https://chromiumcodereview.appspot.com//10534111

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8547 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-12 13:44:45 +00:00
floitsch@google.com 17de58fbaf Reapply "Refactor Date implementation in VM."
This reapplies a fixed version of commit 8533.
https://chromiumcodereview.appspot.com//10533068

Review URL: https://chromiumcodereview.appspot.com//10536116

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8542 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-12 12:04:36 +00:00
floitsch@google.com 02f39238ae Revert "Refactor Date implementation in VM."
This reverts commit 8533.

Review URL: https://chromiumcodereview.appspot.com//10536114

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8535 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-12 10:33:36 +00:00
floitsch@google.com 0e297362a2 Refactor Date implementation in VM.
Less (and simpler) native functions. More precise semantics (for both the
native functions as well as for the Date class itself).

Fixes issue 3201.

Review URL: https://chromiumcodereview.appspot.com//10533068

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8533 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-12 10:24:58 +00:00
floitsch@google.com cc15d26cf7 Reapply "Add support for timezone offset and timezone name."
This reapplies commit 7800.

Review URL: https://chromiumcodereview.appspot.com//10417009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7805 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 16:11:20 +00:00
floitsch@google.com 77ade89e4a Revert "Add support for timezone offset and timezone name."
This reverts commit 7803.

Review URL: https://chromiumcodereview.appspot.com//10416008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7804 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 15:13:46 +00:00
floitsch@google.com 618c649c33 Reapply "Add support for timezone offset and timezone name."
This reapplies commit 7800.
Original CL: https://chromiumcodereview.appspot.com/10383218/

Don't write *foo += x.

Review URL: https://chromiumcodereview.appspot.com//10413031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7803 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 15:07:11 +00:00
floitsch@google.com 5b99866ecd Revert "Add support for timezone offset and timezone name."
This reverts commit 7801..

Review URL: https://chromiumcodereview.appspot.com//10399106

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7802 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 14:40:27 +00:00
floitsch@google.com 36d9c69461 Add support for timezone offset and timezone name.
Review URL: https://chromiumcodereview.appspot.com//10383218

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7801 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 14:36:43 +00:00
floitsch@google.com 410e6bf600 Reapply "Set the TZ env to get the UTC-ms since epoch."
This reapplies a fixed version of commit 7285.

Review URL: https://chromiumcodereview.appspot.com//10359003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7288 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-03 15:40:40 +00:00
floitsch@google.com a8e31e2a48 Revert "Set the TZ env to get the UTC-ms since epoch."
This reverts commit 7285.

Review URL: https://chromiumcodereview.appspot.com//10354011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7287 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-03 14:54:09 +00:00
floitsch@google.com 9cf8b9a36d Set the TZ env to get the UTC-ms since epoch.
Previously we tried to simply subtract the timezone difference from
the local value. Apparently this doesn't work...

Fixes issue 1268.

Review URL: https://chromiumcodereview.appspot.com//9969098

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7285 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-03 14:46:21 +00:00
sgjesse@google.com 65896148c9 Move utils.h and utils.cc from runtime/vm to runtime/platform
Moved additional parts of globals.h from vm/ to platform/ to support
types and constants used by utils.*.

R=ager@google.com, iposva@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//9209001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3337 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-16 13:23:40 +00:00
sgjesse@google.com bf67f24098 Move assert.h/assert.cc from runtime/vm to runtime/platform
The purpose of this change is twofold:

1. Source in the bin directory can now use the same assertions as
   source in the vm directory. The ASSERT macro used by the code
   in runtime/bin was just defined to use assert from the standard
   C library.
2. Moving other implementation parts from runtime/vm to
   runtime/platform (e.g. classes Monitor and Mutex) for sharing
   between runtime/bin and runtime/vm will be easier as these
   implementations rely on these assertion macros.

Created two gypi files for the platform directory. One for the
headers and one for the source. The source one is only included
when building the VM library and will be present in libdart.a
when the dart executable is linked.

All the code for asserts is still in the dart namespace.

Also re-arranged the order of includes to be alphabetically in
the files touched.

R=ager@google.com, iposva@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//9189003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3335 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-16 12:28:10 +00:00
floitsch@google.com 15727ed074 Rename DateTime to Date.
Review URL: https://chromereviews.googleplex.com/3529013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@107 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 10:14:49 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00