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

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

Issue 2549773002: Internalize strings in-place (Closed)
Patch Set: forgot one Created 4 years 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/division-by-constant.h" 8 #include "src/base/division-by-constant.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after
2705 mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset)); 2705 mov(scratch2, FieldOperand(object2, HeapObject::kMapOffset));
2706 movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset)); 2706 movzx_b(scratch1, FieldOperand(scratch1, Map::kInstanceTypeOffset));
2707 movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset)); 2707 movzx_b(scratch2, FieldOperand(scratch2, Map::kInstanceTypeOffset));
2708 2708
2709 // Check that both are flat one-byte strings. 2709 // Check that both are flat one-byte strings.
2710 const int kFlatOneByteStringMask = 2710 const int kFlatOneByteStringMask =
2711 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask; 2711 kIsNotStringMask | kStringRepresentationMask | kStringEncodingMask;
2712 const int kFlatOneByteStringTag = 2712 const int kFlatOneByteStringTag =
2713 kStringTag | kOneByteStringTag | kSeqStringTag; 2713 kStringTag | kOneByteStringTag | kSeqStringTag;
2714 // Interleave bits from both instance types and compare them in one check. 2714 // Interleave bits from both instance types and compare them in one check.
2715 DCHECK_EQ(0, kFlatOneByteStringMask & (kFlatOneByteStringMask << 3)); 2715 const int kShift = 8;
2716 DCHECK_EQ(0, kFlatOneByteStringMask & (kFlatOneByteStringMask << kShift));
2716 and_(scratch1, kFlatOneByteStringMask); 2717 and_(scratch1, kFlatOneByteStringMask);
2717 and_(scratch2, kFlatOneByteStringMask); 2718 and_(scratch2, kFlatOneByteStringMask);
2718 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); 2719 shl(scratch2, kShift);
2719 cmp(scratch1, kFlatOneByteStringTag | (kFlatOneByteStringTag << 3)); 2720 or_(scratch1, scratch2);
2721 cmp(scratch1, kFlatOneByteStringTag | (kFlatOneByteStringTag << kShift));
2720 j(not_equal, failure); 2722 j(not_equal, failure);
2721 } 2723 }
2722 2724
2723 2725
2724 void MacroAssembler::JumpIfNotUniqueNameInstanceType(Operand operand, 2726 void MacroAssembler::JumpIfNotUniqueNameInstanceType(Operand operand,
2725 Label* not_unique_name, 2727 Label* not_unique_name,
2726 Label::Distance distance) { 2728 Label::Distance distance) {
2727 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); 2729 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0);
2728 Label succeed; 2730 Label succeed;
2729 test(operand, Immediate(kIsNotStringMask | kIsNotInternalizedMask)); 2731 test(operand, Immediate(kIsNotStringMask | kIsNotInternalizedMask));
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
3093 mov(eax, dividend); 3095 mov(eax, dividend);
3094 shr(eax, 31); 3096 shr(eax, 31);
3095 add(edx, eax); 3097 add(edx, eax);
3096 } 3098 }
3097 3099
3098 3100
3099 } // namespace internal 3101 } // namespace internal
3100 } // namespace v8 3102 } // namespace v8
3101 3103
3102 #endif // V8_TARGET_ARCH_IA32 3104 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698