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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 12296026: ES6 symbols: Implement Symbol intrinsic and basic functionality (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed more comments Created 7 years, 9 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/ia32/builtins-ia32.cc ('k') | src/ia32/full-codegen-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 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 6874 matching lines...) Expand 10 before | Expand all | Expand 10 after
6885 STATIC_ASSERT(kSmiTag == 0); 6885 STATIC_ASSERT(kSmiTag == 0);
6886 __ Set(eax, Immediate(Smi::FromInt(EQUAL))); 6886 __ Set(eax, Immediate(Smi::FromInt(EQUAL)));
6887 __ bind(&done); 6887 __ bind(&done);
6888 __ ret(0); 6888 __ ret(0);
6889 6889
6890 __ bind(&miss); 6890 __ bind(&miss);
6891 GenerateMiss(masm); 6891 GenerateMiss(masm);
6892 } 6892 }
6893 6893
6894 6894
6895 void ICCompareStub::GenerateUniqueNames(MacroAssembler* masm) {
6896 ASSERT(state_ == CompareIC::UNIQUE_NAME);
6897 ASSERT(GetCondition() == equal);
6898
6899 // Registers containing left and right operands respectively.
6900 Register left = edx;
6901 Register right = eax;
6902 Register tmp1 = ecx;
6903 Register tmp2 = ebx;
6904
6905 // Check that both operands are heap objects.
6906 Label miss;
6907 __ mov(tmp1, left);
6908 STATIC_ASSERT(kSmiTag == 0);
6909 __ and_(tmp1, right);
6910 __ JumpIfSmi(tmp1, &miss, Label::kNear);
6911
6912 // Check that both operands are unique names. This leaves the instance
6913 // types loaded in tmp1 and tmp2.
6914 STATIC_ASSERT(kInternalizedTag != 0);
6915 __ mov(tmp1, FieldOperand(left, HeapObject::kMapOffset));
6916 __ mov(tmp2, FieldOperand(right, HeapObject::kMapOffset));
6917 __ movzx_b(tmp1, FieldOperand(tmp1, Map::kInstanceTypeOffset));
6918 __ movzx_b(tmp2, FieldOperand(tmp2, Map::kInstanceTypeOffset));
6919
6920 Label succeed1;
6921 __ test(tmp1, Immediate(kIsInternalizedMask));
6922 __ j(not_zero, &succeed1);
6923 __ cmpb(tmp1, static_cast<int8_t>(SYMBOL_TYPE));
6924 __ j(not_equal, &miss);
6925 __ bind(&succeed1);
6926
6927 Label succeed2;
6928 __ test(tmp2, Immediate(kIsInternalizedMask));
6929 __ j(not_zero, &succeed2);
6930 __ cmpb(tmp2, static_cast<int8_t>(SYMBOL_TYPE));
6931 __ j(not_equal, &miss);
6932 __ bind(&succeed2);
6933
6934 // Unique names are compared by identity.
6935 Label done;
6936 __ cmp(left, right);
6937 // Make sure eax is non-zero. At this point input operands are
6938 // guaranteed to be non-zero.
6939 ASSERT(right.is(eax));
6940 __ j(not_equal, &done, Label::kNear);
6941 STATIC_ASSERT(EQUAL == 0);
6942 STATIC_ASSERT(kSmiTag == 0);
6943 __ Set(eax, Immediate(Smi::FromInt(EQUAL)));
6944 __ bind(&done);
6945 __ ret(0);
6946
6947 __ bind(&miss);
6948 GenerateMiss(masm);
6949 }
6950
6951
6895 void ICCompareStub::GenerateStrings(MacroAssembler* masm) { 6952 void ICCompareStub::GenerateStrings(MacroAssembler* masm) {
6896 ASSERT(state_ == CompareIC::STRING); 6953 ASSERT(state_ == CompareIC::STRING);
6897 Label miss; 6954 Label miss;
6898 6955
6899 bool equality = Token::IsEqualityOp(op_); 6956 bool equality = Token::IsEqualityOp(op_);
6900 6957
6901 // Registers containing left and right operands respectively. 6958 // Registers containing left and right operands respectively.
6902 Register left = edx; 6959 Register left = edx;
6903 Register right = eax; 6960 Register right = eax;
6904 Register tmp1 = ecx; 6961 Register tmp1 = ecx;
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
7687 // Restore ecx. 7744 // Restore ecx.
7688 __ pop(ecx); 7745 __ pop(ecx);
7689 __ ret(0); 7746 __ ret(0);
7690 } 7747 }
7691 7748
7692 #undef __ 7749 #undef __
7693 7750
7694 } } // namespace v8::internal 7751 } } // namespace v8::internal
7695 7752
7696 #endif // V8_TARGET_ARCH_IA32 7753 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698