Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: src/macros.py

Issue 661366: Rewrite MakeDay function from JS to C++. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright 2006-2009 the V8 project authors. All rights reserved. 1 # Copyright 2006-2009 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 const kUninitialized = -1; 66 const kUninitialized = -1;
67 67
68 # Note: kDayZeroInJulianDay = ToJulianDay(1970, 0, 1). 68 # Note: kDayZeroInJulianDay = ToJulianDay(1970, 0, 1).
69 const kInvalidDate = 'Invalid Date'; 69 const kInvalidDate = 'Invalid Date';
70 const kDayZeroInJulianDay = 2440588; 70 const kDayZeroInJulianDay = 2440588;
71 const kMonthMask = 0x1e0; 71 const kMonthMask = 0x1e0;
72 const kDayMask = 0x01f; 72 const kDayMask = 0x01f;
73 const kYearShift = 9; 73 const kYearShift = 9;
74 const kMonthShift = 5; 74 const kMonthShift = 5;
75 75
76 # Limits for parts of the date, so that we support all the dates that
77 # ECMA 262 - 15.9.1.1 requires us to, but at the same time be sure that
78 # the date (days since 1970) is in SMI range.
79 const kMinYear = -1000000;
80 const kMaxYear = 1000000;
81 const kMinMonth = -10000000;
82 const kMaxMonth = 10000000;
83 const kMinDate = -100000000;
84 const kMaxDate = 100000000;
85
76 # Type query macros. 86 # Type query macros.
77 # 87 #
78 # Note: We have special support for typeof(foo) === 'bar' in the compiler. 88 # Note: We have special support for typeof(foo) === 'bar' in the compiler.
79 # It will *not* generate a runtime typeof call for the most important 89 # It will *not* generate a runtime typeof call for the most important
80 # values of 'bar'. 90 # values of 'bar'.
81 macro IS_NULL(arg) = (arg === null); 91 macro IS_NULL(arg) = (arg === null);
82 macro IS_NULL_OR_UNDEFINED(arg) = (arg == null); 92 macro IS_NULL_OR_UNDEFINED(arg) = (arg == null);
83 macro IS_UNDEFINED(arg) = (typeof(arg) === 'undefined'); 93 macro IS_UNDEFINED(arg) = (typeof(arg) === 'undefined');
84 macro IS_NUMBER(arg) = (typeof(arg) === 'number'); 94 macro IS_NUMBER(arg) = (typeof(arg) === 'number');
85 macro IS_STRING(arg) = (typeof(arg) === 'string'); 95 macro IS_STRING(arg) = (typeof(arg) === 'string');
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 macro MS_FROM_TIME(time) = (Modulo(time, 1000)); 145 macro MS_FROM_TIME(time) = (Modulo(time, 1000));
136 146
137 # Last input and last subject of regexp matches. 147 # Last input and last subject of regexp matches.
138 macro LAST_SUBJECT(array) = ((array)[1]); 148 macro LAST_SUBJECT(array) = ((array)[1]);
139 macro LAST_INPUT(array) = ((array)[2]); 149 macro LAST_INPUT(array) = ((array)[2]);
140 150
141 # REGEXP_FIRST_CAPTURE 151 # REGEXP_FIRST_CAPTURE
142 macro CAPTURE(index) = (3 + (index)); 152 macro CAPTURE(index) = (3 + (index));
143 const CAPTURE0 = 3; 153 const CAPTURE0 = 3;
144 const CAPTURE1 = 4; 154 const CAPTURE1 = 4;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698