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

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

Issue 194703008: Fix lazy deopt after tagged binary ops (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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
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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr, 607 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr,
608 HInstruction* hinstr, 608 HInstruction* hinstr,
609 CanDeoptimize can_deoptimize) { 609 CanDeoptimize can_deoptimize) {
610 info()->MarkAsNonDeferredCalling(); 610 info()->MarkAsNonDeferredCalling();
611 #ifdef DEBUG 611 #ifdef DEBUG
612 instr->VerifyCall(); 612 instr->VerifyCall();
613 #endif 613 #endif
614 instr->MarkAsCall(); 614 instr->MarkAsCall();
615 instr = AssignPointerMap(instr); 615 instr = AssignPointerMap(instr);
616 616
617 if (hinstr->HasObservableSideEffects()) {
618 ASSERT(hinstr->next()->IsSimulate());
619 HSimulate* sim = HSimulate::cast(hinstr->next());
620 ASSERT(instruction_pending_deoptimization_environment_ == NULL);
621 ASSERT(pending_deoptimization_ast_id_.IsNone());
622 instruction_pending_deoptimization_environment_ = instr;
623 pending_deoptimization_ast_id_ = sim->ast_id();
624 }
625
626 // If instruction does not have side-effects lazy deoptimization 617 // If instruction does not have side-effects lazy deoptimization
627 // after the call will try to deoptimize to the point before the call. 618 // after the call will try to deoptimize to the point before the call.
628 // Thus we still need to attach environment to this call even if 619 // Thus we still need to attach environment to this call even if
629 // call sequence can not deoptimize eagerly. 620 // call sequence can not deoptimize eagerly.
630 bool needs_environment = 621 bool needs_environment =
631 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || 622 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) ||
632 !hinstr->HasObservableSideEffects(); 623 !hinstr->HasObservableSideEffects();
633 if (needs_environment && !instr->HasEnvironment()) { 624 if (needs_environment && !instr->HasEnvironment()) {
634 instr = AssignEnvironment(instr); 625 instr = AssignEnvironment(instr);
635 } 626 }
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 } 889 }
899 #endif 890 #endif
900 891
901 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { 892 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
902 instr = AssignPointerMap(instr); 893 instr = AssignPointerMap(instr);
903 } 894 }
904 if (FLAG_stress_environments && !instr->HasEnvironment()) { 895 if (FLAG_stress_environments && !instr->HasEnvironment()) {
905 instr = AssignEnvironment(instr); 896 instr = AssignEnvironment(instr);
906 } 897 }
907 chunk_->AddInstruction(instr, current_block_); 898 chunk_->AddInstruction(instr, current_block_);
899
900 if (instr->IsCall()) {
901 HValue* hydrogen_value_for_lazy_bailout = current;
902 if (current->HasObservableSideEffects()) {
903 HSimulate* sim = HSimulate::cast(current->next());
904 ASSERT(instruction_pending_deoptimization_environment_ == NULL);
905 instruction_pending_deoptimization_environment_ = instr;
906 sim->ReplayEnvironment(current_block_->last_environment());
907 hydrogen_value_for_lazy_bailout = sim;
908 }
909 LInstruction* bailout = AssignEnvironment(new(zone()) LLazyBailout());
910 bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout);
911 chunk_->AddInstruction(bailout, current_block_);
912 if (instruction_pending_deoptimization_environment_ != NULL) {
913 // Store the lazy deopt environment with the instruction if needed.
914 // Right now it is only used for LInstanceOfKnownGlobal.
915 instruction_pending_deoptimization_environment_->
916 SetDeferredLazyDeoptimizationEnvironment(bailout->environment());
917 instruction_pending_deoptimization_environment_ = NULL;
918 }
919 }
908 } 920 }
909 current_instruction_ = old_current; 921 current_instruction_ = old_current;
910 } 922 }
911 923
912 924
913 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { 925 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
914 return new(zone()) LGoto(instr->FirstSuccessor()); 926 return new(zone()) LGoto(instr->FirstSuccessor());
915 } 927 }
916 928
917 929
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
2438 2450
2439 2451
2440 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( 2452 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch(
2441 HIsConstructCallAndBranch* instr) { 2453 HIsConstructCallAndBranch* instr) {
2442 return new(zone()) LIsConstructCallAndBranch(TempRegister()); 2454 return new(zone()) LIsConstructCallAndBranch(TempRegister());
2443 } 2455 }
2444 2456
2445 2457
2446 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) { 2458 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
2447 instr->ReplayEnvironment(current_block_->last_environment()); 2459 instr->ReplayEnvironment(current_block_->last_environment());
2448
2449 // If there is an instruction pending deoptimization environment create a
2450 // lazy bailout instruction to capture the environment.
2451 if (pending_deoptimization_ast_id_ == instr->ast_id()) {
2452 LInstruction* result = new(zone()) LLazyBailout;
2453 result = AssignEnvironment(result);
2454 // Store the lazy deopt environment with the instruction if needed. Right
2455 // now it is only used for LInstanceOfKnownGlobal.
2456 instruction_pending_deoptimization_environment_->
2457 SetDeferredLazyDeoptimizationEnvironment(result->environment());
2458 instruction_pending_deoptimization_environment_ = NULL;
2459 pending_deoptimization_ast_id_ = BailoutId::None();
2460 return result;
2461 }
2462
2463 return NULL; 2460 return NULL;
2464 } 2461 }
2465 2462
2466 2463
2467 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) { 2464 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) {
2468 if (instr->is_function_entry()) { 2465 if (instr->is_function_entry()) {
2469 LOperand* context = UseFixed(instr->context(), cp); 2466 LOperand* context = UseFixed(instr->context(), cp);
2470 return MarkAsCall(new(zone()) LStackCheck(context), instr); 2467 return MarkAsCall(new(zone()) LStackCheck(context), instr);
2471 } else { 2468 } else {
2472 ASSERT(instr->is_backwards_branch()); 2469 ASSERT(instr->is_backwards_branch());
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
2536 } 2533 }
2537 2534
2538 2535
2539 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2536 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2540 LOperand* object = UseRegister(instr->object()); 2537 LOperand* object = UseRegister(instr->object());
2541 LOperand* index = UseRegister(instr->index()); 2538 LOperand* index = UseRegister(instr->index());
2542 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2539 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2543 } 2540 }
2544 2541
2545 } } // namespace v8::internal 2542 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698