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

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

Issue 1106002: Fix bug when generating a fast smi loop.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 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 | « no previous file | test/mjsunit/compiler/loopcount.js » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 3748 matching lines...) Expand 10 before | Expand all | Expand 10 after
3759 // Record the source position of the statement as this code which 3759 // Record the source position of the statement as this code which
3760 // is after the code for the body actually belongs to the loop 3760 // is after the code for the body actually belongs to the loop
3761 // statement and not the body. 3761 // statement and not the body.
3762 CodeForStatementPosition(node); 3762 CodeForStatementPosition(node);
3763 Visit(node->next()); 3763 Visit(node->next());
3764 } 3764 }
3765 } 3765 }
3766 3766
3767 // Set the type of the loop variable to smi before compiling the test 3767 // Set the type of the loop variable to smi before compiling the test
3768 // expression if we are in a fast smi loop condition. 3768 // expression if we are in a fast smi loop condition.
3769 if (node->is_fast_smi_loop()) { 3769 if (node->is_fast_smi_loop() && has_valid_frame()) {
3770 // Set number type of the loop variable to smi. 3770 // Set number type of the loop variable to smi.
3771 Slot* slot = node->loop_variable()->slot(); 3771 Slot* slot = node->loop_variable()->slot();
3772 ASSERT(slot->type() == Slot::LOCAL); 3772 ASSERT(slot->type() == Slot::LOCAL);
3773 frame_->SetTypeForLocalAt(slot->index(), NumberInfo::Smi()); 3773 frame_->SetTypeForLocalAt(slot->index(), NumberInfo::Smi());
3774 if (FLAG_debug_code) { 3774 if (FLAG_debug_code) {
3775 frame_->PushLocalAt(slot->index()); 3775 frame_->PushLocalAt(slot->index());
3776 Result var = frame_->Pop(); 3776 Result var = frame_->Pop();
3777 var.ToRegister(); 3777 var.ToRegister();
3778 __ AbortIfNotSmi(var.reg(), "Loop variable not a smi."); 3778 __ AbortIfNotSmi(var.reg(), "Loop variable not a smi.");
3779 } 3779 }
(...skipping 8468 matching lines...) Expand 10 before | Expand all | Expand 10 after
12248 12248
12249 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) 12249 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
12250 // tagged as a small integer. 12250 // tagged as a small integer.
12251 __ bind(&runtime); 12251 __ bind(&runtime);
12252 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); 12252 __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
12253 } 12253 }
12254 12254
12255 #undef __ 12255 #undef __
12256 12256
12257 } } // namespace v8::internal 12257 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/compiler/loopcount.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698