| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1787 | 1787 |
| 1788 Object* multiline = args[4]; | 1788 Object* multiline = args[4]; |
| 1789 if (!multiline->IsTrue()) multiline = isolate->heap()->false_value(); | 1789 if (!multiline->IsTrue()) multiline = isolate->heap()->false_value(); |
| 1790 | 1790 |
| 1791 Map* map = regexp->map(); | 1791 Map* map = regexp->map(); |
| 1792 Object* constructor = map->constructor(); | 1792 Object* constructor = map->constructor(); |
| 1793 if (constructor->IsJSFunction() && | 1793 if (constructor->IsJSFunction() && |
| 1794 JSFunction::cast(constructor)->initial_map() == map) { | 1794 JSFunction::cast(constructor)->initial_map() == map) { |
| 1795 // If we still have the original map, set in-object properties directly. | 1795 // If we still have the original map, set in-object properties directly. |
| 1796 regexp->InObjectPropertyAtPut(JSRegExp::kSourceFieldIndex, source); | 1796 regexp->InObjectPropertyAtPut(JSRegExp::kSourceFieldIndex, source); |
| 1797 // TODO(lrn): Consider skipping write barrier on booleans as well. | 1797 // Both true and false are immovable immortal objects so no need for write |
| 1798 // Both true and false should be in oldspace at all times. | 1798 // barrier. |
| 1799 regexp->InObjectPropertyAtPut(JSRegExp::kGlobalFieldIndex, global); | 1799 regexp->InObjectPropertyAtPut( |
| 1800 regexp->InObjectPropertyAtPut(JSRegExp::kIgnoreCaseFieldIndex, ignoreCase); | 1800 JSRegExp::kGlobalFieldIndex, global, SKIP_WRITE_BARRIER); |
| 1801 regexp->InObjectPropertyAtPut(JSRegExp::kMultilineFieldIndex, multiline); | 1801 regexp->InObjectPropertyAtPut( |
| 1802 JSRegExp::kIgnoreCaseFieldIndex, ignoreCase, SKIP_WRITE_BARRIER); |
| 1803 regexp->InObjectPropertyAtPut( |
| 1804 JSRegExp::kMultilineFieldIndex, multiline, SKIP_WRITE_BARRIER); |
| 1802 regexp->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex, | 1805 regexp->InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex, |
| 1803 Smi::FromInt(0), | 1806 Smi::FromInt(0), |
| 1804 SKIP_WRITE_BARRIER); // It's a Smi. | 1807 SKIP_WRITE_BARRIER); // It's a Smi. |
| 1805 return regexp; | 1808 return regexp; |
| 1806 } | 1809 } |
| 1807 | 1810 |
| 1808 // Map has changed, so use generic, but slower, method. | 1811 // Map has changed, so use generic, but slower, method. |
| 1809 PropertyAttributes final = | 1812 PropertyAttributes final = |
| 1810 static_cast<PropertyAttributes>(READ_ONLY | DONT_ENUM | DONT_DELETE); | 1813 static_cast<PropertyAttributes>(READ_ONLY | DONT_ENUM | DONT_DELETE); |
| 1811 PropertyAttributes writable = | 1814 PropertyAttributes writable = |
| (...skipping 11725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13537 } else { | 13540 } else { |
| 13538 // Handle last resort GC and make sure to allow future allocations | 13541 // Handle last resort GC and make sure to allow future allocations |
| 13539 // to grow the heap without causing GCs (if possible). | 13542 // to grow the heap without causing GCs (if possible). |
| 13540 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13543 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13541 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); | 13544 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); |
| 13542 } | 13545 } |
| 13543 } | 13546 } |
| 13544 | 13547 |
| 13545 | 13548 |
| 13546 } } // namespace v8::internal | 13549 } } // namespace v8::internal |
| OLD | NEW |