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

Side by Side Diff: src/crankshaft/arm/lithium-codegen-arm.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/arm/lithium-arm.cc ('k') | src/crankshaft/arm64/lithium-arm64.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 #include "src/crankshaft/arm/lithium-codegen-arm.h" 5 #include "src/crankshaft/arm/lithium-codegen-arm.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h"
(...skipping 2369 matching lines...) Expand 10 before | Expand all | Expand 10 after
2380 Register input = ToRegister(instr->value()); 2380 Register input = ToRegister(instr->value());
2381 2381
2382 if (!instr->hydrogen()->value()->type().IsHeapObject()) { 2382 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
2383 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); 2383 __ JumpIfSmi(input, instr->FalseLabel(chunk_));
2384 } 2384 }
2385 2385
2386 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen())); 2386 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen()));
2387 EmitBranch(instr, BranchCondition(instr->hydrogen())); 2387 EmitBranch(instr, BranchCondition(instr->hydrogen()));
2388 } 2388 }
2389 2389
2390
2391 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
2392 Register input = ToRegister(instr->value());
2393 Register result = ToRegister(instr->result());
2394
2395 __ AssertString(input);
2396
2397 __ ldr(result, FieldMemOperand(input, String::kHashFieldOffset));
2398 __ IndexFromHash(result, result);
2399 }
2400
2401
2402 void LCodeGen::DoHasCachedArrayIndexAndBranch(
2403 LHasCachedArrayIndexAndBranch* instr) {
2404 Register input = ToRegister(instr->value());
2405 Register scratch = scratch0();
2406
2407 __ ldr(scratch,
2408 FieldMemOperand(input, String::kHashFieldOffset));
2409 __ tst(scratch, Operand(String::kContainsCachedArrayIndexMask));
2410 EmitBranch(instr, eq);
2411 }
2412
2413
2414 // Branches to a label or falls through with the answer in flags. Trashes 2390 // Branches to a label or falls through with the answer in flags. Trashes
2415 // the temp registers, but not the input. 2391 // the temp registers, but not the input.
2416 void LCodeGen::EmitClassOfTest(Label* is_true, 2392 void LCodeGen::EmitClassOfTest(Label* is_true,
2417 Label* is_false, 2393 Label* is_false,
2418 Handle<String>class_name, 2394 Handle<String>class_name,
2419 Register input, 2395 Register input,
2420 Register temp, 2396 Register temp,
2421 Register temp2) { 2397 Register temp2) {
2422 DCHECK(!input.is(temp)); 2398 DCHECK(!input.is(temp));
2423 DCHECK(!input.is(temp2)); 2399 DCHECK(!input.is(temp2));
(...skipping 3001 matching lines...) Expand 10 before | Expand all | Expand 10 after
5425 __ ldr(result, FieldMemOperand(scratch, 5401 __ ldr(result, FieldMemOperand(scratch,
5426 FixedArray::kHeaderSize - kPointerSize)); 5402 FixedArray::kHeaderSize - kPointerSize));
5427 __ bind(deferred->exit()); 5403 __ bind(deferred->exit());
5428 __ bind(&done); 5404 __ bind(&done);
5429 } 5405 }
5430 5406
5431 #undef __ 5407 #undef __
5432 5408
5433 } // namespace internal 5409 } // namespace internal
5434 } // namespace v8 5410 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/arm/lithium-arm.cc ('k') | src/crankshaft/arm64/lithium-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698