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

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 110123002: Enable optimization of functions with generic switches. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Adding tests Created 7 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/ast.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 __ b(clause->body_target()); 1018 __ b(clause->body_target());
1019 __ bind(&slow_case); 1019 __ bind(&slow_case);
1020 } 1020 }
1021 1021
1022 // Record position before stub call for type feedback. 1022 // Record position before stub call for type feedback.
1023 SetSourcePosition(clause->position()); 1023 SetSourcePosition(clause->position());
1024 Handle<Code> ic = CompareIC::GetUninitialized(isolate(), Token::EQ_STRICT); 1024 Handle<Code> ic = CompareIC::GetUninitialized(isolate(), Token::EQ_STRICT);
1025 CallIC(ic, RelocInfo::CODE_TARGET, clause->CompareId()); 1025 CallIC(ic, RelocInfo::CODE_TARGET, clause->CompareId());
1026 patch_site.EmitPatchInfo(); 1026 patch_site.EmitPatchInfo();
1027 1027
1028 Label skip;
1029 __ b(&skip);
1030 PrepareForBailout(clause, TOS_REG);
1031 __ LoadRoot(ip, Heap::kTrueValueRootIndex);
1032 __ cmp(r0, ip);
1033 __ b(ne, &next_test);
1034 __ Drop(1);
1035 __ jmp(clause->body_target());
1036 __ bind(&skip);
1037
1028 __ cmp(r0, Operand::Zero()); 1038 __ cmp(r0, Operand::Zero());
1029 __ b(ne, &next_test); 1039 __ b(ne, &next_test);
1030 __ Drop(1); // Switch value is no longer needed. 1040 __ Drop(1); // Switch value is no longer needed.
1031 __ b(clause->body_target()); 1041 __ b(clause->body_target());
1032 } 1042 }
1033 1043
1034 // Discard the test value and jump to the default if present, otherwise to 1044 // Discard the test value and jump to the default if present, otherwise to
1035 // the end of the statement. 1045 // the end of the statement.
1036 __ bind(&next_test); 1046 __ bind(&next_test);
1037 __ Drop(1); // Switch value is no longer needed. 1047 __ Drop(1); // Switch value is no longer needed.
(...skipping 3875 matching lines...) Expand 10 before | Expand all | Expand 10 after
4913 ASSERT(Memory::uint32_at(interrupt_address_pointer) == 4923 ASSERT(Memory::uint32_at(interrupt_address_pointer) ==
4914 reinterpret_cast<uint32_t>( 4924 reinterpret_cast<uint32_t>(
4915 isolate->builtins()->OsrAfterStackCheck()->entry())); 4925 isolate->builtins()->OsrAfterStackCheck()->entry()));
4916 return OSR_AFTER_STACK_CHECK; 4926 return OSR_AFTER_STACK_CHECK;
4917 } 4927 }
4918 4928
4919 4929
4920 } } // namespace v8::internal 4930 } } // namespace v8::internal
4921 4931
4922 #endif // V8_TARGET_ARCH_ARM 4932 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698