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

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

Issue 14422: Introduced a TempAssign utility because I just couldn't watch this anymore. Y... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years 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/utils.h » ('j') | src/utils.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 2039 matching lines...) Expand 10 before | Expand all | Expand 10 after
2050 // We should probably try to unify the escaping labels and the return 2050 // We should probably try to unify the escaping labels and the return
2051 // label. 2051 // label.
2052 int nof_escapes = node->escaping_labels()->length(); 2052 int nof_escapes = node->escaping_labels()->length();
2053 List<LabelShadow*> shadows(1 + nof_escapes); 2053 List<LabelShadow*> shadows(1 + nof_escapes);
2054 shadows.Add(new LabelShadow(&function_return_)); 2054 shadows.Add(new LabelShadow(&function_return_));
2055 for (int i = 0; i < nof_escapes; i++) { 2055 for (int i = 0; i < nof_escapes; i++) {
2056 shadows.Add(new LabelShadow(node->escaping_labels()->at(i))); 2056 shadows.Add(new LabelShadow(node->escaping_labels()->at(i)));
2057 } 2057 }
2058 2058
2059 // Generate code for the statements in the try block. 2059 // Generate code for the statements in the try block.
2060 bool was_inside_try = is_inside_try_; 2060 { TempAssign<bool> temp(&is_inside_try_, true);
2061 is_inside_try_ = true; 2061 VisitStatements(node->try_block()->statements());
2062 VisitStatements(node->try_block()->statements()); 2062 }
2063 is_inside_try_ = was_inside_try;
2064 2063
2065 // Stop the introduced shadowing and count the number of required unlinks. 2064 // Stop the introduced shadowing and count the number of required unlinks.
2066 // After shadowing stops, the original labels are unshadowed and the 2065 // After shadowing stops, the original labels are unshadowed and the
2067 // LabelShadows represent the formerly shadowing labels. 2066 // LabelShadows represent the formerly shadowing labels.
2068 int nof_unlinks = 0; 2067 int nof_unlinks = 0;
2069 for (int i = 0; i <= nof_escapes; i++) { 2068 for (int i = 0; i <= nof_escapes; i++) {
2070 shadows[i]->StopShadowing(); 2069 shadows[i]->StopShadowing();
2071 if (shadows[i]->is_linked()) nof_unlinks++; 2070 if (shadows[i]->is_linked()) nof_unlinks++;
2072 } 2071 }
2073 2072
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
2148 // We should probably try to unify the escaping labels and the return 2147 // We should probably try to unify the escaping labels and the return
2149 // label. 2148 // label.
2150 int nof_escapes = node->escaping_labels()->length(); 2149 int nof_escapes = node->escaping_labels()->length();
2151 List<LabelShadow*> shadows(1 + nof_escapes); 2150 List<LabelShadow*> shadows(1 + nof_escapes);
2152 shadows.Add(new LabelShadow(&function_return_)); 2151 shadows.Add(new LabelShadow(&function_return_));
2153 for (int i = 0; i < nof_escapes; i++) { 2152 for (int i = 0; i < nof_escapes; i++) {
2154 shadows.Add(new LabelShadow(node->escaping_labels()->at(i))); 2153 shadows.Add(new LabelShadow(node->escaping_labels()->at(i)));
2155 } 2154 }
2156 2155
2157 // Generate code for the statements in the try block. 2156 // Generate code for the statements in the try block.
2158 bool was_inside_try = is_inside_try_; 2157 { TempAssign<bool> temp(&is_inside_try_, true);
2159 is_inside_try_ = true; 2158 VisitStatements(node->try_block()->statements());
2160 VisitStatements(node->try_block()->statements()); 2159 }
2161 is_inside_try_ = was_inside_try;
2162 2160
2163 // Stop the introduced shadowing and count the number of required unlinks. 2161 // Stop the introduced shadowing and count the number of required unlinks.
2164 // After shadowing stops, the original labels are unshadowed and the 2162 // After shadowing stops, the original labels are unshadowed and the
2165 // LabelShadows represent the formerly shadowing labels. 2163 // LabelShadows represent the formerly shadowing labels.
2166 int nof_unlinks = 0; 2164 int nof_unlinks = 0;
2167 for (int i = 0; i <= nof_escapes; i++) { 2165 for (int i = 0; i <= nof_escapes; i++) {
2168 shadows[i]->StopShadowing(); 2166 shadows[i]->StopShadowing();
2169 if (shadows[i]->is_linked()) nof_unlinks++; 2167 if (shadows[i]->is_linked()) nof_unlinks++;
2170 } 2168 }
2171 2169
(...skipping 3027 matching lines...) Expand 10 before | Expand all | Expand 10 after
5199 5197
5200 // Slow-case: Go through the JavaScript implementation. 5198 // Slow-case: Go through the JavaScript implementation.
5201 __ bind(&slow); 5199 __ bind(&slow);
5202 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); 5200 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
5203 } 5201 }
5204 5202
5205 5203
5206 #undef __ 5204 #undef __
5207 5205
5208 } } // namespace v8::internal 5206 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/utils.h » ('j') | src/utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698