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/crankshaft/ia32/lithium-codegen-ia32.cc

Issue 2427673004: [intrinsics] Nuke %HasCachedArrayIndex and %GetCachedArrayIndex. (Closed)
Patch Set: Created 4 years, 2 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 | « src/crankshaft/hydrogen-instructions.cc ('k') | src/crankshaft/ia32/lithium-ia32.h » ('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 // 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/crankshaft/ia32/lithium-codegen-ia32.h" 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h"
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 2169 matching lines...) Expand 10 before | Expand all | Expand 10 after
2180 Register temp = ToRegister(instr->temp()); 2180 Register temp = ToRegister(instr->temp());
2181 2181
2182 if (!instr->hydrogen()->value()->type().IsHeapObject()) { 2182 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
2183 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); 2183 __ JumpIfSmi(input, instr->FalseLabel(chunk_));
2184 } 2184 }
2185 2185
2186 __ CmpObjectType(input, TestType(instr->hydrogen()), temp); 2186 __ CmpObjectType(input, TestType(instr->hydrogen()), temp);
2187 EmitBranch(instr, BranchCondition(instr->hydrogen())); 2187 EmitBranch(instr, BranchCondition(instr->hydrogen()));
2188 } 2188 }
2189 2189
2190
2191 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
2192 Register input = ToRegister(instr->value());
2193 Register result = ToRegister(instr->result());
2194
2195 __ AssertString(input);
2196
2197 __ mov(result, FieldOperand(input, String::kHashFieldOffset));
2198 __ IndexFromHash(result, result);
2199 }
2200
2201
2202 void LCodeGen::DoHasCachedArrayIndexAndBranch(
2203 LHasCachedArrayIndexAndBranch* instr) {
2204 Register input = ToRegister(instr->value());
2205
2206 __ test(FieldOperand(input, String::kHashFieldOffset),
2207 Immediate(String::kContainsCachedArrayIndexMask));
2208 EmitBranch(instr, equal);
2209 }
2210
2211
2212 // Branches to a label or falls through with the answer in the z flag. Trashes 2190 // Branches to a label or falls through with the answer in the z flag. Trashes
2213 // the temp registers, but not the input. 2191 // the temp registers, but not the input.
2214 void LCodeGen::EmitClassOfTest(Label* is_true, 2192 void LCodeGen::EmitClassOfTest(Label* is_true,
2215 Label* is_false, 2193 Label* is_false,
2216 Handle<String>class_name, 2194 Handle<String>class_name,
2217 Register input, 2195 Register input,
2218 Register temp, 2196 Register temp,
2219 Register temp2) { 2197 Register temp2) {
2220 DCHECK(!input.is(temp)); 2198 DCHECK(!input.is(temp));
2221 DCHECK(!input.is(temp2)); 2199 DCHECK(!input.is(temp2));
(...skipping 2962 matching lines...) Expand 10 before | Expand all | Expand 10 after
5184 __ bind(deferred->exit()); 5162 __ bind(deferred->exit());
5185 __ bind(&done); 5163 __ bind(&done);
5186 } 5164 }
5187 5165
5188 #undef __ 5166 #undef __
5189 5167
5190 } // namespace internal 5168 } // namespace internal
5191 } // namespace v8 5169 } // namespace v8
5192 5170
5193 #endif // V8_TARGET_ARCH_IA32 5171 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen-instructions.cc ('k') | src/crankshaft/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698