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

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

Issue 7216009: Change the handling of stack check on backward branches (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Changed stack check elimination to remove the stack check instruction Created 9 years, 5 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/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 for (int i = 0; i < graph()->blocks()->length(); ++i) { 426 for (int i = 0; i < graph()->blocks()->length(); ++i) {
427 HBasicBlock* block = graph()->blocks()->at(i); 427 HBasicBlock* block = graph()->blocks()->at(i);
428 int first = block->first_instruction_index(); 428 int first = block->first_instruction_index();
429 int last = block->last_instruction_index(); 429 int last = block->last_instruction_index();
430 LInstruction* first_instr = instructions()->at(first); 430 LInstruction* first_instr = instructions()->at(first);
431 LInstruction* last_instr = instructions()->at(last); 431 LInstruction* last_instr = instructions()->at(last);
432 432
433 LLabel* label = LLabel::cast(first_instr); 433 LLabel* label = LLabel::cast(first_instr);
434 if (last_instr->IsGoto()) { 434 if (last_instr->IsGoto()) {
435 LGoto* goto_instr = LGoto::cast(last_instr); 435 LGoto* goto_instr = LGoto::cast(last_instr);
436 if (!goto_instr->include_stack_check() && 436 if (label->IsRedundant() &&
437 label->IsRedundant() &&
438 !label->is_loop_header()) { 437 !label->is_loop_header()) {
439 bool can_eliminate = true; 438 bool can_eliminate = true;
440 for (int i = first + 1; i < last && can_eliminate; ++i) { 439 for (int i = first + 1; i < last && can_eliminate; ++i) {
441 LInstruction* cur = instructions()->at(i); 440 LInstruction* cur = instructions()->at(i);
442 if (cur->IsGap()) { 441 if (cur->IsGap()) {
443 LGap* gap = LGap::cast(cur); 442 LGap* gap = LGap::cast(cur);
444 if (!gap->IsRedundant()) { 443 if (!gap->IsRedundant()) {
445 can_eliminate = false; 444 can_eliminate = false;
446 } 445 }
447 } else { 446 } else {
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 op = UseAny(value); 1035 op = UseAny(value);
1037 } 1036 }
1038 result->AddValue(op, value->representation()); 1037 result->AddValue(op, value->representation());
1039 } 1038 }
1040 1039
1041 return result; 1040 return result;
1042 } 1041 }
1043 1042
1044 1043
1045 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { 1044 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
1046 LInstruction* result = new LGoto(instr->FirstSuccessor()->block_id(), 1045 return new LGoto(instr->FirstSuccessor()->block_id());
1047 instr->include_stack_check());
1048 if (instr->include_stack_check()) result = AssignPointerMap(result);
1049 return result;
1050 } 1046 }
1051 1047
1052 1048
1053 LInstruction* LChunkBuilder::DoTest(HTest* instr) { 1049 LInstruction* LChunkBuilder::DoTest(HTest* instr) {
1054 HValue* v = instr->value(); 1050 HValue* v = instr->value();
1055 if (!v->EmitAtUses()) return new LBranch(UseRegisterAtStart(v)); 1051 if (!v->EmitAtUses()) return new LBranch(UseRegisterAtStart(v));
1056 ASSERT(!v->HasSideEffects()); 1052 ASSERT(!v->HasSideEffects());
1057 if (v->IsClassOfTest()) { 1053 if (v->IsClassOfTest()) {
1058 HClassOfTest* compare = HClassOfTest::cast(v); 1054 HClassOfTest* compare = HClassOfTest::cast(v);
1059 ASSERT(compare->value()->representation().IsTagged()); 1055 ASSERT(compare->value()->representation().IsTagged());
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 set_deoptimization_environment(result->environment()); 2206 set_deoptimization_environment(result->environment());
2211 ClearInstructionPendingDeoptimizationEnvironment(); 2207 ClearInstructionPendingDeoptimizationEnvironment();
2212 return result; 2208 return result;
2213 } 2209 }
2214 2210
2215 return NULL; 2211 return NULL;
2216 } 2212 }
2217 2213
2218 2214
2219 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) { 2215 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) {
2220 return MarkAsCall(new LStackCheck, instr); 2216 if (instr->is_function_entry()) {
2217 return MarkAsCall(new LStackCheck, instr);
2218 } else {
2219 ASSERT(instr->is_backwards_branch());
2220 return AssignEnvironment(AssignPointerMap(new LStackCheck));
2221 }
2221 } 2222 }
2222 2223
2223 2224
2224 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { 2225 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
2225 HEnvironment* outer = current_block_->last_environment(); 2226 HEnvironment* outer = current_block_->last_environment();
2226 HConstant* undefined = graph()->GetConstantUndefined(); 2227 HConstant* undefined = graph()->GetConstantUndefined();
2227 HEnvironment* inner = outer->CopyForInlining(instr->closure(), 2228 HEnvironment* inner = outer->CopyForInlining(instr->closure(),
2228 instr->function(), 2229 instr->function(),
2229 HEnvironment::LITHIUM, 2230 HEnvironment::LITHIUM,
2230 undefined, 2231 undefined,
(...skipping 13 matching lines...) Expand all
2244 2245
2245 LInstruction* LChunkBuilder::DoIn(HIn* instr) { 2246 LInstruction* LChunkBuilder::DoIn(HIn* instr) {
2246 LOperand* key = UseRegisterAtStart(instr->key()); 2247 LOperand* key = UseRegisterAtStart(instr->key());
2247 LOperand* object = UseRegisterAtStart(instr->object()); 2248 LOperand* object = UseRegisterAtStart(instr->object());
2248 LIn* result = new LIn(key, object); 2249 LIn* result = new LIn(key, object);
2249 return MarkAsCall(DefineFixed(result, r0), instr); 2250 return MarkAsCall(DefineFixed(result, r0), instr);
2250 } 2251 }
2251 2252
2252 2253
2253 } } // namespace v8::internal 2254 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698