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 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 // | 1057 // |
1058 // r2 - used for the index into the dictionary. | 1058 // r2 - used for the index into the dictionary. |
1059 // | 1059 // |
1060 // result - holds the result on exit if the load succeeds and we fall through. | 1060 // result - holds the result on exit if the load succeeds and we fall through. |
1061 | 1061 |
1062 Label done; | 1062 Label done; |
1063 | 1063 |
1064 GetNumberHash(r0, r1); | 1064 GetNumberHash(r0, r1); |
1065 | 1065 |
1066 // Compute capacity mask. | 1066 // Compute capacity mask. |
1067 mov(r1, FieldOperand(elements, NumberDictionary::kCapacityOffset)); | 1067 mov(r1, FieldOperand(elements, SeededNumberDictionary::kCapacityOffset)); |
1068 shr(r1, kSmiTagSize); // convert smi to int | 1068 shr(r1, kSmiTagSize); // convert smi to int |
1069 dec(r1); | 1069 dec(r1); |
1070 | 1070 |
1071 // Generate an unrolled loop that performs a few probes before giving up. | 1071 // Generate an unrolled loop that performs a few probes before giving up. |
1072 const int kProbes = 4; | 1072 const int kProbes = 4; |
1073 for (int i = 0; i < kProbes; i++) { | 1073 for (int i = 0; i < kProbes; i++) { |
1074 // Use r2 for index calculations and keep the hash intact in r0. | 1074 // Use r2 for index calculations and keep the hash intact in r0. |
1075 mov(r2, r0); | 1075 mov(r2, r0); |
1076 // Compute the masked index: (hash + i + i * i) & mask. | 1076 // Compute the masked index: (hash + i + i * i) & mask. |
1077 if (i > 0) { | 1077 if (i > 0) { |
1078 add(r2, Immediate(NumberDictionary::GetProbeOffset(i))); | 1078 add(r2, Immediate(SeededNumberDictionary::GetProbeOffset(i))); |
1079 } | 1079 } |
1080 and_(r2, r1); | 1080 and_(r2, r1); |
1081 | 1081 |
1082 // Scale the index by multiplying by the entry size. | 1082 // Scale the index by multiplying by the entry size. |
1083 ASSERT(NumberDictionary::kEntrySize == 3); | 1083 ASSERT(SeededNumberDictionary::kEntrySize == 3); |
1084 lea(r2, Operand(r2, r2, times_2, 0)); // r2 = r2 * 3 | 1084 lea(r2, Operand(r2, r2, times_2, 0)); // r2 = r2 * 3 |
1085 | 1085 |
1086 // Check if the key matches. | 1086 // Check if the key matches. |
1087 cmp(key, FieldOperand(elements, | 1087 cmp(key, FieldOperand(elements, |
1088 r2, | 1088 r2, |
1089 times_pointer_size, | 1089 times_pointer_size, |
1090 NumberDictionary::kElementsStartOffset)); | 1090 SeededNumberDictionary::kElementsStartOffset)); |
1091 if (i != (kProbes - 1)) { | 1091 if (i != (kProbes - 1)) { |
1092 j(equal, &done); | 1092 j(equal, &done); |
1093 } else { | 1093 } else { |
1094 j(not_equal, miss); | 1094 j(not_equal, miss); |
1095 } | 1095 } |
1096 } | 1096 } |
1097 | 1097 |
1098 bind(&done); | 1098 bind(&done); |
1099 // Check that the value is a normal propety. | 1099 // Check that the value is a normal propety. |
1100 const int kDetailsOffset = | 1100 const int kDetailsOffset = |
1101 NumberDictionary::kElementsStartOffset + 2 * kPointerSize; | 1101 SeededNumberDictionary::kElementsStartOffset + 2 * kPointerSize; |
1102 ASSERT_EQ(NORMAL, 0); | 1102 ASSERT_EQ(NORMAL, 0); |
1103 test(FieldOperand(elements, r2, times_pointer_size, kDetailsOffset), | 1103 test(FieldOperand(elements, r2, times_pointer_size, kDetailsOffset), |
1104 Immediate(PropertyDetails::TypeField::kMask << kSmiTagSize)); | 1104 Immediate(PropertyDetails::TypeField::kMask << kSmiTagSize)); |
1105 j(not_zero, miss); | 1105 j(not_zero, miss); |
1106 | 1106 |
1107 // Get the value at the masked, scaled index. | 1107 // Get the value at the masked, scaled index. |
1108 const int kValueOffset = | 1108 const int kValueOffset = |
1109 NumberDictionary::kElementsStartOffset + kPointerSize; | 1109 SeededNumberDictionary::kElementsStartOffset + kPointerSize; |
1110 mov(result, FieldOperand(elements, r2, times_pointer_size, kValueOffset)); | 1110 mov(result, FieldOperand(elements, r2, times_pointer_size, kValueOffset)); |
1111 } | 1111 } |
1112 | 1112 |
1113 | 1113 |
1114 void MacroAssembler::LoadAllocationTopHelper(Register result, | 1114 void MacroAssembler::LoadAllocationTopHelper(Register result, |
1115 Register scratch, | 1115 Register scratch, |
1116 AllocationFlags flags) { | 1116 AllocationFlags flags) { |
1117 ExternalReference new_space_allocation_top = | 1117 ExternalReference new_space_allocation_top = |
1118 ExternalReference::new_space_allocation_top_address(isolate()); | 1118 ExternalReference::new_space_allocation_top_address(isolate()); |
1119 | 1119 |
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2739 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); | 2739 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); |
2740 Check(less_equal, "Live Bytes Count overflow chunk size"); | 2740 Check(less_equal, "Live Bytes Count overflow chunk size"); |
2741 } | 2741 } |
2742 | 2742 |
2743 bind(&done); | 2743 bind(&done); |
2744 } | 2744 } |
2745 | 2745 |
2746 } } // namespace v8::internal | 2746 } } // namespace v8::internal |
2747 | 2747 |
2748 #endif // V8_TARGET_ARCH_IA32 | 2748 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |