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

Side by Side Diff: src/crankshaft/mips64/lithium-codegen-mips64.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/mips/lithium-mips.cc ('k') | src/crankshaft/mips64/lithium-mips64.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/mips64/lithium-codegen-mips64.h" 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/crankshaft/hydrogen-osr.h" 9 #include "src/crankshaft/hydrogen-osr.h"
10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h"
(...skipping 2384 matching lines...) Expand 10 before | Expand all | Expand 10 after
2395 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); 2395 __ JumpIfSmi(input, instr->FalseLabel(chunk_));
2396 } 2396 }
2397 2397
2398 __ GetObjectType(input, scratch, scratch); 2398 __ GetObjectType(input, scratch, scratch);
2399 EmitBranch(instr, 2399 EmitBranch(instr,
2400 BranchCondition(instr->hydrogen()), 2400 BranchCondition(instr->hydrogen()),
2401 scratch, 2401 scratch,
2402 Operand(TestType(instr->hydrogen()))); 2402 Operand(TestType(instr->hydrogen())));
2403 } 2403 }
2404 2404
2405
2406 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
2407 Register input = ToRegister(instr->value());
2408 Register result = ToRegister(instr->result());
2409
2410 __ AssertString(input);
2411
2412 __ lwu(result, FieldMemOperand(input, String::kHashFieldOffset));
2413 __ IndexFromHash(result, result);
2414 }
2415
2416
2417 void LCodeGen::DoHasCachedArrayIndexAndBranch(
2418 LHasCachedArrayIndexAndBranch* instr) {
2419 Register input = ToRegister(instr->value());
2420 Register scratch = scratch0();
2421
2422 __ lwu(scratch,
2423 FieldMemOperand(input, String::kHashFieldOffset));
2424 __ And(at, scratch, Operand(String::kContainsCachedArrayIndexMask));
2425 EmitBranch(instr, eq, at, Operand(zero_reg));
2426 }
2427
2428
2429 // Branches to a label or falls through with the answer in flags. Trashes 2405 // Branches to a label or falls through with the answer in flags. Trashes
2430 // the temp registers, but not the input. 2406 // the temp registers, but not the input.
2431 void LCodeGen::EmitClassOfTest(Label* is_true, 2407 void LCodeGen::EmitClassOfTest(Label* is_true,
2432 Label* is_false, 2408 Label* is_false,
2433 Handle<String>class_name, 2409 Handle<String>class_name,
2434 Register input, 2410 Register input,
2435 Register temp, 2411 Register temp,
2436 Register temp2) { 2412 Register temp2) {
2437 DCHECK(!input.is(temp)); 2413 DCHECK(!input.is(temp));
2438 DCHECK(!input.is(temp2)); 2414 DCHECK(!input.is(temp2));
(...skipping 3206 matching lines...) Expand 10 before | Expand all | Expand 10 after
5645 __ ld(result, FieldMemOperand(scratch, 5621 __ ld(result, FieldMemOperand(scratch,
5646 FixedArray::kHeaderSize - kPointerSize)); 5622 FixedArray::kHeaderSize - kPointerSize));
5647 __ bind(deferred->exit()); 5623 __ bind(deferred->exit());
5648 __ bind(&done); 5624 __ bind(&done);
5649 } 5625 }
5650 5626
5651 #undef __ 5627 #undef __
5652 5628
5653 } // namespace internal 5629 } // namespace internal
5654 } // namespace v8 5630 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/mips/lithium-mips.cc ('k') | src/crankshaft/mips64/lithium-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698