| 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 7641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7652 } | 7652 } |
| 7653 iter.Advance(); | 7653 iter.Advance(); |
| 7654 } | 7654 } |
| 7655 | 7655 |
| 7656 result->set_length(Smi::FromInt(cursor), SKIP_WRITE_BARRIER); | 7656 result->set_length(Smi::FromInt(cursor), SKIP_WRITE_BARRIER); |
| 7657 | 7657 |
| 7658 return *result; | 7658 return *result; |
| 7659 } | 7659 } |
| 7660 | 7660 |
| 7661 | 7661 |
| 7662 // Returns V8 version as a string. |
| 7663 static Object* Runtime_GetV8Version(Arguments args) { |
| 7664 ASSERT_EQ(args.length(), 0); |
| 7665 |
| 7666 NoHandleAllocation ha; |
| 7667 |
| 7668 const char* version_string = v8::V8::GetVersion(); |
| 7669 |
| 7670 return Heap::AllocateStringFromAscii(CStrVector(version_string), NOT_TENURED); |
| 7671 } |
| 7672 |
| 7673 |
| 7662 static Object* Runtime_Abort(Arguments args) { | 7674 static Object* Runtime_Abort(Arguments args) { |
| 7663 ASSERT(args.length() == 2); | 7675 ASSERT(args.length() == 2); |
| 7664 OS::PrintError("abort: %s\n", reinterpret_cast<char*>(args[0]) + | 7676 OS::PrintError("abort: %s\n", reinterpret_cast<char*>(args[0]) + |
| 7665 Smi::cast(args[1])->value()); | 7677 Smi::cast(args[1])->value()); |
| 7666 Top::PrintStack(); | 7678 Top::PrintStack(); |
| 7667 OS::Abort(); | 7679 OS::Abort(); |
| 7668 UNREACHABLE(); | 7680 UNREACHABLE(); |
| 7669 return NULL; | 7681 return NULL; |
| 7670 } | 7682 } |
| 7671 | 7683 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7751 } else { | 7763 } else { |
| 7752 // Handle last resort GC and make sure to allow future allocations | 7764 // Handle last resort GC and make sure to allow future allocations |
| 7753 // to grow the heap without causing GCs (if possible). | 7765 // to grow the heap without causing GCs (if possible). |
| 7754 Counters::gc_last_resort_from_js.Increment(); | 7766 Counters::gc_last_resort_from_js.Increment(); |
| 7755 Heap::CollectAllGarbage(false); | 7767 Heap::CollectAllGarbage(false); |
| 7756 } | 7768 } |
| 7757 } | 7769 } |
| 7758 | 7770 |
| 7759 | 7771 |
| 7760 } } // namespace v8::internal | 7772 } } // namespace v8::internal |
| OLD | NEW |