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

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

Issue 267050: Add a pair of missing breaks to a switch statement. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 2 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 2987 matching lines...) Expand 10 before | Expand all | Expand 10 after
2998 // necessary. 2998 // necessary.
2999 switch (info) { 2999 switch (info) {
3000 case ALWAYS_TRUE: 3000 case ALWAYS_TRUE:
3001 if (has_valid_frame()) { 3001 if (has_valid_frame()) {
3002 if (node->next() == NULL) { 3002 if (node->next() == NULL) {
3003 node->continue_target()->Jump(); 3003 node->continue_target()->Jump();
3004 } else { 3004 } else {
3005 loop.Jump(); 3005 loop.Jump();
3006 } 3006 }
3007 } 3007 }
3008 break;
3008 case DONT_KNOW: 3009 case DONT_KNOW:
3009 if (test_at_bottom) { 3010 if (test_at_bottom) {
3010 if (node->continue_target()->is_linked()) { 3011 if (node->continue_target()->is_linked()) {
3011 // We can have dangling jumps to the continue target if there 3012 // We can have dangling jumps to the continue target if there
3012 // was no update expression. 3013 // was no update expression.
3013 node->continue_target()->Bind(); 3014 node->continue_target()->Bind();
3014 } 3015 }
3015 // Control can reach the test at the bottom by falling out of 3016 // Control can reach the test at the bottom by falling out of
3016 // the body, by a continue in the body, or from the update 3017 // the body, by a continue in the body, or from the update
3017 // expression. 3018 // expression.
3018 if (has_valid_frame()) { 3019 if (has_valid_frame()) {
3019 // The break target is the fall-through (body is a backward 3020 // The break target is the fall-through (body is a backward
3020 // jump from here). 3021 // jump from here).
3021 ControlDestination dest(&body, node->break_target(), false); 3022 ControlDestination dest(&body, node->break_target(), false);
3022 LoadCondition(node->cond(), NOT_INSIDE_TYPEOF, &dest, true); 3023 LoadCondition(node->cond(), NOT_INSIDE_TYPEOF, &dest, true);
3023 } 3024 }
3024 } else { 3025 } else {
3025 // Otherwise, jump back to the test at the top. 3026 // Otherwise, jump back to the test at the top.
3026 if (has_valid_frame()) { 3027 if (has_valid_frame()) {
3027 if (node->next() == NULL) { 3028 if (node->next() == NULL) {
3028 node->continue_target()->Jump(); 3029 node->continue_target()->Jump();
3029 } else { 3030 } else {
3030 loop.Jump(); 3031 loop.Jump();
3031 } 3032 }
3032 } 3033 }
3033 } 3034 }
3035 break;
3034 case ALWAYS_FALSE: 3036 case ALWAYS_FALSE:
3035 UNREACHABLE(); 3037 UNREACHABLE();
3036 break; 3038 break;
3037 } 3039 }
3038 3040
3039 // The break target may be already bound (by the condition), or 3041 // The break target may be already bound (by the condition), or
3040 // there may not be a valid frame. Bind it only if needed. 3042 // there may not be a valid frame. Bind it only if needed.
3041 if (node->break_target()->is_linked()) { 3043 if (node->break_target()->is_linked()) {
3042 node->break_target()->Bind(); 3044 node->break_target()->Bind();
3043 } 3045 }
(...skipping 5080 matching lines...) Expand 10 before | Expand all | Expand 10 after
8124 8126
8125 int CompareStub::MinorKey() { 8127 int CompareStub::MinorKey() {
8126 // Encode the two parameters in a unique 16 bit value. 8128 // Encode the two parameters in a unique 16 bit value.
8127 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); 8129 ASSERT(static_cast<unsigned>(cc_) < (1 << 15));
8128 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); 8130 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0);
8129 } 8131 }
8130 8132
8131 #undef __ 8133 #undef __
8132 8134
8133 } } // namespace v8::internal 8135 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698