Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(872)

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 19514004: In MacroAssembler::JumpIfNotBothSequentialAsciiStrings a custom mask (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update after comments with fixes Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2235 matching lines...) Expand 10 before | Expand all | Expand 10 after
2246 // Load instance type for both strings. 2246 // Load instance type for both strings.
2247 movq(scratch1, FieldOperand(first_object, HeapObject::kMapOffset)); 2247 movq(scratch1, FieldOperand(first_object, HeapObject::kMapOffset));
2248 movq(scratch2, FieldOperand(second_object, HeapObject::kMapOffset)); 2248 movq(scratch2, FieldOperand(second_object, HeapObject::kMapOffset));
2249 movzxbl(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); 2249 movzxbl(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset));
2250 movzxbl(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); 2250 movzxbl(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset));
2251 2251
2252 // Check that both are flat ASCII strings. 2252 // Check that both are flat ASCII strings.
2253 ASSERT(kNotStringTag != 0); 2253 ASSERT(kNotStringTag != 0);
2254 const int kFlatAsciiStringMask = 2254 const int kFlatAsciiStringMask =
2255 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; 2255 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
2256 const int kFlatAsciiStringTag = ASCII_STRING_TYPE; 2256 const int kFlatAsciiStringTag =
2257 kStringTag | kOneByteStringTag | kSeqStringTag;
2257 2258
2258 andl(scratch1, Immediate(kFlatAsciiStringMask)); 2259 andl(scratch1, Immediate(kFlatAsciiStringMask));
2259 andl(scratch2, Immediate(kFlatAsciiStringMask)); 2260 andl(scratch2, Immediate(kFlatAsciiStringMask));
2260 // Interleave the bits to check both scratch1 and scratch2 in one test. 2261 // Interleave the bits to check both scratch1 and scratch2 in one test.
2261 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); 2262 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3));
2262 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); 2263 lea(scratch1, Operand(scratch1, scratch2, times_8, 0));
2263 cmpl(scratch1, 2264 cmpl(scratch1,
2264 Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3))); 2265 Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3)));
2265 j(not_equal, on_fail, near_jump); 2266 j(not_equal, on_fail, near_jump);
2266 } 2267 }
(...skipping 25 matching lines...) Expand all
2292 Label* on_fail, 2293 Label* on_fail,
2293 Label::Distance near_jump) { 2294 Label::Distance near_jump) {
2294 // Load instance type for both strings. 2295 // Load instance type for both strings.
2295 movq(scratch1, first_object_instance_type); 2296 movq(scratch1, first_object_instance_type);
2296 movq(scratch2, second_object_instance_type); 2297 movq(scratch2, second_object_instance_type);
2297 2298
2298 // Check that both are flat ASCII strings. 2299 // Check that both are flat ASCII strings.
2299 ASSERT(kNotStringTag != 0); 2300 ASSERT(kNotStringTag != 0);
2300 const int kFlatAsciiStringMask = 2301 const int kFlatAsciiStringMask =
2301 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; 2302 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
2302 const int kFlatAsciiStringTag = ASCII_STRING_TYPE; 2303 const int kFlatAsciiStringTag =
2304 kStringTag | kOneByteStringTag | kSeqStringTag;
2303 2305
2304 andl(scratch1, Immediate(kFlatAsciiStringMask)); 2306 andl(scratch1, Immediate(kFlatAsciiStringMask));
2305 andl(scratch2, Immediate(kFlatAsciiStringMask)); 2307 andl(scratch2, Immediate(kFlatAsciiStringMask));
2306 // Interleave the bits to check both scratch1 and scratch2 in one test. 2308 // Interleave the bits to check both scratch1 and scratch2 in one test.
2307 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); 2309 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3));
2308 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); 2310 lea(scratch1, Operand(scratch1, scratch2, times_8, 0));
2309 cmpl(scratch1, 2311 cmpl(scratch1,
2310 Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3))); 2312 Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3)));
2311 j(not_equal, on_fail, near_jump); 2313 j(not_equal, on_fail, near_jump);
2312 } 2314 }
(...skipping 2378 matching lines...) Expand 10 before | Expand all | Expand 10 after
4691 j(greater, &no_memento_available); 4693 j(greater, &no_memento_available);
4692 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), 4694 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize),
4693 Heap::kAllocationMementoMapRootIndex); 4695 Heap::kAllocationMementoMapRootIndex);
4694 bind(&no_memento_available); 4696 bind(&no_memento_available);
4695 } 4697 }
4696 4698
4697 4699
4698 } } // namespace v8::internal 4700 } } // namespace v8::internal
4699 4701
4700 #endif // V8_TARGET_ARCH_X64 4702 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698