OLD | NEW |
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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 __ jmp(clause->body_target()); | 979 __ jmp(clause->body_target()); |
980 __ bind(&slow_case); | 980 __ bind(&slow_case); |
981 } | 981 } |
982 | 982 |
983 // Record position before stub call for type feedback. | 983 // Record position before stub call for type feedback. |
984 SetSourcePosition(clause->position()); | 984 SetSourcePosition(clause->position()); |
985 Handle<Code> ic = CompareIC::GetUninitialized(isolate(), Token::EQ_STRICT); | 985 Handle<Code> ic = CompareIC::GetUninitialized(isolate(), Token::EQ_STRICT); |
986 CallIC(ic, RelocInfo::CODE_TARGET, clause->CompareId()); | 986 CallIC(ic, RelocInfo::CODE_TARGET, clause->CompareId()); |
987 patch_site.EmitPatchInfo(); | 987 patch_site.EmitPatchInfo(); |
988 | 988 |
| 989 Label skip; |
| 990 __ jmp(&skip, Label::kNear); |
| 991 PrepareForBailout(clause, TOS_REG); |
| 992 __ CompareRoot(rax, Heap::kTrueValueRootIndex); |
| 993 __ j(not_equal, &next_test); |
| 994 __ Drop(1); |
| 995 __ jmp(clause->body_target()); |
| 996 __ bind(&skip); |
| 997 |
989 __ testq(rax, rax); | 998 __ testq(rax, rax); |
990 __ j(not_equal, &next_test); | 999 __ j(not_equal, &next_test); |
991 __ Drop(1); // Switch value is no longer needed. | 1000 __ Drop(1); // Switch value is no longer needed. |
992 __ jmp(clause->body_target()); | 1001 __ jmp(clause->body_target()); |
993 } | 1002 } |
994 | 1003 |
995 // Discard the test value and jump to the default if present, otherwise to | 1004 // Discard the test value and jump to the default if present, otherwise to |
996 // the end of the statement. | 1005 // the end of the statement. |
997 __ bind(&next_test); | 1006 __ bind(&next_test); |
998 __ Drop(1); // Switch value is no longer needed. | 1007 __ Drop(1); // Switch value is no longer needed. |
(...skipping 3895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4894 | 4903 |
4895 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4904 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4896 Assembler::target_address_at(call_target_address)); | 4905 Assembler::target_address_at(call_target_address)); |
4897 return OSR_AFTER_STACK_CHECK; | 4906 return OSR_AFTER_STACK_CHECK; |
4898 } | 4907 } |
4899 | 4908 |
4900 | 4909 |
4901 } } // namespace v8::internal | 4910 } } // namespace v8::internal |
4902 | 4911 |
4903 #endif // V8_TARGET_ARCH_X64 | 4912 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |