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

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

Issue 23005027: Factor out HSimulate::ReplayEnvironment. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed commment by Ben Titzer. Created 7 years, 3 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 | « no previous file | src/hydrogen-instructions.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 2417 matching lines...) Expand 10 before | Expand all | Expand 10 after
2428 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { 2428 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
2429 // There are no real uses of the arguments object. 2429 // There are no real uses of the arguments object.
2430 // arguments.length and element access are supported directly on 2430 // arguments.length and element access are supported directly on
2431 // stack arguments, and any real arguments object use causes a bailout. 2431 // stack arguments, and any real arguments object use causes a bailout.
2432 // So this value is never used. 2432 // So this value is never used.
2433 return NULL; 2433 return NULL;
2434 } 2434 }
2435 2435
2436 2436
2437 LInstruction* LChunkBuilder::DoCapturedObject(HCapturedObject* instr) { 2437 LInstruction* LChunkBuilder::DoCapturedObject(HCapturedObject* instr) {
2438 HEnvironment* env = current_block_->last_environment(); 2438 instr->ReplayEnvironment(current_block_->last_environment());
2439 instr->ReplayEnvironment(env);
2440 2439
2441 // There are no real uses of a captured object. 2440 // There are no real uses of a captured object.
2442 return NULL; 2441 return NULL;
2443 } 2442 }
2444 2443
2445 2444
2446 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { 2445 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
2447 info()->MarkAsRequiresFrame(); 2446 info()->MarkAsRequiresFrame();
2448 LOperand* args = UseRegister(instr->arguments()); 2447 LOperand* args = UseRegister(instr->arguments());
2449 LOperand* length; 2448 LOperand* length;
(...skipping 27 matching lines...) Expand all
2477 } 2476 }
2478 2477
2479 2478
2480 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( 2479 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch(
2481 HIsConstructCallAndBranch* instr) { 2480 HIsConstructCallAndBranch* instr) {
2482 return new(zone()) LIsConstructCallAndBranch(TempRegister()); 2481 return new(zone()) LIsConstructCallAndBranch(TempRegister());
2483 } 2482 }
2484 2483
2485 2484
2486 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) { 2485 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
2487 HEnvironment* env = current_block_->last_environment(); 2486 instr->ReplayEnvironment(current_block_->last_environment());
2488 ASSERT(env != NULL);
2489
2490 env->set_ast_id(instr->ast_id());
2491
2492 env->Drop(instr->pop_count());
2493 for (int i = instr->values()->length() - 1; i >= 0; --i) {
2494 HValue* value = instr->values()->at(i);
2495 if (instr->HasAssignedIndexAt(i)) {
2496 env->Bind(instr->GetAssignedIndexAt(i), value);
2497 } else {
2498 env->Push(value);
2499 }
2500 }
2501 2487
2502 // If there is an instruction pending deoptimization environment create a 2488 // If there is an instruction pending deoptimization environment create a
2503 // lazy bailout instruction to capture the environment. 2489 // lazy bailout instruction to capture the environment.
2504 if (pending_deoptimization_ast_id_ == instr->ast_id()) { 2490 if (pending_deoptimization_ast_id_ == instr->ast_id()) {
2505 LInstruction* result = new(zone()) LLazyBailout; 2491 LInstruction* result = new(zone()) LLazyBailout;
2506 result = AssignEnvironment(result); 2492 result = AssignEnvironment(result);
2507 // Store the lazy deopt environment with the instruction if needed. Right 2493 // Store the lazy deopt environment with the instruction if needed. Right
2508 // now it is only used for LInstanceOfKnownGlobal. 2494 // now it is only used for LInstanceOfKnownGlobal.
2509 instruction_pending_deoptimization_environment_-> 2495 instruction_pending_deoptimization_environment_->
2510 SetDeferredLazyDeoptimizationEnvironment(result->environment()); 2496 SetDeferredLazyDeoptimizationEnvironment(result->environment());
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
2587 2573
2588 2574
2589 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2575 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2590 LOperand* object = UseRegister(instr->object()); 2576 LOperand* object = UseRegister(instr->object());
2591 LOperand* index = UseRegister(instr->index()); 2577 LOperand* index = UseRegister(instr->index());
2592 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2578 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2593 } 2579 }
2594 2580
2595 2581
2596 } } // namespace v8::internal 2582 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698