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 2501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2512 } else { | 2512 } else { |
2513 CallRuntime(Runtime::kAbort, 2); | 2513 CallRuntime(Runtime::kAbort, 2); |
2514 } | 2514 } |
2515 // will not return here | 2515 // will not return here |
2516 int3(); | 2516 int3(); |
2517 } | 2517 } |
2518 | 2518 |
2519 | 2519 |
2520 void MacroAssembler::LoadInstanceDescriptors(Register map, | 2520 void MacroAssembler::LoadInstanceDescriptors(Register map, |
2521 Register descriptors) { | 2521 Register descriptors) { |
2522 mov(descriptors, FieldOperand(map, | 2522 Register temp = descriptors; |
2523 Map::kInstanceDescriptorsOrBackPointerOffset)); | 2523 mov(temp, FieldOperand(map, Map::kTransitionsOrBackPointerOffset)); |
2524 | 2524 |
2525 Label ok, fail; | 2525 Label ok, fail; |
2526 CheckMap(descriptors, | 2526 CheckMap(temp, |
2527 isolate()->factory()->fixed_array_map(), | 2527 isolate()->factory()->fixed_array_map(), |
2528 &fail, | 2528 &fail, |
2529 DONT_DO_SMI_CHECK); | 2529 DONT_DO_SMI_CHECK); |
| 2530 mov(descriptors, FieldOperand(temp, TransitionArray::kDescriptorsOffset)); |
2530 jmp(&ok); | 2531 jmp(&ok); |
2531 bind(&fail); | 2532 bind(&fail); |
2532 mov(descriptors, isolate()->factory()->empty_descriptor_array()); | 2533 mov(descriptors, isolate()->factory()->empty_descriptor_array()); |
2533 bind(&ok); | 2534 bind(&ok); |
2534 } | 2535 } |
2535 | 2536 |
2536 | 2537 |
2537 void MacroAssembler::LoadPowerOf2(XMMRegister dst, | 2538 void MacroAssembler::LoadPowerOf2(XMMRegister dst, |
2538 Register scratch, | 2539 Register scratch, |
2539 int power) { | 2540 int power) { |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2886 // Check that there are no elements. Register ecx contains the | 2887 // Check that there are no elements. Register ecx contains the |
2887 // current JS object we've reached through the prototype chain. | 2888 // current JS object we've reached through the prototype chain. |
2888 cmp(FieldOperand(ecx, JSObject::kElementsOffset), | 2889 cmp(FieldOperand(ecx, JSObject::kElementsOffset), |
2889 isolate()->factory()->empty_fixed_array()); | 2890 isolate()->factory()->empty_fixed_array()); |
2890 j(not_equal, call_runtime); | 2891 j(not_equal, call_runtime); |
2891 | 2892 |
2892 // Check that instance descriptors are not empty so that we can | 2893 // Check that instance descriptors are not empty so that we can |
2893 // check for an enum cache. Leave the map in ebx for the subsequent | 2894 // check for an enum cache. Leave the map in ebx for the subsequent |
2894 // prototype load. | 2895 // prototype load. |
2895 mov(ebx, FieldOperand(ecx, HeapObject::kMapOffset)); | 2896 mov(ebx, FieldOperand(ecx, HeapObject::kMapOffset)); |
2896 mov(edx, FieldOperand(ebx, Map::kInstanceDescriptorsOrBackPointerOffset)); | 2897 mov(edx, FieldOperand(ebx, Map::kTransitionsOrBackPointerOffset)); |
2897 CheckMap(edx, | 2898 CheckMap(edx, |
2898 isolate()->factory()->fixed_array_map(), | 2899 isolate()->factory()->fixed_array_map(), |
2899 call_runtime, | 2900 call_runtime, |
2900 DONT_DO_SMI_CHECK); | 2901 DONT_DO_SMI_CHECK); |
2901 | 2902 |
| 2903 mov(edx, FieldOperand(edx, TransitionArray::kDescriptorsOffset)); |
| 2904 cmp(edx, isolate()->factory()->empty_descriptor_array()); |
| 2905 j(equal, call_runtime); |
| 2906 |
2902 // Check that there is an enum cache in the non-empty instance | 2907 // Check that there is an enum cache in the non-empty instance |
2903 // descriptors (edx). This is the case if the next enumeration | 2908 // descriptors (edx). This is the case if the next enumeration |
2904 // index field does not contain a smi. | 2909 // index field does not contain a smi. |
2905 mov(edx, FieldOperand(edx, DescriptorArray::kEnumCacheOffset)); | 2910 mov(edx, FieldOperand(edx, DescriptorArray::kEnumCacheOffset)); |
2906 JumpIfSmi(edx, call_runtime); | 2911 JumpIfSmi(edx, call_runtime); |
2907 | 2912 |
2908 // For all objects but the receiver, check that the cache is empty. | 2913 // For all objects but the receiver, check that the cache is empty. |
2909 Label check_prototype; | 2914 Label check_prototype; |
2910 cmp(ecx, eax); | 2915 cmp(ecx, eax); |
2911 j(equal, &check_prototype, Label::kNear); | 2916 j(equal, &check_prototype, Label::kNear); |
2912 mov(edx, FieldOperand(edx, DescriptorArray::kEnumCacheBridgeCacheOffset)); | 2917 mov(edx, FieldOperand(edx, DescriptorArray::kEnumCacheBridgeCacheOffset)); |
2913 cmp(edx, isolate()->factory()->empty_fixed_array()); | 2918 cmp(edx, isolate()->factory()->empty_fixed_array()); |
2914 j(not_equal, call_runtime); | 2919 j(not_equal, call_runtime); |
2915 | 2920 |
2916 // Load the prototype from the map and loop if non-null. | 2921 // Load the prototype from the map and loop if non-null. |
2917 bind(&check_prototype); | 2922 bind(&check_prototype); |
2918 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); | 2923 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); |
2919 cmp(ecx, isolate()->factory()->null_value()); | 2924 cmp(ecx, isolate()->factory()->null_value()); |
2920 j(not_equal, &next); | 2925 j(not_equal, &next); |
2921 } | 2926 } |
2922 | 2927 |
2923 } } // namespace v8::internal | 2928 } } // namespace v8::internal |
2924 | 2929 |
2925 #endif // V8_TARGET_ARCH_IA32 | 2930 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |