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

Side by Side Diff: src/mips/lithium-codegen-mips.cc

Issue 9254025: MIPS: Tiny improvement of register constraints in LClassOfTest instructions. (Closed)
Patch Set: Created 8 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 | « no previous file | src/mips/lithium-mips.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 1844 matching lines...) Expand 10 before | Expand all | Expand 10 after
1855 int true_block = chunk_->LookupDestination(instr->true_block_id()); 1855 int true_block = chunk_->LookupDestination(instr->true_block_id());
1856 int false_block = chunk_->LookupDestination(instr->false_block_id()); 1856 int false_block = chunk_->LookupDestination(instr->false_block_id());
1857 1857
1858 __ lw(scratch, 1858 __ lw(scratch,
1859 FieldMemOperand(input, String::kHashFieldOffset)); 1859 FieldMemOperand(input, String::kHashFieldOffset));
1860 __ And(at, scratch, Operand(String::kContainsCachedArrayIndexMask)); 1860 __ And(at, scratch, Operand(String::kContainsCachedArrayIndexMask));
1861 EmitBranch(true_block, false_block, eq, at, Operand(zero_reg)); 1861 EmitBranch(true_block, false_block, eq, at, Operand(zero_reg));
1862 } 1862 }
1863 1863
1864 1864
1865 // Branches to a label or falls through with this instance class-name adr 1865 // Branches to a label or falls through with the answer in flags. Trashes
1866 // returned in temp reg, available for comparison by the caller. Trashes the 1866 // the temp registers, but not the input.
1867 // temp registers, but not the input. Only input and temp2 may alias.
1868 void LCodeGen::EmitClassOfTest(Label* is_true, 1867 void LCodeGen::EmitClassOfTest(Label* is_true,
1869 Label* is_false, 1868 Label* is_false,
1870 Handle<String>class_name, 1869 Handle<String>class_name,
1871 Register input, 1870 Register input,
1872 Register temp, 1871 Register temp,
1873 Register temp2) { 1872 Register temp2) {
1874 ASSERT(!input.is(temp)); 1873 ASSERT(!input.is(temp));
1875 ASSERT(!temp.is(temp2)); // But input and temp2 may be the same register. 1874 ASSERT(!input.is(temp2));
1875 ASSERT(!temp.is(temp2));
1876
1876 __ JumpIfSmi(input, is_false); 1877 __ JumpIfSmi(input, is_false);
1877 1878
1878 if (class_name->IsEqualTo(CStrVector("Function"))) { 1879 if (class_name->IsEqualTo(CStrVector("Function"))) {
1879 // Assuming the following assertions, we can use the same compares to test 1880 // Assuming the following assertions, we can use the same compares to test
1880 // for both being a function type and being in the object type range. 1881 // for both being a function type and being in the object type range.
1881 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 1882 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
1882 STATIC_ASSERT(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE == 1883 STATIC_ASSERT(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE ==
1883 FIRST_SPEC_OBJECT_TYPE + 1); 1884 FIRST_SPEC_OBJECT_TYPE + 1);
1884 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == 1885 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE ==
1885 LAST_SPEC_OBJECT_TYPE - 1); 1886 LAST_SPEC_OBJECT_TYPE - 1);
(...skipping 2820 matching lines...) Expand 10 before | Expand all | Expand 10 after
4706 ASSERT(!environment->HasBeenRegistered()); 4707 ASSERT(!environment->HasBeenRegistered());
4707 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 4708 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
4708 ASSERT(osr_pc_offset_ == -1); 4709 ASSERT(osr_pc_offset_ == -1);
4709 osr_pc_offset_ = masm()->pc_offset(); 4710 osr_pc_offset_ = masm()->pc_offset();
4710 } 4711 }
4711 4712
4712 4713
4713 #undef __ 4714 #undef __
4714 4715
4715 } } // namespace v8::internal 4716 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698