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

Side by Side Diff: src/mips/lithium-mips.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 | « src/ia32/lithium-ia32.cc ('k') | src/x64/lithium-x64.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 2343 matching lines...) Expand 10 before | Expand all | Expand 10 after
2354 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { 2354 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
2355 // There are no real uses of the arguments object. 2355 // There are no real uses of the arguments object.
2356 // arguments.length and element access are supported directly on 2356 // arguments.length and element access are supported directly on
2357 // stack arguments, and any real arguments object use causes a bailout. 2357 // stack arguments, and any real arguments object use causes a bailout.
2358 // So this value is never used. 2358 // So this value is never used.
2359 return NULL; 2359 return NULL;
2360 } 2360 }
2361 2361
2362 2362
2363 LInstruction* LChunkBuilder::DoCapturedObject(HCapturedObject* instr) { 2363 LInstruction* LChunkBuilder::DoCapturedObject(HCapturedObject* instr) {
2364 HEnvironment* env = current_block_->last_environment(); 2364 instr->ReplayEnvironment(current_block_->last_environment());
2365 instr->ReplayEnvironment(env);
2366 2365
2367 // There are no real uses of a captured object. 2366 // There are no real uses of a captured object.
2368 return NULL; 2367 return NULL;
2369 } 2368 }
2370 2369
2371 2370
2372 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) { 2371 LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
2373 info()->MarkAsRequiresFrame(); 2372 info()->MarkAsRequiresFrame();
2374 LOperand* args = UseRegister(instr->arguments()); 2373 LOperand* args = UseRegister(instr->arguments());
2375 LOperand* length; 2374 LOperand* length;
(...skipping 27 matching lines...) Expand all
2403 } 2402 }
2404 2403
2405 2404
2406 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( 2405 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch(
2407 HIsConstructCallAndBranch* instr) { 2406 HIsConstructCallAndBranch* instr) {
2408 return new(zone()) LIsConstructCallAndBranch(TempRegister()); 2407 return new(zone()) LIsConstructCallAndBranch(TempRegister());
2409 } 2408 }
2410 2409
2411 2410
2412 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) { 2411 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
2413 HEnvironment* env = current_block_->last_environment(); 2412 instr->ReplayEnvironment(current_block_->last_environment());
2414 ASSERT(env != NULL);
2415
2416 env->set_ast_id(instr->ast_id());
2417
2418 env->Drop(instr->pop_count());
2419 for (int i = instr->values()->length() - 1; i >= 0; --i) {
2420 HValue* value = instr->values()->at(i);
2421 if (instr->HasAssignedIndexAt(i)) {
2422 env->Bind(instr->GetAssignedIndexAt(i), value);
2423 } else {
2424 env->Push(value);
2425 }
2426 }
2427 2413
2428 // If there is an instruction pending deoptimization environment create a 2414 // If there is an instruction pending deoptimization environment create a
2429 // lazy bailout instruction to capture the environment. 2415 // lazy bailout instruction to capture the environment.
2430 if (pending_deoptimization_ast_id_ == instr->ast_id()) { 2416 if (pending_deoptimization_ast_id_ == instr->ast_id()) {
2431 LInstruction* result = new(zone()) LLazyBailout; 2417 LInstruction* result = new(zone()) LLazyBailout;
2432 result = AssignEnvironment(result); 2418 result = AssignEnvironment(result);
2433 // Store the lazy deopt environment with the instruction if needed. Right 2419 // Store the lazy deopt environment with the instruction if needed. Right
2434 // now it is only used for LInstanceOfKnownGlobal. 2420 // now it is only used for LInstanceOfKnownGlobal.
2435 instruction_pending_deoptimization_environment_-> 2421 instruction_pending_deoptimization_environment_->
2436 SetDeferredLazyDeoptimizationEnvironment(result->environment()); 2422 SetDeferredLazyDeoptimizationEnvironment(result->environment());
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
2513 2499
2514 2500
2515 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2501 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2516 LOperand* object = UseRegister(instr->object()); 2502 LOperand* object = UseRegister(instr->object());
2517 LOperand* index = UseRegister(instr->index()); 2503 LOperand* index = UseRegister(instr->index());
2518 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2504 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2519 } 2505 }
2520 2506
2521 2507
2522 } } // namespace v8::internal 2508 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698