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 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 | 923 |
924 // Check that there are no elements. Register a1 contains the | 924 // Check that there are no elements. Register a1 contains the |
925 // current JS object we've reached through the prototype chain. | 925 // current JS object we've reached through the prototype chain. |
926 __ lw(a2, FieldMemOperand(a1, JSObject::kElementsOffset)); | 926 __ lw(a2, FieldMemOperand(a1, JSObject::kElementsOffset)); |
927 __ Branch(&call_runtime, ne, a2, Operand(empty_fixed_array_value)); | 927 __ Branch(&call_runtime, ne, a2, Operand(empty_fixed_array_value)); |
928 | 928 |
929 // Check that instance descriptors are not empty so that we can | 929 // Check that instance descriptors are not empty so that we can |
930 // check for an enum cache. Leave the map in a2 for the subsequent | 930 // check for an enum cache. Leave the map in a2 for the subsequent |
931 // prototype load. | 931 // prototype load. |
932 __ lw(a2, FieldMemOperand(a1, HeapObject::kMapOffset)); | 932 __ lw(a2, FieldMemOperand(a1, HeapObject::kMapOffset)); |
933 __ lw(a3, FieldMemOperand(a2, Map::kInstanceDescriptorsOffset)); | 933 __ lw(a3, FieldMemOperand(a2, Map::kInstanceDescriptorsOrBitField3Offset)); |
934 __ Branch(&call_runtime, eq, a3, Operand(empty_descriptor_array_value)); | 934 __ JumpIfSmi(a3, &call_runtime); |
935 | 935 |
936 // Check that there is an enum cache in the non-empty instance | 936 // Check that there is an enum cache in the non-empty instance |
937 // descriptors (a3). This is the case if the next enumeration | 937 // descriptors (a3). This is the case if the next enumeration |
938 // index field does not contain a smi. | 938 // index field does not contain a smi. |
939 __ lw(a3, FieldMemOperand(a3, DescriptorArray::kEnumerationIndexOffset)); | 939 __ lw(a3, FieldMemOperand(a3, DescriptorArray::kEnumerationIndexOffset)); |
940 __ JumpIfSmi(a3, &call_runtime); | 940 __ JumpIfSmi(a3, &call_runtime); |
941 | 941 |
942 // For all objects but the receiver, check that the cache is empty. | 942 // For all objects but the receiver, check that the cache is empty. |
943 Label check_prototype; | 943 Label check_prototype; |
944 __ Branch(&check_prototype, eq, a1, Operand(a0)); | 944 __ Branch(&check_prototype, eq, a1, Operand(a0)); |
(...skipping 20 matching lines...) Expand all Loading... |
965 // modification check. Otherwise, we got a fixed array, and we have | 965 // modification check. Otherwise, we got a fixed array, and we have |
966 // to do a slow check. | 966 // to do a slow check. |
967 Label fixed_array; | 967 Label fixed_array; |
968 __ mov(a2, v0); | 968 __ mov(a2, v0); |
969 __ lw(a1, FieldMemOperand(a2, HeapObject::kMapOffset)); | 969 __ lw(a1, FieldMemOperand(a2, HeapObject::kMapOffset)); |
970 __ LoadRoot(at, Heap::kMetaMapRootIndex); | 970 __ LoadRoot(at, Heap::kMetaMapRootIndex); |
971 __ Branch(&fixed_array, ne, a1, Operand(at)); | 971 __ Branch(&fixed_array, ne, a1, Operand(at)); |
972 | 972 |
973 // We got a map in register v0. Get the enumeration cache from it. | 973 // We got a map in register v0. Get the enumeration cache from it. |
974 __ bind(&use_cache); | 974 __ bind(&use_cache); |
975 __ lw(a1, FieldMemOperand(v0, Map::kInstanceDescriptorsOffset)); | 975 __ LoadInstanceDescriptors(v0, a1); |
976 __ lw(a1, FieldMemOperand(a1, DescriptorArray::kEnumerationIndexOffset)); | 976 __ lw(a1, FieldMemOperand(a1, DescriptorArray::kEnumerationIndexOffset)); |
977 __ lw(a2, FieldMemOperand(a1, DescriptorArray::kEnumCacheBridgeCacheOffset)); | 977 __ lw(a2, FieldMemOperand(a1, DescriptorArray::kEnumCacheBridgeCacheOffset)); |
978 | 978 |
979 // Setup the four remaining stack slots. | 979 // Setup the four remaining stack slots. |
980 __ push(v0); // Map. | 980 __ push(v0); // Map. |
981 __ lw(a1, FieldMemOperand(a2, FixedArray::kLengthOffset)); | 981 __ lw(a1, FieldMemOperand(a2, FixedArray::kLengthOffset)); |
982 __ li(a0, Operand(Smi::FromInt(0))); | 982 __ li(a0, Operand(Smi::FromInt(0))); |
983 // Push enumeration cache, enumeration cache length (as smi) and zero. | 983 // Push enumeration cache, enumeration cache length (as smi) and zero. |
984 __ Push(a2, a1, a0); | 984 __ Push(a2, a1, a0); |
985 __ jmp(&loop); | 985 __ jmp(&loop); |
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2544 | 2544 |
2545 // Check for fast case object. Generate false result for slow case object. | 2545 // Check for fast case object. Generate false result for slow case object. |
2546 __ lw(a2, FieldMemOperand(v0, JSObject::kPropertiesOffset)); | 2546 __ lw(a2, FieldMemOperand(v0, JSObject::kPropertiesOffset)); |
2547 __ lw(a2, FieldMemOperand(a2, HeapObject::kMapOffset)); | 2547 __ lw(a2, FieldMemOperand(a2, HeapObject::kMapOffset)); |
2548 __ LoadRoot(t0, Heap::kHashTableMapRootIndex); | 2548 __ LoadRoot(t0, Heap::kHashTableMapRootIndex); |
2549 __ Branch(if_false, eq, a2, Operand(t0)); | 2549 __ Branch(if_false, eq, a2, Operand(t0)); |
2550 | 2550 |
2551 // Look for valueOf symbol in the descriptor array, and indicate false if | 2551 // Look for valueOf symbol in the descriptor array, and indicate false if |
2552 // found. The type is not checked, so if it is a transition it is a false | 2552 // found. The type is not checked, so if it is a transition it is a false |
2553 // negative. | 2553 // negative. |
2554 __ lw(t0, FieldMemOperand(a1, Map::kInstanceDescriptorsOffset)); | 2554 __ LoadInstanceDescriptors(a1, t0); |
2555 __ lw(a3, FieldMemOperand(t0, FixedArray::kLengthOffset)); | 2555 __ lw(a3, FieldMemOperand(t0, FixedArray::kLengthOffset)); |
2556 // t0: descriptor array | 2556 // t0: descriptor array |
2557 // a3: length of descriptor array | 2557 // a3: length of descriptor array |
2558 // Calculate the end of the descriptor array. | 2558 // Calculate the end of the descriptor array. |
2559 STATIC_ASSERT(kSmiTag == 0); | 2559 STATIC_ASSERT(kSmiTag == 0); |
2560 STATIC_ASSERT(kSmiTagSize == 1); | 2560 STATIC_ASSERT(kSmiTagSize == 1); |
2561 STATIC_ASSERT(kPointerSize == 4); | 2561 STATIC_ASSERT(kPointerSize == 4); |
2562 __ Addu(a2, t0, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 2562 __ Addu(a2, t0, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
2563 __ sll(t1, a3, kPointerSizeLog2 - kSmiTagSize); | 2563 __ sll(t1, a3, kPointerSizeLog2 - kSmiTagSize); |
2564 __ Addu(a2, a2, t1); | 2564 __ Addu(a2, a2, t1); |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2859 if (CpuFeatures::IsSupported(FPU)) { | 2859 if (CpuFeatures::IsSupported(FPU)) { |
2860 __ PrepareCallCFunction(1, a0); | 2860 __ PrepareCallCFunction(1, a0); |
2861 __ li(a0, Operand(ExternalReference::isolate_address())); | 2861 __ li(a0, Operand(ExternalReference::isolate_address())); |
2862 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1); | 2862 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1); |
2863 | 2863 |
2864 | 2864 |
2865 CpuFeatures::Scope scope(FPU); | 2865 CpuFeatures::Scope scope(FPU); |
2866 // 0x41300000 is the top half of 1.0 x 2^20 as a double. | 2866 // 0x41300000 is the top half of 1.0 x 2^20 as a double. |
2867 __ li(a1, Operand(0x41300000)); | 2867 __ li(a1, Operand(0x41300000)); |
2868 // Move 0x41300000xxxxxxxx (x = random bits in v0) to FPU. | 2868 // Move 0x41300000xxxxxxxx (x = random bits in v0) to FPU. |
2869 __ mtc1(a1, f13); | 2869 __ Move(f12, v0, a1); |
2870 __ mtc1(v0, f12); | |
2871 // Move 0x4130000000000000 to FPU. | 2870 // Move 0x4130000000000000 to FPU. |
2872 __ mtc1(a1, f15); | 2871 __ Move(f14, zero_reg, a1); |
2873 __ mtc1(zero_reg, f14); | |
2874 // Subtract and store the result in the heap number. | 2872 // Subtract and store the result in the heap number. |
2875 __ sub_d(f0, f12, f14); | 2873 __ sub_d(f0, f12, f14); |
2876 __ sdc1(f0, MemOperand(s0, HeapNumber::kValueOffset - kHeapObjectTag)); | 2874 __ sdc1(f0, MemOperand(s0, HeapNumber::kValueOffset - kHeapObjectTag)); |
2877 __ mov(v0, s0); | 2875 __ mov(v0, s0); |
2878 } else { | 2876 } else { |
2879 __ PrepareCallCFunction(2, a0); | 2877 __ PrepareCallCFunction(2, a0); |
2880 __ mov(a0, s0); | 2878 __ mov(a0, s0); |
2881 __ li(a1, Operand(ExternalReference::isolate_address())); | 2879 __ li(a1, Operand(ExternalReference::isolate_address())); |
2882 __ CallCFunction( | 2880 __ CallCFunction( |
2883 ExternalReference::fill_heap_number_with_random_function(isolate()), 2); | 2881 ExternalReference::fill_heap_number_with_random_function(isolate()), 2); |
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4370 __ Addu(at, a1, Operand(masm_->CodeObject())); | 4368 __ Addu(at, a1, Operand(masm_->CodeObject())); |
4371 __ Jump(at); | 4369 __ Jump(at); |
4372 } | 4370 } |
4373 | 4371 |
4374 | 4372 |
4375 #undef __ | 4373 #undef __ |
4376 | 4374 |
4377 } } // namespace v8::internal | 4375 } } // namespace v8::internal |
4378 | 4376 |
4379 #endif // V8_TARGET_ARCH_MIPS | 4377 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |