| 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 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 | 910 |
| 911 | 911 |
| 912 void MacroAssembler::JumpToHandlerEntry() { | 912 void MacroAssembler::JumpToHandlerEntry() { |
| 913 // Compute the handler entry address and jump to it. The handler table is | 913 // Compute the handler entry address and jump to it. The handler table is |
| 914 // a fixed array of (smi-tagged) code offsets. | 914 // a fixed array of (smi-tagged) code offsets. |
| 915 // eax = exception, edi = code object, edx = state. | 915 // eax = exception, edi = code object, edx = state. |
| 916 mov(ebx, FieldOperand(edi, Code::kHandlerTableOffset)); | 916 mov(ebx, FieldOperand(edi, Code::kHandlerTableOffset)); |
| 917 shr(edx, StackHandler::kKindWidth); | 917 shr(edx, StackHandler::kKindWidth); |
| 918 mov(edx, FieldOperand(ebx, edx, times_4, FixedArray::kHeaderSize)); | 918 mov(edx, FieldOperand(ebx, edx, times_4, FixedArray::kHeaderSize)); |
| 919 SmiUntag(edx); | 919 SmiUntag(edx); |
| 920 lea(edi, FieldOperand(edi, edx, times_1, Code::kHeaderSize)); | 920 // Preserve code object in edi for the optimizer handler. |
| 921 jmp(edi); | 921 lea(edx, FieldOperand(edi, edx, times_1, Code::kHeaderSize)); |
| 922 jmp(edx); |
| 922 } | 923 } |
| 923 | 924 |
| 924 | 925 |
| 925 void MacroAssembler::Throw(Register value) { | 926 void MacroAssembler::Throw(Register value) { |
| 926 // Adjust this code if not the case. | 927 // Adjust this code if not the case. |
| 927 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); | 928 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); |
| 928 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 929 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
| 929 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); | 930 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); |
| 930 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); | 931 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); |
| 931 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); | 932 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); |
| 932 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); | 933 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); |
| 933 | 934 |
| 934 // The exception is expected in eax. | 935 // The exception is expected in eax. |
| 935 if (!value.is(eax)) { | 936 if (!value.is(eax)) { |
| 936 mov(eax, value); | 937 mov(eax, value); |
| 937 } | 938 } |
| 938 // Drop the stack pointer to the top of the top handler. | 939 |
| 940 // Get the handler address. |
| 939 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); | 941 ExternalReference handler_address(Isolate::kHandlerAddress, isolate()); |
| 940 mov(esp, Operand::StaticVariable(handler_address)); | 942 mov(ecx, Operand::StaticVariable(handler_address)); |
| 941 // Restore the next handler. | 943 |
| 944 // Drop the stack pointer to the top of the top handler and restore the |
| 945 // next handler. |
| 946 mov(esp, ecx); |
| 942 pop(Operand::StaticVariable(handler_address)); | 947 pop(Operand::StaticVariable(handler_address)); |
| 943 | 948 |
| 944 // Remove the code object and state, compute the handler address in edi. | 949 // Remove the code object and state, compute the handler address in edi. |
| 945 pop(edi); // Code object. | 950 pop(edi); // Code object. |
| 946 pop(edx); // Index and state. | 951 pop(edx); // Index and state. |
| 947 | 952 |
| 948 // Restore the context and frame pointer. | 953 // Restore the context and frame pointer. |
| 949 pop(esi); // Context. | 954 pop(esi); // Context. |
| 950 pop(ebp); // Frame pointer. | 955 pop(ebp); // Frame pointer. |
| 951 | 956 |
| (...skipping 2216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3168 j(greater, &no_info_available); | 3173 j(greater, &no_info_available); |
| 3169 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), | 3174 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), |
| 3170 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); | 3175 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); |
| 3171 bind(&no_info_available); | 3176 bind(&no_info_available); |
| 3172 } | 3177 } |
| 3173 | 3178 |
| 3174 | 3179 |
| 3175 } } // namespace v8::internal | 3180 } } // namespace v8::internal |
| 3176 | 3181 |
| 3177 #endif // V8_TARGET_ARCH_IA32 | 3182 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |