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

Side by Side Diff: src/crankshaft/ppc/lithium-codegen-ppc.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/mips64/lithium-mips64.cc ('k') | src/crankshaft/ppc/lithium-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/ppc/lithium-codegen-ppc.h" 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.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/hydrogen-osr.h" 10 #include "src/crankshaft/hydrogen-osr.h"
(...skipping 2435 matching lines...) Expand 10 before | Expand all | Expand 10 after
2446 Register input = ToRegister(instr->value()); 2446 Register input = ToRegister(instr->value());
2447 2447
2448 if (!instr->hydrogen()->value()->type().IsHeapObject()) { 2448 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
2449 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); 2449 __ JumpIfSmi(input, instr->FalseLabel(chunk_));
2450 } 2450 }
2451 2451
2452 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen())); 2452 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen()));
2453 EmitBranch(instr, BranchCondition(instr->hydrogen())); 2453 EmitBranch(instr, BranchCondition(instr->hydrogen()));
2454 } 2454 }
2455 2455
2456
2457 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
2458 Register input = ToRegister(instr->value());
2459 Register result = ToRegister(instr->result());
2460
2461 __ AssertString(input);
2462
2463 __ lwz(result, FieldMemOperand(input, String::kHashFieldOffset));
2464 __ IndexFromHash(result, result);
2465 }
2466
2467
2468 void LCodeGen::DoHasCachedArrayIndexAndBranch(
2469 LHasCachedArrayIndexAndBranch* instr) {
2470 Register input = ToRegister(instr->value());
2471 Register scratch = scratch0();
2472
2473 __ lwz(scratch, FieldMemOperand(input, String::kHashFieldOffset));
2474 __ mov(r0, Operand(String::kContainsCachedArrayIndexMask));
2475 __ and_(r0, scratch, r0, SetRC);
2476 EmitBranch(instr, eq, cr0);
2477 }
2478
2479
2480 // Branches to a label or falls through with the answer in flags. Trashes 2456 // Branches to a label or falls through with the answer in flags. Trashes
2481 // the temp registers, but not the input. 2457 // the temp registers, but not the input.
2482 void LCodeGen::EmitClassOfTest(Label* is_true, Label* is_false, 2458 void LCodeGen::EmitClassOfTest(Label* is_true, Label* is_false,
2483 Handle<String> class_name, Register input, 2459 Handle<String> class_name, Register input,
2484 Register temp, Register temp2) { 2460 Register temp, Register temp2) {
2485 DCHECK(!input.is(temp)); 2461 DCHECK(!input.is(temp));
2486 DCHECK(!input.is(temp2)); 2462 DCHECK(!input.is(temp2));
2487 DCHECK(!temp.is(temp2)); 2463 DCHECK(!temp.is(temp2));
2488 2464
2489 __ JumpIfSmi(input, is_false); 2465 __ JumpIfSmi(input, is_false);
(...skipping 3189 matching lines...) Expand 10 before | Expand all | Expand 10 after
5679 __ LoadP(result, 5655 __ LoadP(result,
5680 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); 5656 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize));
5681 __ bind(deferred->exit()); 5657 __ bind(deferred->exit());
5682 __ bind(&done); 5658 __ bind(&done);
5683 } 5659 }
5684 5660
5685 #undef __ 5661 #undef __
5686 5662
5687 } // namespace internal 5663 } // namespace internal
5688 } // namespace v8 5664 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/mips64/lithium-mips64.cc ('k') | src/crankshaft/ppc/lithium-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698