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

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

Issue 546087: Implement inline string compare on ARM. (Closed)
Patch Set: Further optimization of ARM version Created 10 years, 11 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
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | test/cctest/test-disasm-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 // Load instance type for both strings. 1304 // Load instance type for both strings.
1305 movq(scratch1, FieldOperand(first_object, HeapObject::kMapOffset)); 1305 movq(scratch1, FieldOperand(first_object, HeapObject::kMapOffset));
1306 movq(scratch2, FieldOperand(second_object, HeapObject::kMapOffset)); 1306 movq(scratch2, FieldOperand(second_object, HeapObject::kMapOffset));
1307 movzxbl(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); 1307 movzxbl(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset));
1308 movzxbl(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); 1308 movzxbl(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset));
1309 1309
1310 // Check that both are flat ascii strings. 1310 // Check that both are flat ascii strings.
1311 ASSERT(kNotStringTag != 0); 1311 ASSERT(kNotStringTag != 0);
1312 const int kFlatAsciiStringMask = 1312 const int kFlatAsciiStringMask =
1313 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; 1313 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
1314 const int kFlatAsciiStringBits = 1314 const int kFlatAsciiStringTag = ASCII_STRING_TYPE;
1315 kNotStringTag | kSeqStringTag | kAsciiStringTag;
1316 1315
1317 andl(scratch1, Immediate(kFlatAsciiStringMask)); 1316 andl(scratch1, Immediate(kFlatAsciiStringMask));
1318 andl(scratch2, Immediate(kFlatAsciiStringMask)); 1317 andl(scratch2, Immediate(kFlatAsciiStringMask));
1319 // Interleave the bits to check both scratch1 and scratch2 in one test. 1318 // Interleave the bits to check both scratch1 and scratch2 in one test.
1320 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); 1319 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3));
1321 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); 1320 lea(scratch1, Operand(scratch1, scratch2, times_8, 0));
1322 cmpl(scratch1, 1321 cmpl(scratch1,
1323 Immediate(kFlatAsciiStringBits + (kFlatAsciiStringBits << 3))); 1322 Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3)));
1324 j(not_equal, on_fail); 1323 j(not_equal, on_fail);
1325 } 1324 }
1326 1325
1327 1326
1328 void MacroAssembler::Move(Register dst, Handle<Object> source) { 1327 void MacroAssembler::Move(Register dst, Handle<Object> source) {
1329 ASSERT(!source->IsFailure()); 1328 ASSERT(!source->IsFailure());
1330 if (source->IsSmi()) { 1329 if (source->IsSmi()) {
1331 Move(dst, Smi::cast(*source)); 1330 Move(dst, Smi::cast(*source));
1332 } else { 1331 } else {
1333 movq(dst, source, RelocInfo::EMBEDDED_OBJECT); 1332 movq(dst, source, RelocInfo::EMBEDDED_OBJECT);
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
2444 CodePatcher::~CodePatcher() { 2443 CodePatcher::~CodePatcher() {
2445 // Indicate that code has changed. 2444 // Indicate that code has changed.
2446 CPU::FlushICache(address_, size_); 2445 CPU::FlushICache(address_, size_);
2447 2446
2448 // Check that the code was patched as expected. 2447 // Check that the code was patched as expected.
2449 ASSERT(masm_.pc_ == address_ + size_); 2448 ASSERT(masm_.pc_ == address_ + size_);
2450 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 2449 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2451 } 2450 }
2452 2451
2453 } } // namespace v8::internal 2452 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | test/cctest/test-disasm-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698