 Chromium Code Reviews
 Chromium Code Reviews Issue 10170030:
  Implement tracking and optimizations of packed arrays  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 10170030:
  Implement tracking and optimizations of packed arrays  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| OLD | NEW | 
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 882 | 882 | 
| 883 __ bind(&transition_smi_elements); | 883 __ bind(&transition_smi_elements); | 
| 884 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); | 884 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); | 
| 885 | 885 | 
| 886 // Transition the array appropriately depending on the value type. | 886 // Transition the array appropriately depending on the value type. | 
| 887 __ CheckMap(eax, | 887 __ CheckMap(eax, | 
| 888 masm->isolate()->factory()->heap_number_map(), | 888 masm->isolate()->factory()->heap_number_map(), | 
| 889 &non_double_value, | 889 &non_double_value, | 
| 890 DONT_DO_SMI_CHECK); | 890 DONT_DO_SMI_CHECK); | 
| 891 | 891 | 
| 892 // Value is a double. Transition FAST_SMI_ONLY_ELEMENTS -> | 892 // Value is a double. Transition FAST_*_SMI_ELEMENTS -> FAST_*_DOUBLE_ELEMENTS | 
| 
Jakob Kummerow
2012/05/13 21:55:27
The comment says that FAST_*_SMI_ELEMENTS are tran
 
danno
2012/05/22 11:05:21
For now, yes. When Toon finishes his changes, all
 | |
| 893 // FAST_DOUBLE_ELEMENTS and complete the store. | 893 // and complete the store. | 
| 894 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, | 894 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, | 
| 895 FAST_DOUBLE_ELEMENTS, | 895 FAST_DOUBLE_ELEMENTS, | 
| 896 ebx, | 896 ebx, | 
| 897 edi, | 897 edi, | 
| 898 &slow); | 898 &slow); | 
| 899 ElementsTransitionGenerator::GenerateSmiOnlyToDouble(masm, &slow); | 899 ElementsTransitionGenerator::GenerateSmiOnlyToDouble(masm, &slow); | 
| 900 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); | 900 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); | 
| 901 __ jmp(&fast_double_without_map_check); | 901 __ jmp(&fast_double_without_map_check); | 
| 902 | 902 | 
| 903 __ bind(&non_double_value); | 903 __ bind(&non_double_value); | 
| 904 // Value is not a double, FAST_SMI_ONLY_ELEMENTS -> FAST_ELEMENTS | 904 // Value is not a double, FAST_SMI_ONLY_ELEMENTS -> FAST_ELEMENTS | 
| 
Jakob Kummerow
2012/05/13 21:55:27
nit: s/ONLY_// or s/ONLY_/*_/.
Also, HOLEY element
 
danno
2012/05/22 11:05:21
Done.
 | |
| 905 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, | 905 __ LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, | 
| 906 FAST_ELEMENTS, | 906 FAST_ELEMENTS, | 
| 907 ebx, | 907 ebx, | 
| 908 edi, | 908 edi, | 
| 909 &slow); | 909 &slow); | 
| 910 ElementsTransitionGenerator::GenerateSmiOnlyToObject(masm); | 910 ElementsTransitionGenerator::GenerateMapChangeElementTransition(masm); | 
| 911 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); | 911 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); | 
| 912 __ jmp(&finish_object_store); | 912 __ jmp(&finish_object_store); | 
| 913 | 913 | 
| 914 __ bind(&transition_double_elements); | 914 __ bind(&transition_double_elements); | 
| 915 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a | 915 // Elements are FAST_DOUBLE_ELEMENTS, but value is an Object that's not a | 
| 916 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and | 916 // HeapNumber. Make sure that the receiver is a Array with FAST_ELEMENTS and | 
| 917 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS | 917 // transition array from FAST_DOUBLE_ELEMENTS to FAST_ELEMENTS | 
| 918 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); | 918 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); | 
| 919 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, | 919 __ LoadTransitionedArrayMapConditional(FAST_DOUBLE_ELEMENTS, | 
| 920 FAST_ELEMENTS, | 920 FAST_ELEMENTS, | 
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1765 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) | 1765 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) | 
| 1766 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1766 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 
| 1767 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1767 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 
| 1768 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1768 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 
| 1769 } | 1769 } | 
| 1770 | 1770 | 
| 1771 | 1771 | 
| 1772 } } // namespace v8::internal | 1772 } } // namespace v8::internal | 
| 1773 | 1773 | 
| 1774 #endif // V8_TARGET_ARCH_IA32 | 1774 #endif // V8_TARGET_ARCH_IA32 | 
| OLD | NEW |