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

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

Issue 201153020: Merged r19834, r19843 into 3.24 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.24
Patch Set: Created 6 years, 9 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/ia32/lithium-ia32.h ('k') | src/mips/lithium-codegen-mips.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 // 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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 HInstruction* hinstr, 672 HInstruction* hinstr,
673 CanDeoptimize can_deoptimize) { 673 CanDeoptimize can_deoptimize) {
674 info()->MarkAsNonDeferredCalling(); 674 info()->MarkAsNonDeferredCalling();
675 675
676 #ifdef DEBUG 676 #ifdef DEBUG
677 instr->VerifyCall(); 677 instr->VerifyCall();
678 #endif 678 #endif
679 instr->MarkAsCall(); 679 instr->MarkAsCall();
680 instr = AssignPointerMap(instr); 680 instr = AssignPointerMap(instr);
681 681
682 if (hinstr->HasObservableSideEffects()) {
683 ASSERT(hinstr->next()->IsSimulate());
684 HSimulate* sim = HSimulate::cast(hinstr->next());
685 ASSERT(instruction_pending_deoptimization_environment_ == NULL);
686 ASSERT(pending_deoptimization_ast_id_.IsNone());
687 instruction_pending_deoptimization_environment_ = instr;
688 pending_deoptimization_ast_id_ = sim->ast_id();
689 }
690
691 // If instruction does not have side-effects lazy deoptimization 682 // If instruction does not have side-effects lazy deoptimization
692 // after the call will try to deoptimize to the point before the call. 683 // after the call will try to deoptimize to the point before the call.
693 // Thus we still need to attach environment to this call even if 684 // Thus we still need to attach environment to this call even if
694 // call sequence can not deoptimize eagerly. 685 // call sequence can not deoptimize eagerly.
695 bool needs_environment = 686 bool needs_environment =
696 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || 687 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) ||
697 !hinstr->HasObservableSideEffects(); 688 !hinstr->HasObservableSideEffects();
698 if (needs_environment && !instr->HasEnvironment()) { 689 if (needs_environment && !instr->HasEnvironment()) {
699 instr = AssignEnvironment(instr); 690 instr = AssignEnvironment(instr);
700 } 691 }
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 LGoto::cast(instr)->jumps_to_join()) { 964 LGoto::cast(instr)->jumps_to_join()) {
974 // TODO(olivf) Since phis of spilled values are joined as registers 965 // TODO(olivf) Since phis of spilled values are joined as registers
975 // (not in the stack slot), we need to allow the goto gaps to keep one 966 // (not in the stack slot), we need to allow the goto gaps to keep one
976 // x87 register alive. To ensure all other values are still spilled, we 967 // x87 register alive. To ensure all other values are still spilled, we
977 // insert a fpu register barrier right before. 968 // insert a fpu register barrier right before.
978 LClobberDoubles* clobber = new(zone()) LClobberDoubles(); 969 LClobberDoubles* clobber = new(zone()) LClobberDoubles();
979 clobber->set_hydrogen_value(current); 970 clobber->set_hydrogen_value(current);
980 chunk_->AddInstruction(clobber, current_block_); 971 chunk_->AddInstruction(clobber, current_block_);
981 } 972 }
982 chunk_->AddInstruction(instr, current_block_); 973 chunk_->AddInstruction(instr, current_block_);
974
975 if (instr->IsCall()) {
976 HValue* hydrogen_value_for_lazy_bailout = current;
977 LInstruction* instruction_needing_environment = NULL;
978 if (current->HasObservableSideEffects()) {
979 HSimulate* sim = HSimulate::cast(current->next());
980 instruction_needing_environment = instr;
981 sim->ReplayEnvironment(current_block_->last_environment());
982 hydrogen_value_for_lazy_bailout = sim;
983 }
984 LInstruction* bailout = AssignEnvironment(new(zone()) LLazyBailout());
985 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout);
986 chunk_->AddInstruction(bailout, current_block_);
987 if (instruction_needing_environment != NULL) {
988 // Store the lazy deopt environment with the instruction if needed.
989 // Right now it is only used for LInstanceOfKnownGlobal.
990 instruction_needing_environment->
991 SetDeferredLazyDeoptimizationEnvironment(bailout->environment());
992 }
993 }
983 } 994 }
984 current_instruction_ = old_current; 995 current_instruction_ = old_current;
985 } 996 }
986 997
987 998
988 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { 999 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
989 return new(zone()) LGoto(instr->FirstSuccessor()); 1000 return new(zone()) LGoto(instr->FirstSuccessor());
990 } 1001 }
991 1002
992 1003
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
2479 2490
2480 2491
2481 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( 2492 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch(
2482 HIsConstructCallAndBranch* instr) { 2493 HIsConstructCallAndBranch* instr) {
2483 return new(zone()) LIsConstructCallAndBranch(TempRegister()); 2494 return new(zone()) LIsConstructCallAndBranch(TempRegister());
2484 } 2495 }
2485 2496
2486 2497
2487 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) { 2498 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
2488 instr->ReplayEnvironment(current_block_->last_environment()); 2499 instr->ReplayEnvironment(current_block_->last_environment());
2489
2490 // If there is an instruction pending deoptimization environment create a
2491 // lazy bailout instruction to capture the environment.
2492 if (!pending_deoptimization_ast_id_.IsNone()) {
2493 ASSERT(pending_deoptimization_ast_id_ == instr->ast_id());
2494 LLazyBailout* lazy_bailout = new(zone()) LLazyBailout;
2495 LInstruction* result = AssignEnvironment(lazy_bailout);
2496 // Store the lazy deopt environment with the instruction if needed. Right
2497 // now it is only used for LInstanceOfKnownGlobal.
2498 instruction_pending_deoptimization_environment_->
2499 SetDeferredLazyDeoptimizationEnvironment(result->environment());
2500 instruction_pending_deoptimization_environment_ = NULL;
2501 pending_deoptimization_ast_id_ = BailoutId::None();
2502 return result;
2503 }
2504
2505 return NULL; 2500 return NULL;
2506 } 2501 }
2507 2502
2508 2503
2509 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) { 2504 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) {
2510 info()->MarkAsDeferredCalling(); 2505 info()->MarkAsDeferredCalling();
2511 if (instr->is_function_entry()) { 2506 if (instr->is_function_entry()) {
2512 LOperand* context = UseFixed(instr->context(), esi); 2507 LOperand* context = UseFixed(instr->context(), esi);
2513 return MarkAsCall(new(zone()) LStackCheck(context), instr); 2508 return MarkAsCall(new(zone()) LStackCheck(context), instr);
2514 } else { 2509 } else {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
2582 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2577 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2583 LOperand* object = UseRegister(instr->object()); 2578 LOperand* object = UseRegister(instr->object());
2584 LOperand* index = UseTempRegister(instr->index()); 2579 LOperand* index = UseTempRegister(instr->index());
2585 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2580 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2586 } 2581 }
2587 2582
2588 2583
2589 } } // namespace v8::internal 2584 } } // namespace v8::internal
2590 2585
2591 #endif // V8_TARGET_ARCH_IA32 2586 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/mips/lithium-codegen-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698