| 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 2200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2211 | 2211 |
| 2212 // Load instance type for both strings. | 2212 // Load instance type for both strings. |
| 2213 movq(scratch1, FieldOperand(first_object, HeapObject::kMapOffset)); | 2213 movq(scratch1, FieldOperand(first_object, HeapObject::kMapOffset)); |
| 2214 movq(scratch2, FieldOperand(second_object, HeapObject::kMapOffset)); | 2214 movq(scratch2, FieldOperand(second_object, HeapObject::kMapOffset)); |
| 2215 movzxbl(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); | 2215 movzxbl(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); |
| 2216 movzxbl(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); | 2216 movzxbl(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); |
| 2217 | 2217 |
| 2218 // Check that both are flat ASCII strings. | 2218 // Check that both are flat ASCII strings. |
| 2219 ASSERT(kNotStringTag != 0); | 2219 ASSERT(kNotStringTag != 0); |
| 2220 const int kFlatAsciiStringMask = | 2220 const int kFlatAsciiStringMask = |
| 2221 kIsNotStringMask | kStringEncodingMask | kAsciiDataHintMask | | 2221 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; |
| 2222 kStringRepresentationMask; | |
| 2223 const int kFlatAsciiStringTag = ASCII_STRING_TYPE; | 2222 const int kFlatAsciiStringTag = ASCII_STRING_TYPE; |
| 2224 | 2223 |
| 2225 andl(scratch1, Immediate(kFlatAsciiStringMask)); | 2224 andl(scratch1, Immediate(kFlatAsciiStringMask)); |
| 2226 andl(scratch2, Immediate(kFlatAsciiStringMask)); | 2225 andl(scratch2, Immediate(kFlatAsciiStringMask)); |
| 2227 // Interleave the bits to check both scratch1 and scratch2 in one test. | 2226 // Interleave the bits to check both scratch1 and scratch2 in one test. |
| 2228 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 8)); | 2227 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); |
| 2229 ASSERT_EQ(ASCII_STRING_TYPE, ASCII_STRING_TYPE & kFlatAsciiStringMask); | 2228 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); |
| 2230 shl(scratch1, Immediate(8)); | |
| 2231 orl(scratch1, scratch2); | |
| 2232 cmpl(scratch1, | 2229 cmpl(scratch1, |
| 2233 Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 8))); | 2230 Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3))); |
| 2234 j(not_equal, on_fail, near_jump); | 2231 j(not_equal, on_fail, near_jump); |
| 2235 } | 2232 } |
| 2236 | 2233 |
| 2237 | 2234 |
| 2238 void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii( | 2235 void MacroAssembler::JumpIfInstanceTypeIsNotSequentialAscii( |
| 2239 Register instance_type, | 2236 Register instance_type, |
| 2240 Register scratch, | 2237 Register scratch, |
| 2241 Label* failure, | 2238 Label* failure, |
| 2242 Label::Distance near_jump) { | 2239 Label::Distance near_jump) { |
| 2243 if (!scratch.is(instance_type)) { | 2240 if (!scratch.is(instance_type)) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 2259 Register scratch1, | 2256 Register scratch1, |
| 2260 Register scratch2, | 2257 Register scratch2, |
| 2261 Label* on_fail, | 2258 Label* on_fail, |
| 2262 Label::Distance near_jump) { | 2259 Label::Distance near_jump) { |
| 2263 // Load instance type for both strings. | 2260 // Load instance type for both strings. |
| 2264 movq(scratch1, first_object_instance_type); | 2261 movq(scratch1, first_object_instance_type); |
| 2265 movq(scratch2, second_object_instance_type); | 2262 movq(scratch2, second_object_instance_type); |
| 2266 | 2263 |
| 2267 // Check that both are flat ASCII strings. | 2264 // Check that both are flat ASCII strings. |
| 2268 ASSERT(kNotStringTag != 0); | 2265 ASSERT(kNotStringTag != 0); |
| 2269 const int kFlatAsciiStringMask = kIsNotStringMask | kStringRepresentationMask | 2266 const int kFlatAsciiStringMask = |
| 2270 | kStringEncodingMask | kAsciiDataHintTag; | 2267 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; |
| 2271 const int kFlatAsciiStringTag = ASCII_STRING_TYPE; | 2268 const int kFlatAsciiStringTag = ASCII_STRING_TYPE; |
| 2272 | 2269 |
| 2273 andl(scratch1, Immediate(kFlatAsciiStringMask)); | 2270 andl(scratch1, Immediate(kFlatAsciiStringMask)); |
| 2274 andl(scratch2, Immediate(kFlatAsciiStringMask)); | 2271 andl(scratch2, Immediate(kFlatAsciiStringMask)); |
| 2275 // Interleave the bits to check both scratch1 and scratch2 in one test. | 2272 // Interleave the bits to check both scratch1 and scratch2 in one test. |
| 2276 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 8)); | 2273 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); |
| 2277 ASSERT_EQ(ASCII_STRING_TYPE, ASCII_STRING_TYPE & kFlatAsciiStringMask); | 2274 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); |
| 2278 shl(scratch1, Immediate(8)); | |
| 2279 orl(scratch1, scratch2); | |
| 2280 cmpl(scratch1, | 2275 cmpl(scratch1, |
| 2281 Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 8))); | 2276 Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3))); |
| 2282 j(not_equal, on_fail, near_jump); | 2277 j(not_equal, on_fail, near_jump); |
| 2283 } | 2278 } |
| 2284 | 2279 |
| 2285 | 2280 |
| 2286 | 2281 |
| 2287 void MacroAssembler::Move(Register dst, Register src) { | 2282 void MacroAssembler::Move(Register dst, Register src) { |
| 2288 if (!dst.is(src)) { | 2283 if (!dst.is(src)) { |
| 2289 movq(dst, src); | 2284 movq(dst, src); |
| 2290 } | 2285 } |
| 2291 } | 2286 } |
| (...skipping 2337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4629 CompareRoot(MemOperand(scratch_reg, 0), | 4624 CompareRoot(MemOperand(scratch_reg, 0), |
| 4630 Heap::kAllocationSiteInfoMapRootIndex); | 4625 Heap::kAllocationSiteInfoMapRootIndex); |
| 4631 j(equal, allocation_info_present); | 4626 j(equal, allocation_info_present); |
| 4632 bind(&no_info_available); | 4627 bind(&no_info_available); |
| 4633 } | 4628 } |
| 4634 | 4629 |
| 4635 | 4630 |
| 4636 } } // namespace v8::internal | 4631 } } // namespace v8::internal |
| 4637 | 4632 |
| 4638 #endif // V8_TARGET_ARCH_X64 | 4633 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |