OLD | NEW |
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 7080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7091 | 7091 |
7092 static Object* Runtime_DateDaylightSavingsOffset(Arguments args) { | 7092 static Object* Runtime_DateDaylightSavingsOffset(Arguments args) { |
7093 NoHandleAllocation ha; | 7093 NoHandleAllocation ha; |
7094 ASSERT(args.length() == 1); | 7094 ASSERT(args.length() == 1); |
7095 | 7095 |
7096 CONVERT_DOUBLE_CHECKED(x, args[0]); | 7096 CONVERT_DOUBLE_CHECKED(x, args[0]); |
7097 return Heap::NumberFromDouble(OS::DaylightSavingsOffset(x)); | 7097 return Heap::NumberFromDouble(OS::DaylightSavingsOffset(x)); |
7098 } | 7098 } |
7099 | 7099 |
7100 | 7100 |
7101 static Object* Runtime_NumberIsFinite(Arguments args) { | |
7102 NoHandleAllocation ha; | |
7103 ASSERT(args.length() == 1); | |
7104 | |
7105 CONVERT_DOUBLE_CHECKED(value, args[0]); | |
7106 Object* result; | |
7107 if (isnan(value) || (fpclassify(value) == FP_INFINITE)) { | |
7108 result = Heap::false_value(); | |
7109 } else { | |
7110 result = Heap::true_value(); | |
7111 } | |
7112 return result; | |
7113 } | |
7114 | |
7115 | |
7116 static Object* Runtime_GlobalReceiver(Arguments args) { | 7101 static Object* Runtime_GlobalReceiver(Arguments args) { |
7117 ASSERT(args.length() == 1); | 7102 ASSERT(args.length() == 1); |
7118 Object* global = args[0]; | 7103 Object* global = args[0]; |
7119 if (!global->IsJSGlobalObject()) return Heap::null_value(); | 7104 if (!global->IsJSGlobalObject()) return Heap::null_value(); |
7120 return JSGlobalObject::cast(global)->global_receiver(); | 7105 return JSGlobalObject::cast(global)->global_receiver(); |
7121 } | 7106 } |
7122 | 7107 |
7123 | 7108 |
7124 static Object* Runtime_CompileString(Arguments args) { | 7109 static Object* Runtime_CompileString(Arguments args) { |
7125 HandleScope scope; | 7110 HandleScope scope; |
(...skipping 2926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10052 } else { | 10037 } else { |
10053 // Handle last resort GC and make sure to allow future allocations | 10038 // Handle last resort GC and make sure to allow future allocations |
10054 // to grow the heap without causing GCs (if possible). | 10039 // to grow the heap without causing GCs (if possible). |
10055 Counters::gc_last_resort_from_js.Increment(); | 10040 Counters::gc_last_resort_from_js.Increment(); |
10056 Heap::CollectAllGarbage(false); | 10041 Heap::CollectAllGarbage(false); |
10057 } | 10042 } |
10058 } | 10043 } |
10059 | 10044 |
10060 | 10045 |
10061 } } // namespace v8::internal | 10046 } } // namespace v8::internal |
OLD | NEW |