OLD | NEW |
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 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 __ CallRuntime(Runtime::kReThrow, 1); | 1171 __ CallRuntime(Runtime::kReThrow, 1); |
1172 | 1172 |
1173 // Finally block implementation. | 1173 // Finally block implementation. |
1174 __ bind(&finally_entry); | 1174 __ bind(&finally_entry); |
1175 EnterFinallyBlock(); | 1175 EnterFinallyBlock(); |
1176 { Finally finally_body(this); | 1176 { Finally finally_body(this); |
1177 Visit(stmt->finally_block()); | 1177 Visit(stmt->finally_block()); |
1178 } | 1178 } |
1179 ExitFinallyBlock(); // Return to the calling code. | 1179 ExitFinallyBlock(); // Return to the calling code. |
1180 | 1180 |
1181 // Setup try handler. | 1181 // Set up try handler. |
1182 __ bind(&try_entry); | 1182 __ bind(&try_entry); |
1183 __ PushTryHandler(IN_JAVASCRIPT, TRY_FINALLY_HANDLER, stmt->index()); | 1183 __ PushTryHandler(IN_JAVASCRIPT, TRY_FINALLY_HANDLER, stmt->index()); |
1184 { TryFinally try_body(this, &finally_entry); | 1184 { TryFinally try_body(this, &finally_entry); |
1185 Visit(stmt->try_block()); | 1185 Visit(stmt->try_block()); |
1186 } | 1186 } |
1187 __ PopTryHandler(); | 1187 __ PopTryHandler(); |
1188 // Execute the finally block on the way out. Clobber the unpredictable | 1188 // Execute the finally block on the way out. Clobber the unpredictable |
1189 // value in the result register with one that's safe for GC because the | 1189 // value in the result register with one that's safe for GC because the |
1190 // finally block will unconditionally preserve the result register on the | 1190 // finally block will unconditionally preserve the result register on the |
1191 // stack. | 1191 // stack. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 int* context_length) { | 1277 int* context_length) { |
1278 // The macros used here must preserve the result register. | 1278 // The macros used here must preserve the result register. |
1279 __ Drop(*stack_depth); | 1279 __ Drop(*stack_depth); |
1280 __ PopTryHandler(); | 1280 __ PopTryHandler(); |
1281 *stack_depth = 0; | 1281 *stack_depth = 0; |
1282 return previous_; | 1282 return previous_; |
1283 } | 1283 } |
1284 | 1284 |
1285 | 1285 |
1286 bool FullCodeGenerator::TryLiteralCompare(CompareOperation* expr) { | 1286 bool FullCodeGenerator::TryLiteralCompare(CompareOperation* expr) { |
1287 Expression *sub_expr; | 1287 Expression* sub_expr; |
1288 Handle<String> check; | 1288 Handle<String> check; |
1289 if (expr->IsLiteralCompareTypeof(&sub_expr, &check)) { | 1289 if (expr->IsLiteralCompareTypeof(&sub_expr, &check)) { |
1290 EmitLiteralCompareTypeof(expr, sub_expr, check); | 1290 EmitLiteralCompareTypeof(expr, sub_expr, check); |
1291 return true; | 1291 return true; |
1292 } | 1292 } |
1293 | 1293 |
1294 if (expr->IsLiteralCompareUndefined(&sub_expr)) { | 1294 if (expr->IsLiteralCompareUndefined(&sub_expr)) { |
1295 EmitLiteralCompareNil(expr, sub_expr, kUndefinedValue); | 1295 EmitLiteralCompareNil(expr, sub_expr, kUndefinedValue); |
1296 return true; | 1296 return true; |
1297 } | 1297 } |
1298 | 1298 |
1299 if (expr->IsLiteralCompareNull(&sub_expr)) { | 1299 if (expr->IsLiteralCompareNull(&sub_expr)) { |
1300 EmitLiteralCompareNil(expr, sub_expr, kNullValue); | 1300 EmitLiteralCompareNil(expr, sub_expr, kNullValue); |
1301 return true; | 1301 return true; |
1302 } | 1302 } |
1303 | 1303 |
1304 return false; | 1304 return false; |
1305 } | 1305 } |
1306 | 1306 |
1307 | 1307 |
1308 #undef __ | 1308 #undef __ |
1309 | 1309 |
1310 | 1310 |
1311 } } // namespace v8::internal | 1311 } } // namespace v8::internal |
OLD | NEW |