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

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

Issue 151163005: A64: Synchronize with r16356. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/mips/macro-assembler-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. 1 // Copyright 2012 the V8 project authors. All rights reserved.
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 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 LOperand* right = NULL; 716 LOperand* right = NULL;
717 int constant_value = 0; 717 int constant_value = 0;
718 bool does_deopt = false; 718 bool does_deopt = false;
719 if (right_value->IsConstant()) { 719 if (right_value->IsConstant()) {
720 HConstant* constant = HConstant::cast(right_value); 720 HConstant* constant = HConstant::cast(right_value);
721 right = chunk_->DefineConstantOperand(constant); 721 right = chunk_->DefineConstantOperand(constant);
722 constant_value = constant->Integer32Value() & 0x1f; 722 constant_value = constant->Integer32Value() & 0x1f;
723 // Left shifts can deoptimize if we shift by > 0 and the result cannot be 723 // Left shifts can deoptimize if we shift by > 0 and the result cannot be
724 // truncated to smi. 724 // truncated to smi.
725 if (instr->representation().IsSmi() && constant_value > 0) { 725 if (instr->representation().IsSmi() && constant_value > 0) {
726 for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { 726 does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToSmi);
727 if (!it.value()->CheckFlag(HValue::kTruncatingToSmi)) {
728 does_deopt = true;
729 break;
730 }
731 }
732 } 727 }
733 } else { 728 } else {
734 right = UseRegisterAtStart(right_value); 729 right = UseRegisterAtStart(right_value);
735 } 730 }
736 731
737 // Shift operations can deoptimize if we do a logical shift 732 // Shift operations can deoptimize if we do a logical shift
738 // by 0 and the result cannot be truncated to int32. 733 // by 0 and the result cannot be truncated to int32.
739 if (op == Token::SHR && constant_value == 0) { 734 if (op == Token::SHR && constant_value == 0) {
740 if (FLAG_opt_safe_uint32_operations) { 735 if (FLAG_opt_safe_uint32_operations) {
741 does_deopt = !instr->CheckFlag(HInstruction::kUint32); 736 does_deopt = !instr->CheckFlag(HInstruction::kUint32);
742 } else { 737 } else {
743 for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { 738 does_deopt = !instr->CheckUsesForFlag(HValue::kTruncatingToInt32);
744 if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) {
745 does_deopt = true;
746 break;
747 }
748 }
749 } 739 }
750 } 740 }
751 741
752 LInstruction* result = 742 LInstruction* result =
753 DefineAsRegister(new(zone()) LShiftI(op, left, right, does_deopt)); 743 DefineAsRegister(new(zone()) LShiftI(op, left, right, does_deopt));
754 return does_deopt ? AssignEnvironment(result) : result; 744 return does_deopt ? AssignEnvironment(result) : result;
755 } 745 }
756 746
757 747
758 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, 748 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op,
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
2364 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { 2354 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
2365 // There are no real uses of the arguments object. 2355 // There are no real uses of the arguments object.
2366 // arguments.length and element access are supported directly on 2356 // arguments.length and element access are supported directly on
2367 // stack arguments, and any real arguments object use causes a bailout. 2357 // stack arguments, and any real arguments object use causes a bailout.
2368 // So this value is never used. 2358 // So this value is never used.
2369 return NULL; 2359 return NULL;
2370 } 2360 }
2371 2361
2372 2362
2373 LInstruction* LChunkBuilder::DoCapturedObject(HCapturedObject* instr) { 2363 LInstruction* LChunkBuilder::DoCapturedObject(HCapturedObject* instr) {
2364 instr->ReplayEnvironment(current_block_->last_environment());
2365
2374 // There are no real uses of a captured object. 2366 // There are no real uses of a captured object.
2375 return NULL; 2367 return NULL;
2376 } 2368 }
2377 2369
2378 2370
2379 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { 2371 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
2380 info()->MarkAsRequiresFrame(); 2372 info()->MarkAsRequiresFrame();
2381 LOperand* args = UseRegister(instr->arguments()); 2373 LOperand* args = UseRegister(instr->arguments());
2382 LOperand* length; 2374 LOperand* length;
2383 LOperand* index; 2375 LOperand* index;
(...skipping 26 matching lines...) Expand all
2410 } 2402 }
2411 2403
2412 2404
2413 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( 2405 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch(
2414 HIsConstructCallAndBranch* instr) { 2406 HIsConstructCallAndBranch* instr) {
2415 return new(zone()) LIsConstructCallAndBranch(TempRegister()); 2407 return new(zone()) LIsConstructCallAndBranch(TempRegister());
2416 } 2408 }
2417 2409
2418 2410
2419 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) { 2411 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
2420 HEnvironment* env = current_block_->last_environment(); 2412 instr->ReplayEnvironment(current_block_->last_environment());
2421 ASSERT(env != NULL);
2422
2423 env->set_ast_id(instr->ast_id());
2424
2425 env->Drop(instr->pop_count());
2426 for (int i = instr->values()->length() - 1; i >= 0; --i) {
2427 HValue* value = instr->values()->at(i);
2428 if (instr->HasAssignedIndexAt(i)) {
2429 env->Bind(instr->GetAssignedIndexAt(i), value);
2430 } else {
2431 env->Push(value);
2432 }
2433 }
2434 2413
2435 // If there is an instruction pending deoptimization environment create a 2414 // If there is an instruction pending deoptimization environment create a
2436 // lazy bailout instruction to capture the environment. 2415 // lazy bailout instruction to capture the environment.
2437 if (pending_deoptimization_ast_id_ == instr->ast_id()) { 2416 if (pending_deoptimization_ast_id_ == instr->ast_id()) {
2438 LInstruction* result = new(zone()) LLazyBailout; 2417 LInstruction* result = new(zone()) LLazyBailout;
2439 result = AssignEnvironment(result); 2418 result = AssignEnvironment(result);
2440 // Store the lazy deopt environment with the instruction if needed. Right 2419 // Store the lazy deopt environment with the instruction if needed. Right
2441 // now it is only used for LInstanceOfKnownGlobal. 2420 // now it is only used for LInstanceOfKnownGlobal.
2442 instruction_pending_deoptimization_environment_-> 2421 instruction_pending_deoptimization_environment_->
2443 SetDeferredLazyDeoptimizationEnvironment(result->environment()); 2422 SetDeferredLazyDeoptimizationEnvironment(result->environment());
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
2520 2499
2521 2500
2522 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2501 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2523 LOperand* object = UseRegister(instr->object()); 2502 LOperand* object = UseRegister(instr->object());
2524 LOperand* index = UseRegister(instr->index()); 2503 LOperand* index = UseRegister(instr->index());
2525 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2504 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2526 } 2505 }
2527 2506
2528 2507
2529 } } // namespace v8::internal 2508 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698