| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 5382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5393 double value = HeapNumber::cast(obj)->value(); | 5393 double value = HeapNumber::cast(obj)->value(); |
| 5394 int int_value = FastD2I(value); | 5394 int int_value = FastD2I(value); |
| 5395 if (value == FastI2D(int_value) && Smi::IsValid(int_value)) { | 5395 if (value == FastI2D(int_value) && Smi::IsValid(int_value)) { |
| 5396 return Smi::FromInt(int_value); | 5396 return Smi::FromInt(int_value); |
| 5397 } | 5397 } |
| 5398 } | 5398 } |
| 5399 return Heap::nan_value(); | 5399 return Heap::nan_value(); |
| 5400 } | 5400 } |
| 5401 | 5401 |
| 5402 | 5402 |
| 5403 static MaybeObject* Runtime_WriteBufferOverflow(Arguments args) { |
| 5404 WriteBuffer::Compact(); |
| 5405 return Heap::undefined_value(); |
| 5406 } |
| 5407 |
| 5408 |
| 5403 static MaybeObject* Runtime_AllocateHeapNumber(Arguments args) { | 5409 static MaybeObject* Runtime_AllocateHeapNumber(Arguments args) { |
| 5404 NoHandleAllocation ha; | 5410 NoHandleAllocation ha; |
| 5405 ASSERT(args.length() == 0); | 5411 ASSERT(args.length() == 0); |
| 5406 return Heap::AllocateHeapNumber(0); | 5412 return Heap::AllocateHeapNumber(0); |
| 5407 } | 5413 } |
| 5408 | 5414 |
| 5409 | 5415 |
| 5410 static MaybeObject* Runtime_NumberAdd(Arguments args) { | 5416 static MaybeObject* Runtime_NumberAdd(Arguments args) { |
| 5411 NoHandleAllocation ha; | 5417 NoHandleAllocation ha; |
| 5412 ASSERT(args.length() == 2); | 5418 ASSERT(args.length() == 2); |
| (...skipping 5383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10796 } else { | 10802 } else { |
| 10797 // Handle last resort GC and make sure to allow future allocations | 10803 // Handle last resort GC and make sure to allow future allocations |
| 10798 // to grow the heap without causing GCs (if possible). | 10804 // to grow the heap without causing GCs (if possible). |
| 10799 Counters::gc_last_resort_from_js.Increment(); | 10805 Counters::gc_last_resort_from_js.Increment(); |
| 10800 Heap::CollectAllGarbage(false); | 10806 Heap::CollectAllGarbage(false); |
| 10801 } | 10807 } |
| 10802 } | 10808 } |
| 10803 | 10809 |
| 10804 | 10810 |
| 10805 } } // namespace v8::internal | 10811 } } // namespace v8::internal |
| OLD | NEW |