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

Side by Side Diff: src/mips/lithium-codegen-mips.cc

Issue 301023004: MIPS: Refactor HType to get rid of various hacks. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 6 years, 6 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 | « no previous file | src/mips/lithium-mips.cc » ('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.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2428 matching lines...) Expand 10 before | Expand all | Expand 10 after
2439 2439
2440 return lt; 2440 return lt;
2441 } 2441 }
2442 2442
2443 2443
2444 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { 2444 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) {
2445 Register reg = ToRegister(instr->value()); 2445 Register reg = ToRegister(instr->value());
2446 Register temp1 = ToRegister(instr->temp()); 2446 Register temp1 = ToRegister(instr->temp());
2447 2447
2448 SmiCheck check_needed = 2448 SmiCheck check_needed =
2449 instr->hydrogen()->value()->IsHeapObject() 2449 instr->hydrogen()->value()->type().IsHeapObject()
2450 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 2450 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
2451 Condition true_cond = 2451 Condition true_cond =
2452 EmitIsString(reg, temp1, instr->FalseLabel(chunk_), check_needed); 2452 EmitIsString(reg, temp1, instr->FalseLabel(chunk_), check_needed);
2453 2453
2454 EmitBranch(instr, true_cond, temp1, 2454 EmitBranch(instr, true_cond, temp1,
2455 Operand(FIRST_NONSTRING_TYPE)); 2455 Operand(FIRST_NONSTRING_TYPE));
2456 } 2456 }
2457 2457
2458 2458
2459 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { 2459 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) {
2460 Register input_reg = EmitLoadRegister(instr->value(), at); 2460 Register input_reg = EmitLoadRegister(instr->value(), at);
2461 __ And(at, input_reg, kSmiTagMask); 2461 __ And(at, input_reg, kSmiTagMask);
2462 EmitBranch(instr, eq, at, Operand(zero_reg)); 2462 EmitBranch(instr, eq, at, Operand(zero_reg));
2463 } 2463 }
2464 2464
2465 2465
2466 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { 2466 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) {
2467 Register input = ToRegister(instr->value()); 2467 Register input = ToRegister(instr->value());
2468 Register temp = ToRegister(instr->temp()); 2468 Register temp = ToRegister(instr->temp());
2469 2469
2470 if (!instr->hydrogen()->value()->IsHeapObject()) { 2470 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
2471 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); 2471 __ JumpIfSmi(input, instr->FalseLabel(chunk_));
2472 } 2472 }
2473 __ lw(temp, FieldMemOperand(input, HeapObject::kMapOffset)); 2473 __ lw(temp, FieldMemOperand(input, HeapObject::kMapOffset));
2474 __ lbu(temp, FieldMemOperand(temp, Map::kBitFieldOffset)); 2474 __ lbu(temp, FieldMemOperand(temp, Map::kBitFieldOffset));
2475 __ And(at, temp, Operand(1 << Map::kIsUndetectable)); 2475 __ And(at, temp, Operand(1 << Map::kIsUndetectable));
2476 EmitBranch(instr, ne, at, Operand(zero_reg)); 2476 EmitBranch(instr, ne, at, Operand(zero_reg));
2477 } 2477 }
2478 2478
2479 2479
2480 static Condition ComputeCompareCondition(Token::Value op) { 2480 static Condition ComputeCompareCondition(Token::Value op) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 if (from == FIRST_TYPE) return ls; 2527 if (from == FIRST_TYPE) return ls;
2528 UNREACHABLE(); 2528 UNREACHABLE();
2529 return eq; 2529 return eq;
2530 } 2530 }
2531 2531
2532 2532
2533 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { 2533 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) {
2534 Register scratch = scratch0(); 2534 Register scratch = scratch0();
2535 Register input = ToRegister(instr->value()); 2535 Register input = ToRegister(instr->value());
2536 2536
2537 if (!instr->hydrogen()->value()->IsHeapObject()) { 2537 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
2538 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); 2538 __ JumpIfSmi(input, instr->FalseLabel(chunk_));
2539 } 2539 }
2540 2540
2541 __ GetObjectType(input, scratch, scratch); 2541 __ GetObjectType(input, scratch, scratch);
2542 EmitBranch(instr, 2542 EmitBranch(instr,
2543 BranchCondition(instr->hydrogen()), 2543 BranchCondition(instr->hydrogen()),
2544 scratch, 2544 scratch,
2545 Operand(TestType(instr->hydrogen()))); 2545 Operand(TestType(instr->hydrogen())));
2546 } 2546 }
2547 2547
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
2945 if (instr->hydrogen()->DeoptimizesOnHole()) { 2945 if (instr->hydrogen()->DeoptimizesOnHole()) {
2946 DeoptimizeIf(eq, instr->environment(), scratch, Operand(at)); 2946 DeoptimizeIf(eq, instr->environment(), scratch, Operand(at));
2947 } else { 2947 } else {
2948 __ Branch(&skip_assignment, ne, scratch, Operand(at)); 2948 __ Branch(&skip_assignment, ne, scratch, Operand(at));
2949 } 2949 }
2950 } 2950 }
2951 2951
2952 __ sw(value, target); 2952 __ sw(value, target);
2953 if (instr->hydrogen()->NeedsWriteBarrier()) { 2953 if (instr->hydrogen()->NeedsWriteBarrier()) {
2954 SmiCheck check_needed = 2954 SmiCheck check_needed =
2955 instr->hydrogen()->value()->IsHeapObject() 2955 instr->hydrogen()->value()->type().IsHeapObject()
2956 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 2956 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
2957 __ RecordWriteContextSlot(context, 2957 __ RecordWriteContextSlot(context,
2958 target.offset(), 2958 target.offset(),
2959 value, 2959 value,
2960 scratch0(), 2960 scratch0(),
2961 GetRAState(), 2961 GetRAState(),
2962 kSaveFPRegs, 2962 kSaveFPRegs,
2963 EMIT_REMEMBERED_SET, 2963 EMIT_REMEMBERED_SET,
2964 check_needed); 2964 check_needed);
2965 } 2965 }
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
4321 __ addu(scratch, elements, scratch); 4321 __ addu(scratch, elements, scratch);
4322 } else { 4322 } else {
4323 __ sll(scratch, key, kPointerSizeLog2); 4323 __ sll(scratch, key, kPointerSizeLog2);
4324 __ addu(scratch, elements, scratch); 4324 __ addu(scratch, elements, scratch);
4325 } 4325 }
4326 } 4326 }
4327 __ sw(value, MemOperand(store_base, offset)); 4327 __ sw(value, MemOperand(store_base, offset));
4328 4328
4329 if (instr->hydrogen()->NeedsWriteBarrier()) { 4329 if (instr->hydrogen()->NeedsWriteBarrier()) {
4330 SmiCheck check_needed = 4330 SmiCheck check_needed =
4331 instr->hydrogen()->value()->IsHeapObject() 4331 instr->hydrogen()->value()->type().IsHeapObject()
4332 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; 4332 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
4333 // Compute address of modified element and store it into key register. 4333 // Compute address of modified element and store it into key register.
4334 __ Addu(key, store_base, Operand(offset)); 4334 __ Addu(key, store_base, Operand(offset));
4335 __ RecordWrite(elements, 4335 __ RecordWrite(elements,
4336 key, 4336 key,
4337 value, 4337 value,
4338 GetRAState(), 4338 GetRAState(),
4339 kSaveFPRegs, 4339 kSaveFPRegs,
4340 EMIT_REMEMBERED_SET, 4340 EMIT_REMEMBERED_SET,
4341 check_needed); 4341 check_needed);
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
5037 5037
5038 5038
5039 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { 5039 void LCodeGen::DoCheckSmi(LCheckSmi* instr) {
5040 LOperand* input = instr->value(); 5040 LOperand* input = instr->value();
5041 __ SmiTst(ToRegister(input), at); 5041 __ SmiTst(ToRegister(input), at);
5042 DeoptimizeIf(ne, instr->environment(), at, Operand(zero_reg)); 5042 DeoptimizeIf(ne, instr->environment(), at, Operand(zero_reg));
5043 } 5043 }
5044 5044
5045 5045
5046 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { 5046 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) {
5047 if (!instr->hydrogen()->value()->IsHeapObject()) { 5047 if (!instr->hydrogen()->value()->type().IsHeapObject()) {
5048 LOperand* input = instr->value(); 5048 LOperand* input = instr->value();
5049 __ SmiTst(ToRegister(input), at); 5049 __ SmiTst(ToRegister(input), at);
5050 DeoptimizeIf(eq, instr->environment(), at, Operand(zero_reg)); 5050 DeoptimizeIf(eq, instr->environment(), at, Operand(zero_reg));
5051 } 5051 }
5052 } 5052 }
5053 5053
5054 5054
5055 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { 5055 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
5056 Register input = ToRegister(instr->value()); 5056 Register input = ToRegister(instr->value());
5057 Register scratch = scratch0(); 5057 Register scratch = scratch0();
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
5876 __ lw(result, FieldMemOperand(scratch, 5876 __ lw(result, FieldMemOperand(scratch,
5877 FixedArray::kHeaderSize - kPointerSize)); 5877 FixedArray::kHeaderSize - kPointerSize));
5878 __ bind(deferred->exit()); 5878 __ bind(deferred->exit());
5879 __ bind(&done); 5879 __ bind(&done);
5880 } 5880 }
5881 5881
5882 5882
5883 #undef __ 5883 #undef __
5884 5884
5885 } } // namespace v8::internal 5885 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698