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 2834 matching lines...) Loading... |
2845 cvttsd2si(result_reg, temp_xmm_reg); | 2845 cvttsd2si(result_reg, temp_xmm_reg); |
2846 testl(result_reg, Immediate(0xFFFFFF00)); | 2846 testl(result_reg, Immediate(0xFFFFFF00)); |
2847 j(zero, &done, Label::kNear); | 2847 j(zero, &done, Label::kNear); |
2848 Set(result_reg, 255); | 2848 Set(result_reg, 255); |
2849 bind(&done); | 2849 bind(&done); |
2850 } | 2850 } |
2851 | 2851 |
2852 | 2852 |
2853 void MacroAssembler::LoadInstanceDescriptors(Register map, | 2853 void MacroAssembler::LoadInstanceDescriptors(Register map, |
2854 Register descriptors) { | 2854 Register descriptors) { |
2855 movq(descriptors, FieldOperand(map, | 2855 Register temp = descriptors; |
2856 Map::kInstanceDescriptorsOrBackPointerOffset)); | 2856 movq(temp, FieldOperand(map, Map::kTransitionsOrBackPointerOffset)); |
2857 | 2857 |
2858 Label ok, fail; | 2858 Label ok, fail; |
2859 CheckMap(descriptors, | 2859 CheckMap(temp, |
2860 isolate()->factory()->fixed_array_map(), | 2860 isolate()->factory()->fixed_array_map(), |
2861 &fail, | 2861 &fail, |
2862 DONT_DO_SMI_CHECK); | 2862 DONT_DO_SMI_CHECK); |
| 2863 movq(descriptors, FieldOperand(temp, TransitionArray::kDescriptorsOffset)); |
2863 jmp(&ok); | 2864 jmp(&ok); |
2864 bind(&fail); | 2865 bind(&fail); |
2865 Move(descriptors, isolate()->factory()->empty_descriptor_array()); | 2866 Move(descriptors, isolate()->factory()->empty_descriptor_array()); |
2866 bind(&ok); | 2867 bind(&ok); |
2867 } | 2868 } |
2868 | 2869 |
2869 | 2870 |
2870 void MacroAssembler::DispatchMap(Register obj, | 2871 void MacroAssembler::DispatchMap(Register obj, |
2871 Handle<Map> map, | 2872 Handle<Map> map, |
2872 Handle<Code> success, | 2873 Handle<Code> success, |
(...skipping 1583 matching lines...) Loading... |
4456 // Check that there are no elements. Register rcx contains the | 4457 // Check that there are no elements. Register rcx contains the |
4457 // current JS object we've reached through the prototype chain. | 4458 // current JS object we've reached through the prototype chain. |
4458 cmpq(empty_fixed_array_value, | 4459 cmpq(empty_fixed_array_value, |
4459 FieldOperand(rcx, JSObject::kElementsOffset)); | 4460 FieldOperand(rcx, JSObject::kElementsOffset)); |
4460 j(not_equal, call_runtime); | 4461 j(not_equal, call_runtime); |
4461 | 4462 |
4462 // Check that instance descriptors are not empty so that we can | 4463 // Check that instance descriptors are not empty so that we can |
4463 // check for an enum cache. Leave the map in rbx for the subsequent | 4464 // check for an enum cache. Leave the map in rbx for the subsequent |
4464 // prototype load. | 4465 // prototype load. |
4465 movq(rbx, FieldOperand(rcx, HeapObject::kMapOffset)); | 4466 movq(rbx, FieldOperand(rcx, HeapObject::kMapOffset)); |
4466 movq(rdx, FieldOperand(rbx, Map::kInstanceDescriptorsOrBackPointerOffset)); | 4467 movq(rdx, FieldOperand(rbx, Map::kTransitionsOrBackPointerOffset)); |
4467 | 4468 |
4468 CheckMap(rdx, | 4469 CheckMap(rdx, |
4469 isolate()->factory()->fixed_array_map(), | 4470 isolate()->factory()->fixed_array_map(), |
4470 call_runtime, | 4471 call_runtime, |
4471 DONT_DO_SMI_CHECK); | 4472 DONT_DO_SMI_CHECK); |
4472 | 4473 |
| 4474 movq(rdx, FieldOperand(rdx, TransitionArray::kDescriptorsOffset)); |
| 4475 cmpq(rdx, empty_descriptor_array_value); |
| 4476 j(equal, call_runtime); |
| 4477 |
4473 // Check that there is an enum cache in the non-empty instance | 4478 // Check that there is an enum cache in the non-empty instance |
4474 // descriptors (rdx). This is the case if the next enumeration | 4479 // descriptors (rdx). This is the case if the next enumeration |
4475 // index field does not contain a smi. | 4480 // index field does not contain a smi. |
4476 movq(rdx, FieldOperand(rdx, DescriptorArray::kEnumCacheOffset)); | 4481 movq(rdx, FieldOperand(rdx, DescriptorArray::kEnumCacheOffset)); |
4477 JumpIfSmi(rdx, call_runtime); | 4482 JumpIfSmi(rdx, call_runtime); |
4478 | 4483 |
4479 // For all objects but the receiver, check that the cache is empty. | 4484 // For all objects but the receiver, check that the cache is empty. |
4480 Label check_prototype; | 4485 Label check_prototype; |
4481 cmpq(rcx, rax); | 4486 cmpq(rcx, rax); |
4482 j(equal, &check_prototype, Label::kNear); | 4487 j(equal, &check_prototype, Label::kNear); |
4483 movq(rdx, FieldOperand(rdx, DescriptorArray::kEnumCacheBridgeCacheOffset)); | 4488 movq(rdx, FieldOperand(rdx, DescriptorArray::kEnumCacheBridgeCacheOffset)); |
4484 cmpq(rdx, empty_fixed_array_value); | 4489 cmpq(rdx, empty_fixed_array_value); |
4485 j(not_equal, call_runtime); | 4490 j(not_equal, call_runtime); |
4486 | 4491 |
4487 // Load the prototype from the map and loop if non-null. | 4492 // Load the prototype from the map and loop if non-null. |
4488 bind(&check_prototype); | 4493 bind(&check_prototype); |
4489 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); | 4494 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); |
4490 cmpq(rcx, null_value); | 4495 cmpq(rcx, null_value); |
4491 j(not_equal, &next); | 4496 j(not_equal, &next); |
4492 } | 4497 } |
4493 | 4498 |
4494 | 4499 |
4495 } } // namespace v8::internal | 4500 } } // namespace v8::internal |
4496 | 4501 |
4497 #endif // V8_TARGET_ARCH_X64 | 4502 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |