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

Side by Side Diff: src/ia32/macro-assembler-ia32.cc

Issue 10910161: Partial ia32 implementation of optimized try/catch (by Kevin Millikin) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed build. Created 8 years, 3 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 | « src/ia32/lithium-ia32.cc ('k') | src/isolate.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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 886
887 887
888 void MacroAssembler::JumpToHandlerEntry() { 888 void MacroAssembler::JumpToHandlerEntry() {
889 // Compute the handler entry address and jump to it. The handler table is 889 // Compute the handler entry address and jump to it. The handler table is
890 // a fixed array of (smi-tagged) code offsets. 890 // a fixed array of (smi-tagged) code offsets.
891 // eax = exception, edi = code object, edx = state. 891 // eax = exception, edi = code object, edx = state.
892 mov(ebx, FieldOperand(edi, Code::kHandlerTableOffset)); 892 mov(ebx, FieldOperand(edi, Code::kHandlerTableOffset));
893 shr(edx, StackHandler::kKindWidth); 893 shr(edx, StackHandler::kKindWidth);
894 mov(edx, FieldOperand(ebx, edx, times_4, FixedArray::kHeaderSize)); 894 mov(edx, FieldOperand(ebx, edx, times_4, FixedArray::kHeaderSize));
895 SmiUntag(edx); 895 SmiUntag(edx);
896 lea(edi, FieldOperand(edi, edx, times_1, Code::kHeaderSize)); 896 // Preserve code object in edi for the optimizer handler.
897 jmp(edi); 897 lea(edx, FieldOperand(edi, edx, times_1, Code::kHeaderSize));
898 jmp(edx);
898 } 899 }
899 900
900 901
901 void MacroAssembler::Throw(Register value) { 902 void MacroAssembler::Throw(Register value) {
902 // Adjust this code if not the case. 903 // Adjust this code if not the case.
903 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); 904 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize);
904 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); 905 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
905 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); 906 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize);
906 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); 907 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize);
907 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); 908 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize);
908 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); 909 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize);
909 910
910 // The exception is expected in eax. 911 // The exception is expected in eax.
911 if (!value.is(eax)) { 912 if (!value.is(eax)) {
912 mov(eax, value); 913 mov(eax, value);
913 } 914 }
914 // Drop the stack pointer to the top of the top handler. 915
916 // Get the handler address.
915 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); 917 ExternalReference handler_address(Isolate::kHandlerAddress, isolate());
916 mov(esp, Operand::StaticVariable(handler_address)); 918 mov(ecx, Operand::StaticVariable(handler_address));
917 // Restore the next handler. 919
920 // Drop the stack pointer to the top of the top handler and restore the
921 // next handler.
922 mov(esp, ecx);
918 pop(Operand::StaticVariable(handler_address)); 923 pop(Operand::StaticVariable(handler_address));
919 924
920 // Remove the code object and state, compute the handler address in edi. 925 // Remove the code object and state, compute the handler address in edi.
921 pop(edi); // Code object. 926 pop(edi); // Code object.
922 pop(edx); // Index and state. 927 pop(edx); // Index and state.
923 928
924 // Restore the context and frame pointer. 929 // Restore the context and frame pointer.
925 pop(esi); // Context. 930 pop(esi); // Context.
926 pop(ebp); // Frame pointer. 931 pop(ebp); // Frame pointer.
927 932
(...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after
2971 j(not_equal, call_runtime); 2976 j(not_equal, call_runtime);
2972 2977
2973 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); 2978 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset));
2974 cmp(ecx, isolate()->factory()->null_value()); 2979 cmp(ecx, isolate()->factory()->null_value());
2975 j(not_equal, &next); 2980 j(not_equal, &next);
2976 } 2981 }
2977 2982
2978 } } // namespace v8::internal 2983 } } // namespace v8::internal
2979 2984
2980 #endif // V8_TARGET_ARCH_IA32 2985 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698