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

Unified Diff: src/ia32/code-stubs-ia32.cc

Issue 17895002: The check for internalized strings relied on the fact that we had less (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: More comments Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/code-stubs-ia32.cc
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc
index 0ca56984ad0497a857ba9ea3f4406902e20b52d1..83b753b591ad07cdb311b13b0c3df369f33b9c69 100644
--- a/src/ia32/code-stubs-ia32.cc
+++ b/src/ia32/code-stubs-ia32.cc
@@ -6853,9 +6853,13 @@ void ICCompareStub::GenerateInternalizedStrings(MacroAssembler* masm) {
__ movzx_b(tmp1, FieldOperand(tmp1, Map::kInstanceTypeOffset));
__ movzx_b(tmp2, FieldOperand(tmp2, Map::kInstanceTypeOffset));
STATIC_ASSERT(kInternalizedTag != 0);
- __ and_(tmp1, tmp2);
- __ test(tmp1, Immediate(kIsInternalizedMask));
- __ j(zero, &miss, Label::kNear);
+ __ and_(tmp1, Immediate(kIsNotStringMask | kIsInternalizedMask));
+ __ cmpb(tmp1, kInternalizedTag | kStringTag);
+ __ j(not_equal, &miss, Label::kNear);
+
+ __ and_(tmp2, Immediate(kIsNotStringMask | kIsInternalizedMask));
+ __ cmpb(tmp2, kInternalizedTag | kStringTag);
+ __ j(not_equal, &miss, Label::kNear);
// Internalized strings are compared by identity.
Label done;
@@ -6900,19 +6904,8 @@ void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) {
__ movzx_b(tmp1, FieldOperand(tmp1, Map::kInstanceTypeOffset));
__ movzx_b(tmp2, FieldOperand(tmp2, Map::kInstanceTypeOffset));
- Label succeed1;
- __ test(tmp1, Immediate(kIsInternalizedMask));
- __ j(not_zero, &succeed1);
- __ cmpb(tmp1, static_cast<uint8_t>(SYMBOL_TYPE));
- __ j(not_equal, &miss);
- __ bind(&succeed1);
-
- Label succeed2;
- __ test(tmp2, Immediate(kIsInternalizedMask));
- __ j(not_zero, &succeed2);
- __ cmpb(tmp2, static_cast<uint8_t>(SYMBOL_TYPE));
- __ j(not_equal, &miss);
- __ bind(&succeed2);
+ __ JumpIfNotUniqueName(tmp1, &miss, Label::kNear);
+ __ JumpIfNotUniqueName(tmp2, &miss, Label::kNear);
// Unique names are compared by identity.
Label done;
@@ -6977,7 +6970,8 @@ void ICCompareStub::GenerateStrings(MacroAssembler* masm) {
// Check that both strings are internalized. If they are, we're done
// because we already know they are not identical. But in the case of
- // non-equality compare, we still need to determine the order.
+ // non-equality compare, we still need to determine the order. We
+ // also know they are both strings.
if (equality) {
Label do_compare;
STATIC_ASSERT(kInternalizedTag != 0);
@@ -7136,12 +7130,8 @@ void NameDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm,
// Check if the entry name is not a unique name.
__ mov(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset));
- __ test_b(FieldOperand(entity_name, Map::kInstanceTypeOffset),
- kIsInternalizedMask);
- __ j(not_zero, &good);
- __ cmpb(FieldOperand(entity_name, Map::kInstanceTypeOffset),
- static_cast<uint8_t>(SYMBOL_TYPE));
- __ j(not_equal, miss);
+ __ JumpIfNotUniqueName(FieldOperand(entity_name, Map::kInstanceTypeOffset),
+ miss);
__ bind(&good);
}
@@ -7274,15 +7264,9 @@ void NameDictionaryLookupStub::Generate(MacroAssembler* masm) {
// key we are looking for.
// Check if the entry name is not a unique name.
- Label cont;
__ mov(scratch, FieldOperand(scratch, HeapObject::kMapOffset));
- __ test_b(FieldOperand(scratch, Map::kInstanceTypeOffset),
- kIsInternalizedMask);
- __ j(not_zero, &cont);
- __ cmpb(FieldOperand(scratch, Map::kInstanceTypeOffset),
- static_cast<uint8_t>(SYMBOL_TYPE));
- __ j(not_equal, &maybe_in_dictionary);
- __ bind(&cont);
+ __ JumpIfNotUniqueName(FieldOperand(scratch, Map::kInstanceTypeOffset),
+ &maybe_in_dictionary);
}
}
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698