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

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

Issue 6499014: ARM: Implement GetCachedArrayIndex in the lithium code generator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix bugs. Created 9 years, 10 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/arm/lithium-arm.cc ('k') | src/hydrogen.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after
1889 Label* false_label = chunk_->GetAssemblyLabel(false_block); 1889 Label* false_label = chunk_->GetAssemblyLabel(false_block);
1890 1890
1891 __ tst(input, Operand(kSmiTagMask)); 1891 __ tst(input, Operand(kSmiTagMask));
1892 __ b(eq, false_label); 1892 __ b(eq, false_label);
1893 1893
1894 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen())); 1894 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen()));
1895 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); 1895 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen()));
1896 } 1896 }
1897 1897
1898 1898
1899 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
1900 Register input = ToRegister(instr->InputAt(0));
1901 Register result = ToRegister(instr->result());
1902 Register scratch = scratch0();
1903
1904 __ ldr(scratch, FieldMemOperand(input, String::kHashFieldOffset));
1905 __ IndexFromHash(scratch, result);
1906 }
1907
1908
1899 void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) { 1909 void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) {
1900 Register input = ToRegister(instr->InputAt(0)); 1910 Register input = ToRegister(instr->InputAt(0));
1901 Register result = ToRegister(instr->result()); 1911 Register result = ToRegister(instr->result());
1902 Register scratch = scratch0(); 1912 Register scratch = scratch0();
1903 1913
1904 ASSERT(instr->hydrogen()->value()->representation().IsTagged()); 1914 ASSERT(instr->hydrogen()->value()->representation().IsTagged());
1905 __ ldr(scratch, 1915 __ ldr(scratch,
1906 FieldMemOperand(input, String::kContainsCachedArrayIndexMask)); 1916 FieldMemOperand(input, String::kHashFieldOffset));
1907 __ tst(scratch, Operand(String::kContainsCachedArrayIndexMask)); 1917 __ tst(scratch, Operand(String::kContainsCachedArrayIndexMask));
1908 __ LoadRoot(result, Heap::kTrueValueRootIndex, ne); 1918 __ LoadRoot(result, Heap::kTrueValueRootIndex, eq);
1909 __ LoadRoot(result, Heap::kFalseValueRootIndex, eq); 1919 __ LoadRoot(result, Heap::kFalseValueRootIndex, ne);
1910 } 1920 }
1911 1921
1912 1922
1913 void LCodeGen::DoHasCachedArrayIndexAndBranch( 1923 void LCodeGen::DoHasCachedArrayIndexAndBranch(
1914 LHasCachedArrayIndexAndBranch* instr) { 1924 LHasCachedArrayIndexAndBranch* instr) {
1915 Register input = ToRegister(instr->InputAt(0)); 1925 Register input = ToRegister(instr->InputAt(0));
1916 Register scratch = scratch0(); 1926 Register scratch = scratch0();
1917 1927
1918 int true_block = chunk_->LookupDestination(instr->true_block_id()); 1928 int true_block = chunk_->LookupDestination(instr->true_block_id());
1919 int false_block = chunk_->LookupDestination(instr->false_block_id()); 1929 int false_block = chunk_->LookupDestination(instr->false_block_id());
1920 1930
1921 __ ldr(scratch, 1931 __ ldr(scratch,
1922 FieldMemOperand(input, String::kContainsCachedArrayIndexMask)); 1932 FieldMemOperand(input, String::kHashFieldOffset));
1923 __ tst(scratch, Operand(String::kContainsCachedArrayIndexMask)); 1933 __ tst(scratch, Operand(String::kContainsCachedArrayIndexMask));
1924 EmitBranch(true_block, false_block, ne); 1934 EmitBranch(true_block, false_block, eq);
1925 } 1935 }
1926 1936
1927 1937
1928 // Branches to a label or falls through with the answer in flags. Trashes 1938 // Branches to a label or falls through with the answer in flags. Trashes
1929 // the temp registers, but not the input. Only input and temp2 may alias. 1939 // the temp registers, but not the input. Only input and temp2 may alias.
1930 void LCodeGen::EmitClassOfTest(Label* is_true, 1940 void LCodeGen::EmitClassOfTest(Label* is_true,
1931 Label* is_false, 1941 Label* is_false,
1932 Handle<String>class_name, 1942 Handle<String>class_name,
1933 Register input, 1943 Register input,
1934 Register temp, 1944 Register temp,
(...skipping 2011 matching lines...) Expand 10 before | Expand all | Expand 10 after
3946 ASSERT(!environment->HasBeenRegistered()); 3956 ASSERT(!environment->HasBeenRegistered());
3947 RegisterEnvironmentForDeoptimization(environment); 3957 RegisterEnvironmentForDeoptimization(environment);
3948 ASSERT(osr_pc_offset_ == -1); 3958 ASSERT(osr_pc_offset_ == -1);
3949 osr_pc_offset_ = masm()->pc_offset(); 3959 osr_pc_offset_ = masm()->pc_offset();
3950 } 3960 }
3951 3961
3952 3962
3953 #undef __ 3963 #undef __
3954 3964
3955 } } // namespace v8::internal 3965 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698