OLD | NEW |
1 # Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 # Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 # For date.js. | 55 # For date.js. |
56 const HoursPerDay = 24; | 56 const HoursPerDay = 24; |
57 const MinutesPerHour = 60; | 57 const MinutesPerHour = 60; |
58 const SecondsPerMinute = 60; | 58 const SecondsPerMinute = 60; |
59 const msPerSecond = 1000; | 59 const msPerSecond = 1000; |
60 const msPerMinute = 60000; | 60 const msPerMinute = 60000; |
61 const msPerHour = 3600000; | 61 const msPerHour = 3600000; |
62 const msPerDay = 86400000; | 62 const msPerDay = 86400000; |
63 | 63 |
| 64 # For apinatives.js |
| 65 const kUninitialized = -1; |
| 66 |
64 # Note: kDayZeroInJulianDay = ToJulianDay(1970, 0, 1). | 67 # Note: kDayZeroInJulianDay = ToJulianDay(1970, 0, 1). |
65 const kInvalidDate = 'Invalid Date'; | 68 const kInvalidDate = 'Invalid Date'; |
66 const kDayZeroInJulianDay = 2440588; | 69 const kDayZeroInJulianDay = 2440588; |
67 const kMonthMask = 0x1e0; | 70 const kMonthMask = 0x1e0; |
68 const kDayMask = 0x01f; | 71 const kDayMask = 0x01f; |
69 const kYearShift = 9; | 72 const kYearShift = 9; |
70 const kMonthShift = 5; | 73 const kMonthShift = 5; |
71 | 74 |
72 # Type query macros. | 75 # Type query macros. |
73 macro IS_NULL(arg) = (arg === null); | 76 macro IS_NULL(arg) = (arg === null); |
(...skipping 15 matching lines...) Expand all Loading... |
89 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); | 92 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); |
90 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToInteger(arg)); | 93 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToInteger(arg)); |
91 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToInt32(arg)); | 94 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToInt32(arg)); |
92 | 95 |
93 # Macros implemented in Python. | 96 # Macros implemented in Python. |
94 python macro CHAR_CODE(str) = ord(str[1]); | 97 python macro CHAR_CODE(str) = ord(str[1]); |
95 | 98 |
96 # Accessors for original global properties that ensure they have been loaded. | 99 # Accessors for original global properties that ensure they have been loaded. |
97 const ORIGINAL_REGEXP = (global.RegExp, $RegExp); | 100 const ORIGINAL_REGEXP = (global.RegExp, $RegExp); |
98 const ORIGINAL_DATE = (global.Date, $Date); | 101 const ORIGINAL_DATE = (global.Date, $Date); |
OLD | NEW |