OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1777 if (trace_scope_ != NULL) { | 1777 if (trace_scope_ != NULL) { |
1778 PrintF(trace_scope_->file(), | 1778 PrintF(trace_scope_->file(), |
1779 "Materialized a new heap number %p [%e] in slot %p\n", | 1779 "Materialized a new heap number %p [%e] in slot %p\n", |
1780 reinterpret_cast<void*>(*num), | 1780 reinterpret_cast<void*>(*num), |
1781 d.value(), | 1781 d.value(), |
1782 d.destination()); | 1782 d.destination()); |
1783 } | 1783 } |
1784 Memory::Object_at(d.destination()) = *num; | 1784 Memory::Object_at(d.destination()) = *num; |
1785 } | 1785 } |
1786 | 1786 |
| 1787 // Materialize all float32x4 before looking at arguments because when the |
| 1788 // output frames are used to materialize arguments objects later on they need |
| 1789 // to already contain valid float32x4 values. |
| 1790 for (int i = 0; i < deferred_float32x4s_.length(); i++) { |
| 1791 Float32x4MaterializationDescriptor<Address> d = deferred_float32x4s_[i]; |
| 1792 Handle<Object> float32x4 = isolate_->factory()->NewFloat32x4(d.value()); |
| 1793 if (trace_scope_ != NULL) { |
| 1794 PrintF(trace_scope_->file(), |
| 1795 "Materialized a new float32x4 %p " |
| 1796 "[float32x4(%e, %e, %e, %e)] in slot %p\n", |
| 1797 reinterpret_cast<void*>(*float32x4), |
| 1798 d.value().storage[0], d.value().storage[1], |
| 1799 d.value().storage[2], d.value().storage[3], |
| 1800 d.destination()); |
| 1801 } |
| 1802 Memory::Object_at(d.destination()) = *float32x4; |
| 1803 } |
| 1804 |
| 1805 // Materialize all int32x4 before looking at arguments because when the |
| 1806 // output frames are used to materialize arguments objects later on they need |
| 1807 // to already contain valid int32x4 values. |
| 1808 for (int i = 0; i < deferred_int32x4s_.length(); i++) { |
| 1809 Int32x4MaterializationDescriptor<Address> d = deferred_int32x4s_[i]; |
| 1810 Handle<Object> int32x4 = isolate_->factory()->NewInt32x4(d.value()); |
| 1811 if (trace_scope_ != NULL) { |
| 1812 PrintF(trace_scope_->file(), |
| 1813 "Materialized a new int32x4 %p " |
| 1814 "[int32x4(%u, %u, %u, %u)] in slot %p\n", |
| 1815 reinterpret_cast<void*>(*int32x4), |
| 1816 d.value().storage[0], d.value().storage[1], |
| 1817 d.value().storage[2], d.value().storage[3], |
| 1818 d.destination()); |
| 1819 } |
| 1820 Memory::Object_at(d.destination()) = *int32x4; |
| 1821 } |
| 1822 |
| 1823 |
1787 // Materialize all heap numbers required for arguments/captured objects. | 1824 // Materialize all heap numbers required for arguments/captured objects. |
1788 for (int i = 0; i < deferred_objects_double_values_.length(); i++) { | 1825 for (int i = 0; i < deferred_objects_double_values_.length(); i++) { |
1789 HeapNumberMaterializationDescriptor<int> d = | 1826 HeapNumberMaterializationDescriptor<int> d = |
1790 deferred_objects_double_values_[i]; | 1827 deferred_objects_double_values_[i]; |
1791 Handle<Object> num = isolate_->factory()->NewNumber(d.value()); | 1828 Handle<Object> num = isolate_->factory()->NewNumber(d.value()); |
1792 if (trace_scope_ != NULL) { | 1829 if (trace_scope_ != NULL) { |
1793 PrintF(trace_scope_->file(), | 1830 PrintF(trace_scope_->file(), |
1794 "Materialized a new heap number %p [%e] for object at %d\n", | 1831 "Materialized a new heap number %p [%e] for object at %d\n", |
1795 reinterpret_cast<void*>(*num), | 1832 reinterpret_cast<void*>(*num), |
1796 d.value(), | 1833 d.value(), |
1797 d.destination()); | 1834 d.destination()); |
1798 } | 1835 } |
1799 ASSERT(values.at(d.destination())->IsTheHole()); | 1836 ASSERT(values.at(d.destination())->IsTheHole()); |
1800 values.Set(d.destination(), num); | 1837 values.Set(d.destination(), num); |
1801 } | 1838 } |
1802 | 1839 |
1803 // Play it safe and clear all object double values before we continue. | 1840 // Play it safe and clear all object double values before we continue. |
1804 deferred_objects_double_values_.Clear(); | 1841 deferred_objects_double_values_.Clear(); |
1805 | 1842 |
| 1843 // Materialize all float32x4 values required for arguments/captured objects. |
| 1844 for (int i = 0; i < deferred_objects_float32x4_values_.length(); i++) { |
| 1845 Float32x4MaterializationDescriptor<int> d = |
| 1846 deferred_objects_float32x4_values_[i]; |
| 1847 Handle<Object> float32x4 = isolate_->factory()->NewFloat32x4(d.value()); |
| 1848 if (trace_scope_ != NULL) { |
| 1849 PrintF(trace_scope_->file(), |
| 1850 "Materialized a new float32x4 %p " |
| 1851 "[float32x4(%e, %e, %e, %e)] for object at %d\n", |
| 1852 reinterpret_cast<void*>(*float32x4), |
| 1853 d.value().storage[0], d.value().storage[1], |
| 1854 d.value().storage[2], d.value().storage[3], |
| 1855 d.destination()); |
| 1856 } |
| 1857 ASSERT(values.at(d.destination())->IsTheHole()); |
| 1858 values.Set(d.destination(), float32x4); |
| 1859 } |
| 1860 |
| 1861 // Play it safe and clear all object float32x4 values before we continue. |
| 1862 deferred_objects_float32x4_values_.Clear(); |
| 1863 |
| 1864 // Materialize all int32x4 values required for arguments/captured objects. |
| 1865 for (int i = 0; i < deferred_objects_int32x4_values_.length(); i++) { |
| 1866 Int32x4MaterializationDescriptor<int> d = |
| 1867 deferred_objects_int32x4_values_[i]; |
| 1868 Handle<Object> int32x4 = isolate_->factory()->NewInt32x4(d.value()); |
| 1869 if (trace_scope_ != NULL) { |
| 1870 PrintF(trace_scope_->file(), |
| 1871 "Materialized a new int32x4 %p " |
| 1872 "[int32x4(%u, %u, %u, %u)] for object at %d\n", |
| 1873 reinterpret_cast<void*>(*int32x4), |
| 1874 d.value().storage[0], d.value().storage[1], |
| 1875 d.value().storage[2], d.value().storage[3], |
| 1876 d.destination()); |
| 1877 } |
| 1878 ASSERT(values.at(d.destination())->IsTheHole()); |
| 1879 values.Set(d.destination(), int32x4); |
| 1880 } |
| 1881 |
| 1882 // Play it safe and clear all object int32x4 values before we continue. |
| 1883 deferred_objects_int32x4_values_.Clear(); |
| 1884 |
1806 // Materialize arguments/captured objects. | 1885 // Materialize arguments/captured objects. |
1807 if (!deferred_objects_.is_empty()) { | 1886 if (!deferred_objects_.is_empty()) { |
1808 List<Handle<Object> > materialized_objects(deferred_objects_.length()); | 1887 List<Handle<Object> > materialized_objects(deferred_objects_.length()); |
1809 materialized_objects_ = &materialized_objects; | 1888 materialized_objects_ = &materialized_objects; |
1810 materialized_values_ = &values; | 1889 materialized_values_ = &values; |
1811 | 1890 |
1812 while (materialization_object_index_ < deferred_objects_.length()) { | 1891 while (materialization_object_index_ < deferred_objects_.length()) { |
1813 int object_index = materialization_object_index_; | 1892 int object_index = materialization_object_index_; |
1814 ObjectMaterializationDescriptor descriptor = | 1893 ObjectMaterializationDescriptor descriptor = |
1815 deferred_objects_.at(object_index); | 1894 deferred_objects_.at(object_index); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2007 reinterpret_cast<intptr_t>(object_slot), | 2086 reinterpret_cast<intptr_t>(object_slot), |
2008 field_index); | 2087 field_index); |
2009 PrintF(trace_scope_->file(), | 2088 PrintF(trace_scope_->file(), |
2010 "%e ; %s\n", value, | 2089 "%e ; %s\n", value, |
2011 DoubleRegister::AllocationIndexToString(input_reg)); | 2090 DoubleRegister::AllocationIndexToString(input_reg)); |
2012 } | 2091 } |
2013 AddObjectDoubleValue(value); | 2092 AddObjectDoubleValue(value); |
2014 return; | 2093 return; |
2015 } | 2094 } |
2016 | 2095 |
| 2096 case Translation::FLOAT32x4_REGISTER: { |
| 2097 int input_reg = iterator->Next(); |
| 2098 float32x4_value_t value = input_->GetFloat32x4Register(input_reg); |
| 2099 if (trace_scope_ != NULL) { |
| 2100 PrintF(trace_scope_->file(), |
| 2101 " object @0x%08" V8PRIxPTR ": [field #%d] <- ", |
| 2102 reinterpret_cast<intptr_t>(object_slot), |
| 2103 field_index); |
| 2104 PrintF(trace_scope_->file(), |
| 2105 "float32x4(%e, %e, %e, %e) ; %s\n", value.storage[0], |
| 2106 value.storage[1], value.storage[2], value.storage[3], |
| 2107 Float32x4Register::AllocationIndexToString(input_reg)); |
| 2108 } |
| 2109 AddObjectFloat32x4Value(value); |
| 2110 return; |
| 2111 } |
| 2112 |
| 2113 case Translation::INT32x4_REGISTER: { |
| 2114 int input_reg = iterator->Next(); |
| 2115 int32x4_value_t value = input_->GetInt32x4Register(input_reg); |
| 2116 if (trace_scope_ != NULL) { |
| 2117 PrintF(trace_scope_->file(), |
| 2118 " object @0x%08" V8PRIxPTR ": [field #%d] <- ", |
| 2119 reinterpret_cast<intptr_t>(object_slot), |
| 2120 field_index); |
| 2121 PrintF(trace_scope_->file(), |
| 2122 "int32x4(%u, %u, %u, %u) ; %s\n", value.storage[0], |
| 2123 value.storage[1], value.storage[2], value.storage[3], |
| 2124 Int32x4Register::AllocationIndexToString(input_reg)); |
| 2125 } |
| 2126 AddObjectInt32x4Value(value); |
| 2127 return; |
| 2128 } |
| 2129 |
2017 case Translation::STACK_SLOT: { | 2130 case Translation::STACK_SLOT: { |
2018 int input_slot_index = iterator->Next(); | 2131 int input_slot_index = iterator->Next(); |
2019 unsigned input_offset = input_->GetOffsetFromSlotIndex(input_slot_index); | 2132 unsigned input_offset = input_->GetOffsetFromSlotIndex(input_slot_index); |
2020 intptr_t input_value = input_->GetFrameSlot(input_offset); | 2133 intptr_t input_value = input_->GetFrameSlot(input_offset); |
2021 if (trace_scope_ != NULL) { | 2134 if (trace_scope_ != NULL) { |
2022 PrintF(trace_scope_->file(), | 2135 PrintF(trace_scope_->file(), |
2023 " object @0x%08" V8PRIxPTR ": [field #%d] <- ", | 2136 " object @0x%08" V8PRIxPTR ": [field #%d] <- ", |
2024 reinterpret_cast<intptr_t>(object_slot), | 2137 reinterpret_cast<intptr_t>(object_slot), |
2025 field_index); | 2138 field_index); |
2026 PrintF(trace_scope_->file(), | 2139 PrintF(trace_scope_->file(), |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2094 " object @0x%08" V8PRIxPTR ": [field #%d] <- ", | 2207 " object @0x%08" V8PRIxPTR ": [field #%d] <- ", |
2095 reinterpret_cast<intptr_t>(object_slot), | 2208 reinterpret_cast<intptr_t>(object_slot), |
2096 field_index); | 2209 field_index); |
2097 PrintF(trace_scope_->file(), | 2210 PrintF(trace_scope_->file(), |
2098 "%e ; [sp + %d]\n", value, input_offset); | 2211 "%e ; [sp + %d]\n", value, input_offset); |
2099 } | 2212 } |
2100 AddObjectDoubleValue(value); | 2213 AddObjectDoubleValue(value); |
2101 return; | 2214 return; |
2102 } | 2215 } |
2103 | 2216 |
| 2217 case Translation::FLOAT32x4_STACK_SLOT: { |
| 2218 int input_slot_index = iterator->Next(); |
| 2219 unsigned input_offset = input_->GetOffsetFromSlotIndex(input_slot_index); |
| 2220 float32x4_value_t value = input_->GetFloat32x4FrameSlot(input_offset); |
| 2221 if (trace_scope_ != NULL) { |
| 2222 PrintF(trace_scope_->file(), |
| 2223 " object @0x%08" V8PRIxPTR ": [field #%d] <- ", |
| 2224 reinterpret_cast<intptr_t>(object_slot), |
| 2225 field_index); |
| 2226 PrintF(trace_scope_->file(), |
| 2227 "float32x4(%e, %e, %e, %e) ; [sp + %d]\n", |
| 2228 value.storage[0], value.storage[1], value.storage[2], |
| 2229 value.storage[3], input_offset); |
| 2230 } |
| 2231 AddObjectFloat32x4Value(value); |
| 2232 return; |
| 2233 } |
| 2234 |
| 2235 case Translation::INT32x4_STACK_SLOT: { |
| 2236 int input_slot_index = iterator->Next(); |
| 2237 unsigned input_offset = input_->GetOffsetFromSlotIndex(input_slot_index); |
| 2238 int32x4_value_t value = input_->GetInt32x4FrameSlot(input_offset); |
| 2239 if (trace_scope_ != NULL) { |
| 2240 PrintF(trace_scope_->file(), |
| 2241 " object @0x%08" V8PRIxPTR ": [field #%d] <- ", |
| 2242 reinterpret_cast<intptr_t>(object_slot), |
| 2243 field_index); |
| 2244 PrintF(trace_scope_->file(), |
| 2245 "int32x4(%u, %u, %u, %u) ; [sp + %d]\n", |
| 2246 value.storage[0], value.storage[1], value.storage[2], |
| 2247 value.storage[3], input_offset); |
| 2248 } |
| 2249 AddObjectInt32x4Value(value); |
| 2250 return; |
| 2251 } |
| 2252 |
2104 case Translation::LITERAL: { | 2253 case Translation::LITERAL: { |
2105 Object* literal = ComputeLiteral(iterator->Next()); | 2254 Object* literal = ComputeLiteral(iterator->Next()); |
2106 if (trace_scope_ != NULL) { | 2255 if (trace_scope_ != NULL) { |
2107 PrintF(trace_scope_->file(), | 2256 PrintF(trace_scope_->file(), |
2108 " object @0x%08" V8PRIxPTR ": [field #%d] <- ", | 2257 " object @0x%08" V8PRIxPTR ": [field #%d] <- ", |
2109 reinterpret_cast<intptr_t>(object_slot), | 2258 reinterpret_cast<intptr_t>(object_slot), |
2110 field_index); | 2259 field_index); |
2111 literal->ShortPrint(trace_scope_->file()); | 2260 literal->ShortPrint(trace_scope_->file()); |
2112 PrintF(trace_scope_->file(), | 2261 PrintF(trace_scope_->file(), |
2113 " ; literal\n"); | 2262 " ; literal\n"); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2276 value, | 2425 value, |
2277 DoubleRegister::AllocationIndexToString(input_reg)); | 2426 DoubleRegister::AllocationIndexToString(input_reg)); |
2278 } | 2427 } |
2279 // We save the untagged value on the side and store a GC-safe | 2428 // We save the untagged value on the side and store a GC-safe |
2280 // temporary placeholder in the frame. | 2429 // temporary placeholder in the frame. |
2281 AddDoubleValue(output_[frame_index]->GetTop() + output_offset, value); | 2430 AddDoubleValue(output_[frame_index]->GetTop() + output_offset, value); |
2282 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); | 2431 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); |
2283 return; | 2432 return; |
2284 } | 2433 } |
2285 | 2434 |
| 2435 case Translation::FLOAT32x4_REGISTER: { |
| 2436 int input_reg = iterator->Next(); |
| 2437 float32x4_value_t value = input_->GetFloat32x4Register(input_reg); |
| 2438 if (trace_scope_ != NULL) { |
| 2439 PrintF(trace_scope_->file(), |
| 2440 " 0x%08" V8PRIxPTR ":" |
| 2441 " [top + %d] <- float32x4(%e, %e, %e, %e) ; %s\n", |
| 2442 output_[frame_index]->GetTop() + output_offset, |
| 2443 output_offset, |
| 2444 value.storage[0], value.storage[1], |
| 2445 value.storage[2], value.storage[3], |
| 2446 Float32x4Register::AllocationIndexToString(input_reg)); |
| 2447 } |
| 2448 // We save the untagged value on the side and store a GC-safe |
| 2449 // temporary placeholder in the frame. |
| 2450 AddFloat32x4Value(output_[frame_index]->GetTop() + output_offset, value); |
| 2451 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); |
| 2452 return; |
| 2453 } |
| 2454 |
| 2455 case Translation::INT32x4_REGISTER: { |
| 2456 int input_reg = iterator->Next(); |
| 2457 int32x4_value_t value = input_->GetInt32x4Register(input_reg); |
| 2458 if (trace_scope_ != NULL) { |
| 2459 PrintF(trace_scope_->file(), |
| 2460 " 0x%08" V8PRIxPTR ":" |
| 2461 " [top + %d] <- int32x4(%u, %u, %u, %u) ; %s\n", |
| 2462 output_[frame_index]->GetTop() + output_offset, |
| 2463 output_offset, |
| 2464 value.storage[0], value.storage[1], |
| 2465 value.storage[2], value.storage[3], |
| 2466 Int32x4Register::AllocationIndexToString(input_reg)); |
| 2467 } |
| 2468 // We save the untagged value on the side and store a GC-safe |
| 2469 // temporary placeholder in the frame. |
| 2470 AddInt32x4Value(output_[frame_index]->GetTop() + output_offset, value); |
| 2471 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); |
| 2472 return; |
| 2473 } |
| 2474 |
2286 case Translation::STACK_SLOT: { | 2475 case Translation::STACK_SLOT: { |
2287 int input_slot_index = iterator->Next(); | 2476 int input_slot_index = iterator->Next(); |
2288 unsigned input_offset = input_->GetOffsetFromSlotIndex(input_slot_index); | 2477 unsigned input_offset = input_->GetOffsetFromSlotIndex(input_slot_index); |
2289 intptr_t input_value = input_->GetFrameSlot(input_offset); | 2478 intptr_t input_value = input_->GetFrameSlot(input_offset); |
2290 if (trace_scope_ != NULL) { | 2479 if (trace_scope_ != NULL) { |
2291 PrintF(trace_scope_->file(), | 2480 PrintF(trace_scope_->file(), |
2292 " 0x%08" V8PRIxPTR ": ", | 2481 " 0x%08" V8PRIxPTR ": ", |
2293 output_[frame_index]->GetTop() + output_offset); | 2482 output_[frame_index]->GetTop() + output_offset); |
2294 PrintF(trace_scope_->file(), | 2483 PrintF(trace_scope_->file(), |
2295 "[top + %d] <- 0x%08" V8PRIxPTR " ; [sp + %d] ", | 2484 "[top + %d] <- 0x%08" V8PRIxPTR " ; [sp + %d] ", |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2377 value, | 2566 value, |
2378 input_offset); | 2567 input_offset); |
2379 } | 2568 } |
2380 // We save the untagged value on the side and store a GC-safe | 2569 // We save the untagged value on the side and store a GC-safe |
2381 // temporary placeholder in the frame. | 2570 // temporary placeholder in the frame. |
2382 AddDoubleValue(output_[frame_index]->GetTop() + output_offset, value); | 2571 AddDoubleValue(output_[frame_index]->GetTop() + output_offset, value); |
2383 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); | 2572 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); |
2384 return; | 2573 return; |
2385 } | 2574 } |
2386 | 2575 |
| 2576 case Translation::FLOAT32x4_STACK_SLOT: { |
| 2577 int input_slot_index = iterator->Next(); |
| 2578 unsigned input_offset = input_->GetOffsetFromSlotIndex(input_slot_index); |
| 2579 float32x4_value_t value = input_->GetFloat32x4FrameSlot(input_offset); |
| 2580 if (trace_scope_ != NULL) { |
| 2581 PrintF(trace_scope_->file(), |
| 2582 " 0x%08" V8PRIxPTR ": " |
| 2583 "[top + %d] <- float32x4(%e, %e, %e, %e) ; [sp + %d]\n", |
| 2584 output_[frame_index]->GetTop() + output_offset, |
| 2585 output_offset, |
| 2586 value.storage[0], value.storage[1], |
| 2587 value.storage[2], value.storage[3], |
| 2588 input_offset); |
| 2589 } |
| 2590 // We save the untagged value on the side and store a GC-safe |
| 2591 // temporary placeholder in the frame. |
| 2592 AddFloat32x4Value(output_[frame_index]->GetTop() + output_offset, value); |
| 2593 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); |
| 2594 return; |
| 2595 } |
| 2596 |
| 2597 case Translation::INT32x4_STACK_SLOT: { |
| 2598 int input_slot_index = iterator->Next(); |
| 2599 unsigned input_offset = input_->GetOffsetFromSlotIndex(input_slot_index); |
| 2600 int32x4_value_t value = input_->GetInt32x4FrameSlot(input_offset); |
| 2601 if (trace_scope_ != NULL) { |
| 2602 PrintF(trace_scope_->file(), |
| 2603 " 0x%08" V8PRIxPTR ": " |
| 2604 "[top + %d] <- int32x4(%u, %u, %u, %u) ; [sp + %d]\n", |
| 2605 output_[frame_index]->GetTop() + output_offset, |
| 2606 output_offset, |
| 2607 value.storage[0], value.storage[1], |
| 2608 value.storage[2], value.storage[3], |
| 2609 input_offset); |
| 2610 } |
| 2611 // We save the untagged value on the side and store a GC-safe |
| 2612 // temporary placeholder in the frame. |
| 2613 AddInt32x4Value(output_[frame_index]->GetTop() + output_offset, value); |
| 2614 output_[frame_index]->SetFrameSlot(output_offset, kPlaceholder); |
| 2615 return; |
| 2616 } |
| 2617 |
2387 case Translation::LITERAL: { | 2618 case Translation::LITERAL: { |
2388 Object* literal = ComputeLiteral(iterator->Next()); | 2619 Object* literal = ComputeLiteral(iterator->Next()); |
2389 if (trace_scope_ != NULL) { | 2620 if (trace_scope_ != NULL) { |
2390 PrintF(trace_scope_->file(), | 2621 PrintF(trace_scope_->file(), |
2391 " 0x%08" V8PRIxPTR ": [top + %d] <- ", | 2622 " 0x%08" V8PRIxPTR ": [top + %d] <- ", |
2392 output_[frame_index]->GetTop() + output_offset, | 2623 output_[frame_index]->GetTop() + output_offset, |
2393 output_offset); | 2624 output_offset); |
2394 literal->ShortPrint(trace_scope_->file()); | 2625 literal->ShortPrint(trace_scope_->file()); |
2395 PrintF(trace_scope_->file(), " ; literal\n"); | 2626 PrintF(trace_scope_->file(), " ; literal\n"); |
2396 } | 2627 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2525 | 2756 |
2526 | 2757 |
2527 void Deoptimizer::AddObjectDoubleValue(double value) { | 2758 void Deoptimizer::AddObjectDoubleValue(double value) { |
2528 deferred_objects_tagged_values_.Add(isolate()->heap()->the_hole_value()); | 2759 deferred_objects_tagged_values_.Add(isolate()->heap()->the_hole_value()); |
2529 HeapNumberMaterializationDescriptor<int> value_desc( | 2760 HeapNumberMaterializationDescriptor<int> value_desc( |
2530 deferred_objects_tagged_values_.length() - 1, value); | 2761 deferred_objects_tagged_values_.length() - 1, value); |
2531 deferred_objects_double_values_.Add(value_desc); | 2762 deferred_objects_double_values_.Add(value_desc); |
2532 } | 2763 } |
2533 | 2764 |
2534 | 2765 |
| 2766 void Deoptimizer::AddObjectFloat32x4Value(float32x4_value_t value) { |
| 2767 deferred_objects_tagged_values_.Add(isolate()->heap()->the_hole_value()); |
| 2768 Float32x4MaterializationDescriptor<int> value_desc( |
| 2769 deferred_objects_tagged_values_.length() - 1, value); |
| 2770 deferred_objects_float32x4_values_.Add(value_desc); |
| 2771 } |
| 2772 |
| 2773 |
| 2774 void Deoptimizer::AddObjectInt32x4Value(int32x4_value_t value) { |
| 2775 deferred_objects_tagged_values_.Add(isolate()->heap()->the_hole_value()); |
| 2776 Int32x4MaterializationDescriptor<int> value_desc( |
| 2777 deferred_objects_tagged_values_.length() - 1, value); |
| 2778 deferred_objects_int32x4_values_.Add(value_desc); |
| 2779 } |
| 2780 |
| 2781 |
2535 void Deoptimizer::AddDoubleValue(intptr_t slot_address, double value) { | 2782 void Deoptimizer::AddDoubleValue(intptr_t slot_address, double value) { |
2536 HeapNumberMaterializationDescriptor<Address> value_desc( | 2783 HeapNumberMaterializationDescriptor<Address> value_desc( |
2537 reinterpret_cast<Address>(slot_address), value); | 2784 reinterpret_cast<Address>(slot_address), value); |
2538 deferred_heap_numbers_.Add(value_desc); | 2785 deferred_heap_numbers_.Add(value_desc); |
2539 } | 2786 } |
2540 | 2787 |
2541 | 2788 |
| 2789 void Deoptimizer::AddFloat32x4Value(intptr_t slot_address, |
| 2790 float32x4_value_t value) { |
| 2791 Float32x4MaterializationDescriptor<Address> value_desc( |
| 2792 reinterpret_cast<Address>(slot_address), value); |
| 2793 deferred_float32x4s_.Add(value_desc); |
| 2794 } |
| 2795 |
| 2796 |
| 2797 void Deoptimizer::AddInt32x4Value(intptr_t slot_address, |
| 2798 int32x4_value_t value) { |
| 2799 Int32x4MaterializationDescriptor<Address> value_desc( |
| 2800 reinterpret_cast<Address>(slot_address), value); |
| 2801 deferred_int32x4s_.Add(value_desc); |
| 2802 } |
| 2803 |
| 2804 |
2542 void Deoptimizer::EnsureCodeForDeoptimizationEntry(Isolate* isolate, | 2805 void Deoptimizer::EnsureCodeForDeoptimizationEntry(Isolate* isolate, |
2543 BailoutType type, | 2806 BailoutType type, |
2544 int max_entry_id) { | 2807 int max_entry_id) { |
2545 // We cannot run this if the serializer is enabled because this will | 2808 // We cannot run this if the serializer is enabled because this will |
2546 // cause us to emit relocation information for the external | 2809 // cause us to emit relocation information for the external |
2547 // references. This is fine because the deoptimizer's code section | 2810 // references. This is fine because the deoptimizer's code section |
2548 // isn't meant to be serialized at all. | 2811 // isn't meant to be serialized at all. |
2549 ASSERT(type == EAGER || type == SOFT || type == LAZY); | 2812 ASSERT(type == EAGER || type == SOFT || type == LAZY); |
2550 DeoptimizerData* data = isolate->deoptimizer_data(); | 2813 DeoptimizerData* data = isolate->deoptimizer_data(); |
2551 int entry_count = data->deopt_entry_code_entries_[type]; | 2814 int entry_count = data->deopt_entry_code_entries_[type]; |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2772 buffer_->Add(reg.code(), zone()); | 3035 buffer_->Add(reg.code(), zone()); |
2773 } | 3036 } |
2774 | 3037 |
2775 | 3038 |
2776 void Translation::StoreDoubleRegister(DoubleRegister reg) { | 3039 void Translation::StoreDoubleRegister(DoubleRegister reg) { |
2777 buffer_->Add(DOUBLE_REGISTER, zone()); | 3040 buffer_->Add(DOUBLE_REGISTER, zone()); |
2778 buffer_->Add(DoubleRegister::ToAllocationIndex(reg), zone()); | 3041 buffer_->Add(DoubleRegister::ToAllocationIndex(reg), zone()); |
2779 } | 3042 } |
2780 | 3043 |
2781 | 3044 |
| 3045 void Translation::StoreFloat32x4Register(Float32x4Register reg) { |
| 3046 buffer_->Add(FLOAT32x4_REGISTER, zone()); |
| 3047 buffer_->Add(Float32x4Register::ToAllocationIndex(reg), zone()); |
| 3048 } |
| 3049 |
| 3050 |
| 3051 void Translation::StoreInt32x4Register(Int32x4Register reg) { |
| 3052 buffer_->Add(INT32x4_REGISTER, zone()); |
| 3053 buffer_->Add(Int32x4Register::ToAllocationIndex(reg), zone()); |
| 3054 } |
| 3055 |
| 3056 |
2782 void Translation::StoreStackSlot(int index) { | 3057 void Translation::StoreStackSlot(int index) { |
2783 buffer_->Add(STACK_SLOT, zone()); | 3058 buffer_->Add(STACK_SLOT, zone()); |
2784 buffer_->Add(index, zone()); | 3059 buffer_->Add(index, zone()); |
2785 } | 3060 } |
2786 | 3061 |
2787 | 3062 |
2788 void Translation::StoreInt32StackSlot(int index) { | 3063 void Translation::StoreInt32StackSlot(int index) { |
2789 buffer_->Add(INT32_STACK_SLOT, zone()); | 3064 buffer_->Add(INT32_STACK_SLOT, zone()); |
2790 buffer_->Add(index, zone()); | 3065 buffer_->Add(index, zone()); |
2791 } | 3066 } |
2792 | 3067 |
2793 | 3068 |
2794 void Translation::StoreUint32StackSlot(int index) { | 3069 void Translation::StoreUint32StackSlot(int index) { |
2795 buffer_->Add(UINT32_STACK_SLOT, zone()); | 3070 buffer_->Add(UINT32_STACK_SLOT, zone()); |
2796 buffer_->Add(index, zone()); | 3071 buffer_->Add(index, zone()); |
2797 } | 3072 } |
2798 | 3073 |
2799 | 3074 |
2800 void Translation::StoreDoubleStackSlot(int index) { | 3075 void Translation::StoreDoubleStackSlot(int index) { |
2801 buffer_->Add(DOUBLE_STACK_SLOT, zone()); | 3076 buffer_->Add(DOUBLE_STACK_SLOT, zone()); |
2802 buffer_->Add(index, zone()); | 3077 buffer_->Add(index, zone()); |
2803 } | 3078 } |
2804 | 3079 |
2805 | 3080 |
| 3081 void Translation::StoreFloat32x4StackSlot(int index) { |
| 3082 buffer_->Add(FLOAT32x4_STACK_SLOT, zone()); |
| 3083 buffer_->Add(index, zone()); |
| 3084 } |
| 3085 |
| 3086 |
| 3087 void Translation::StoreInt32x4StackSlot(int index) { |
| 3088 buffer_->Add(INT32x4_STACK_SLOT, zone()); |
| 3089 buffer_->Add(index, zone()); |
| 3090 } |
| 3091 |
| 3092 |
2806 void Translation::StoreLiteral(int literal_id) { | 3093 void Translation::StoreLiteral(int literal_id) { |
2807 buffer_->Add(LITERAL, zone()); | 3094 buffer_->Add(LITERAL, zone()); |
2808 buffer_->Add(literal_id, zone()); | 3095 buffer_->Add(literal_id, zone()); |
2809 } | 3096 } |
2810 | 3097 |
2811 | 3098 |
2812 void Translation::StoreArgumentsObject(bool args_known, | 3099 void Translation::StoreArgumentsObject(bool args_known, |
2813 int args_index, | 3100 int args_index, |
2814 int args_length) { | 3101 int args_length) { |
2815 buffer_->Add(ARGUMENTS_OBJECT, zone()); | 3102 buffer_->Add(ARGUMENTS_OBJECT, zone()); |
2816 buffer_->Add(args_known, zone()); | 3103 buffer_->Add(args_known, zone()); |
2817 buffer_->Add(args_index, zone()); | 3104 buffer_->Add(args_index, zone()); |
2818 buffer_->Add(args_length, zone()); | 3105 buffer_->Add(args_length, zone()); |
2819 } | 3106 } |
2820 | 3107 |
2821 | 3108 |
2822 int Translation::NumberOfOperandsFor(Opcode opcode) { | 3109 int Translation::NumberOfOperandsFor(Opcode opcode) { |
2823 switch (opcode) { | 3110 switch (opcode) { |
2824 case GETTER_STUB_FRAME: | 3111 case GETTER_STUB_FRAME: |
2825 case SETTER_STUB_FRAME: | 3112 case SETTER_STUB_FRAME: |
2826 case DUPLICATED_OBJECT: | 3113 case DUPLICATED_OBJECT: |
2827 case ARGUMENTS_OBJECT: | 3114 case ARGUMENTS_OBJECT: |
2828 case CAPTURED_OBJECT: | 3115 case CAPTURED_OBJECT: |
2829 case REGISTER: | 3116 case REGISTER: |
2830 case INT32_REGISTER: | 3117 case INT32_REGISTER: |
2831 case UINT32_REGISTER: | 3118 case UINT32_REGISTER: |
2832 case DOUBLE_REGISTER: | 3119 case DOUBLE_REGISTER: |
| 3120 case FLOAT32x4_REGISTER: |
| 3121 case INT32x4_REGISTER: |
2833 case STACK_SLOT: | 3122 case STACK_SLOT: |
2834 case INT32_STACK_SLOT: | 3123 case INT32_STACK_SLOT: |
2835 case UINT32_STACK_SLOT: | 3124 case UINT32_STACK_SLOT: |
2836 case DOUBLE_STACK_SLOT: | 3125 case DOUBLE_STACK_SLOT: |
| 3126 case FLOAT32x4_STACK_SLOT: |
| 3127 case INT32x4_STACK_SLOT: |
2837 case LITERAL: | 3128 case LITERAL: |
2838 case COMPILED_STUB_FRAME: | 3129 case COMPILED_STUB_FRAME: |
2839 return 1; | 3130 return 1; |
2840 case BEGIN: | 3131 case BEGIN: |
2841 case ARGUMENTS_ADAPTOR_FRAME: | 3132 case ARGUMENTS_ADAPTOR_FRAME: |
2842 case CONSTRUCT_STUB_FRAME: | 3133 case CONSTRUCT_STUB_FRAME: |
2843 return 2; | 3134 return 2; |
2844 case JS_FRAME: | 3135 case JS_FRAME: |
2845 return 3; | 3136 return 3; |
2846 } | 3137 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2886 case Translation::DUPLICATED_OBJECT: | 3177 case Translation::DUPLICATED_OBJECT: |
2887 case Translation::ARGUMENTS_OBJECT: | 3178 case Translation::ARGUMENTS_OBJECT: |
2888 case Translation::CAPTURED_OBJECT: | 3179 case Translation::CAPTURED_OBJECT: |
2889 // This can be only emitted for local slots not for argument slots. | 3180 // This can be only emitted for local slots not for argument slots. |
2890 break; | 3181 break; |
2891 | 3182 |
2892 case Translation::REGISTER: | 3183 case Translation::REGISTER: |
2893 case Translation::INT32_REGISTER: | 3184 case Translation::INT32_REGISTER: |
2894 case Translation::UINT32_REGISTER: | 3185 case Translation::UINT32_REGISTER: |
2895 case Translation::DOUBLE_REGISTER: | 3186 case Translation::DOUBLE_REGISTER: |
| 3187 case Translation::FLOAT32x4_REGISTER: |
| 3188 case Translation::INT32x4_REGISTER: |
2896 // We are at safepoint which corresponds to call. All registers are | 3189 // We are at safepoint which corresponds to call. All registers are |
2897 // saved by caller so there would be no live registers at this | 3190 // saved by caller so there would be no live registers at this |
2898 // point. Thus these translation commands should not be used. | 3191 // point. Thus these translation commands should not be used. |
2899 break; | 3192 break; |
2900 | 3193 |
2901 case Translation::STACK_SLOT: { | 3194 case Translation::STACK_SLOT: { |
2902 int slot_index = iterator->Next(); | 3195 int slot_index = iterator->Next(); |
2903 Address slot_addr = SlotAddress(frame, slot_index); | 3196 Address slot_addr = SlotAddress(frame, slot_index); |
2904 return SlotRef(slot_addr, SlotRef::TAGGED); | 3197 return SlotRef(slot_addr, SlotRef::TAGGED); |
2905 } | 3198 } |
2906 | 3199 |
2907 case Translation::INT32_STACK_SLOT: { | 3200 case Translation::INT32_STACK_SLOT: { |
2908 int slot_index = iterator->Next(); | 3201 int slot_index = iterator->Next(); |
2909 Address slot_addr = SlotAddress(frame, slot_index); | 3202 Address slot_addr = SlotAddress(frame, slot_index); |
2910 return SlotRef(slot_addr, SlotRef::INT32); | 3203 return SlotRef(slot_addr, SlotRef::INT32); |
2911 } | 3204 } |
2912 | 3205 |
2913 case Translation::UINT32_STACK_SLOT: { | 3206 case Translation::UINT32_STACK_SLOT: { |
2914 int slot_index = iterator->Next(); | 3207 int slot_index = iterator->Next(); |
2915 Address slot_addr = SlotAddress(frame, slot_index); | 3208 Address slot_addr = SlotAddress(frame, slot_index); |
2916 return SlotRef(slot_addr, SlotRef::UINT32); | 3209 return SlotRef(slot_addr, SlotRef::UINT32); |
2917 } | 3210 } |
2918 | 3211 |
2919 case Translation::DOUBLE_STACK_SLOT: { | 3212 case Translation::DOUBLE_STACK_SLOT: { |
2920 int slot_index = iterator->Next(); | 3213 int slot_index = iterator->Next(); |
2921 Address slot_addr = SlotAddress(frame, slot_index); | 3214 Address slot_addr = SlotAddress(frame, slot_index); |
2922 return SlotRef(slot_addr, SlotRef::DOUBLE); | 3215 return SlotRef(slot_addr, SlotRef::DOUBLE); |
2923 } | 3216 } |
2924 | 3217 |
| 3218 case Translation::FLOAT32x4_STACK_SLOT: { |
| 3219 int slot_index = iterator->Next(); |
| 3220 Address slot_addr = SlotAddress(frame, slot_index); |
| 3221 return SlotRef(slot_addr, SlotRef::FLOAT32x4); |
| 3222 } |
| 3223 |
| 3224 case Translation::INT32x4_STACK_SLOT: { |
| 3225 int slot_index = iterator->Next(); |
| 3226 Address slot_addr = SlotAddress(frame, slot_index); |
| 3227 return SlotRef(slot_addr, SlotRef::INT32x4); |
| 3228 } |
| 3229 |
2925 case Translation::LITERAL: { | 3230 case Translation::LITERAL: { |
2926 int literal_index = iterator->Next(); | 3231 int literal_index = iterator->Next(); |
2927 return SlotRef(data->GetIsolate(), | 3232 return SlotRef(data->GetIsolate(), |
2928 data->LiteralArray()->get(literal_index)); | 3233 data->LiteralArray()->get(literal_index)); |
2929 } | 3234 } |
2930 | 3235 |
2931 case Translation::COMPILED_STUB_FRAME: | 3236 case Translation::COMPILED_STUB_FRAME: |
2932 UNREACHABLE(); | 3237 UNREACHABLE(); |
2933 break; | 3238 break; |
2934 } | 3239 } |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3054 | 3359 |
3055 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 3360 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
3056 v->VisitPointer(BitCast<Object**>(&function_)); | 3361 v->VisitPointer(BitCast<Object**>(&function_)); |
3057 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 3362 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
3058 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 3363 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
3059 } | 3364 } |
3060 | 3365 |
3061 #endif // ENABLE_DEBUGGER_SUPPORT | 3366 #endif // ENABLE_DEBUGGER_SUPPORT |
3062 | 3367 |
3063 } } // namespace v8::internal | 3368 } } // namespace v8::internal |
OLD | NEW |