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

Side by Side Diff: src/crankshaft/s390/lithium-codegen-s390.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/ppc/lithium-ppc.cc ('k') | src/crankshaft/s390/lithium-s390.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 // 2 //
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 #include "src/crankshaft/s390/lithium-codegen-s390.h" 6 #include "src/crankshaft/s390/lithium-codegen-s390.h"
7 7
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2423 matching lines...) Expand 10 before | Expand all | Expand 10 after
2434 Register input = ToRegister(instr->value()); 2434 Register input = ToRegister(instr->value());
2435 2435
2436 if (!instr->hydrogen()->value()->type().IsHeapObject()) { 2436 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
2437 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); 2437 __ JumpIfSmi(input, instr->FalseLabel(chunk_));
2438 } 2438 }
2439 2439
2440 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen())); 2440 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen()));
2441 EmitBranch(instr, BranchCondition(instr->hydrogen())); 2441 EmitBranch(instr, BranchCondition(instr->hydrogen()));
2442 } 2442 }
2443 2443
2444 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
2445 Register input = ToRegister(instr->value());
2446 Register result = ToRegister(instr->result());
2447
2448 __ AssertString(input);
2449
2450 __ LoadlW(result, FieldMemOperand(input, String::kHashFieldOffset));
2451 __ IndexFromHash(result, result);
2452 }
2453
2454 void LCodeGen::DoHasCachedArrayIndexAndBranch(
2455 LHasCachedArrayIndexAndBranch* instr) {
2456 Register input = ToRegister(instr->value());
2457 Register scratch = scratch0();
2458
2459 __ LoadlW(scratch, FieldMemOperand(input, String::kHashFieldOffset));
2460 __ mov(r0, Operand(String::kContainsCachedArrayIndexMask));
2461 __ AndP(r0, scratch);
2462 EmitBranch(instr, eq);
2463 }
2464
2465 // Branches to a label or falls through with the answer in flags. Trashes 2444 // Branches to a label or falls through with the answer in flags. Trashes
2466 // the temp registers, but not the input. 2445 // the temp registers, but not the input.
2467 void LCodeGen::EmitClassOfTest(Label* is_true, Label* is_false, 2446 void LCodeGen::EmitClassOfTest(Label* is_true, Label* is_false,
2468 Handle<String> class_name, Register input, 2447 Handle<String> class_name, Register input,
2469 Register temp, Register temp2) { 2448 Register temp, Register temp2) {
2470 DCHECK(!input.is(temp)); 2449 DCHECK(!input.is(temp));
2471 DCHECK(!input.is(temp2)); 2450 DCHECK(!input.is(temp2));
2472 DCHECK(!temp.is(temp2)); 2451 DCHECK(!temp.is(temp2));
2473 2452
2474 __ JumpIfSmi(input, is_false); 2453 __ JumpIfSmi(input, is_false);
(...skipping 3100 matching lines...) Expand 10 before | Expand all | Expand 10 after
5575 __ LoadP(result, 5554 __ LoadP(result,
5576 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); 5555 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize));
5577 __ bind(deferred->exit()); 5556 __ bind(deferred->exit());
5578 __ bind(&done); 5557 __ bind(&done);
5579 } 5558 }
5580 5559
5581 #undef __ 5560 #undef __
5582 5561
5583 } // namespace internal 5562 } // namespace internal
5584 } // namespace v8 5563 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/ppc/lithium-ppc.cc ('k') | src/crankshaft/s390/lithium-s390.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698