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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 1010883002: Switch full-codegen from StackHandlers to handler table. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-isolate-dead-code
Patch Set: Minor cleanup. Created 5 years, 9 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 __ mov(Operand(esp, 2 * kPointerSize), 1209 __ mov(Operand(esp, 2 * kPointerSize),
1210 Immediate(ExternalReference::isolate_address(isolate))); 1210 Immediate(ExternalReference::isolate_address(isolate)));
1211 __ CallCFunction(find_handler, 3); 1211 __ CallCFunction(find_handler, 3);
1212 } 1212 }
1213 1213
1214 // Retrieve the handler context, SP and FP. 1214 // Retrieve the handler context, SP and FP.
1215 __ mov(esi, Operand::StaticVariable(pending_handler_context_address)); 1215 __ mov(esi, Operand::StaticVariable(pending_handler_context_address));
1216 __ mov(esp, Operand::StaticVariable(pending_handler_sp_address)); 1216 __ mov(esp, Operand::StaticVariable(pending_handler_sp_address));
1217 __ mov(ebp, Operand::StaticVariable(pending_handler_fp_address)); 1217 __ mov(ebp, Operand::StaticVariable(pending_handler_fp_address));
1218 1218
1219 // If the handler is a JS frame, restore the context to the frame. 1219 // If the handler is a JS frame, restore the context to the frame. Note that
1220 // (kind == ENTRY) == (ebp == 0) == (esi == 0), so we could test either 1220 // the context will be set to (esi == 0) for non-JS frames.
1221 // ebp or esi.
1222 Label skip; 1221 Label skip;
1223 __ test(esi, esi); 1222 __ test(esi, esi);
1224 __ j(zero, &skip, Label::kNear); 1223 __ j(zero, &skip, Label::kNear);
1225 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi); 1224 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi);
1226 __ bind(&skip); 1225 __ bind(&skip);
1227 1226
1228 // Compute the handler entry address and jump to it. 1227 // Compute the handler entry address and jump to it.
1229 __ mov(edi, Operand::StaticVariable(pending_handler_code_address)); 1228 __ mov(edi, Operand::StaticVariable(pending_handler_code_address));
1230 __ mov(edx, Operand::StaticVariable(pending_handler_offset_address)); 1229 __ mov(edx, Operand::StaticVariable(pending_handler_offset_address));
1231 __ lea(edi, FieldOperand(edi, edx, times_1, Code::kHeaderSize)); 1230 __ lea(edi, FieldOperand(edi, edx, times_1, Code::kHeaderSize));
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after
2618 __ bind(&handler_entry); 2617 __ bind(&handler_entry);
2619 handler_offset_ = handler_entry.pos(); 2618 handler_offset_ = handler_entry.pos();
2620 // Caught exception: Store result (exception) in the pending exception 2619 // Caught exception: Store result (exception) in the pending exception
2621 // field in the JSEnv and return a failure sentinel. 2620 // field in the JSEnv and return a failure sentinel.
2622 ExternalReference pending_exception(Isolate::kPendingExceptionAddress, 2621 ExternalReference pending_exception(Isolate::kPendingExceptionAddress,
2623 isolate()); 2622 isolate());
2624 __ mov(Operand::StaticVariable(pending_exception), eax); 2623 __ mov(Operand::StaticVariable(pending_exception), eax);
2625 __ mov(eax, Immediate(isolate()->factory()->exception())); 2624 __ mov(eax, Immediate(isolate()->factory()->exception()));
2626 __ jmp(&exit); 2625 __ jmp(&exit);
2627 2626
2628 // Invoke: Link this frame into the handler chain. There's only one 2627 // Invoke: Link this frame into the handler chain.
2629 // handler block in this code object, so its index is 0.
2630 __ bind(&invoke); 2628 __ bind(&invoke);
2631 __ PushTryHandler(StackHandler::JS_ENTRY, 0); 2629 __ PushStackHandler();
2632 2630
2633 // Clear any pending exceptions. 2631 // Clear any pending exceptions.
2634 __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); 2632 __ mov(edx, Immediate(isolate()->factory()->the_hole_value()));
2635 __ mov(Operand::StaticVariable(pending_exception), edx); 2633 __ mov(Operand::StaticVariable(pending_exception), edx);
2636 2634
2637 // Fake a receiver (NULL). 2635 // Fake a receiver (NULL).
2638 __ push(Immediate(0)); // receiver 2636 __ push(Immediate(0)); // receiver
2639 2637
2640 // Invoke the function by calling through JS entry trampoline builtin and 2638 // Invoke the function by calling through JS entry trampoline builtin and
2641 // pop the faked function when we return. Notice that we cannot store a 2639 // pop the faked function when we return. Notice that we cannot store a
2642 // reference to the trampoline code directly in this stub, because the 2640 // reference to the trampoline code directly in this stub, because the
2643 // builtin stubs may not have been generated yet. 2641 // builtin stubs may not have been generated yet.
2644 if (type() == StackFrame::ENTRY_CONSTRUCT) { 2642 if (type() == StackFrame::ENTRY_CONSTRUCT) {
2645 ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline, 2643 ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline,
2646 isolate()); 2644 isolate());
2647 __ mov(edx, Immediate(construct_entry)); 2645 __ mov(edx, Immediate(construct_entry));
2648 } else { 2646 } else {
2649 ExternalReference entry(Builtins::kJSEntryTrampoline, isolate()); 2647 ExternalReference entry(Builtins::kJSEntryTrampoline, isolate());
2650 __ mov(edx, Immediate(entry)); 2648 __ mov(edx, Immediate(entry));
2651 } 2649 }
2652 __ mov(edx, Operand(edx, 0)); // deref address 2650 __ mov(edx, Operand(edx, 0)); // deref address
2653 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); 2651 __ lea(edx, FieldOperand(edx, Code::kHeaderSize));
2654 __ call(edx); 2652 __ call(edx);
2655 2653
2656 // Unlink this frame from the handler chain. 2654 // Unlink this frame from the handler chain.
2657 __ PopTryHandler(); 2655 __ PopStackHandler();
2658 2656
2659 __ bind(&exit); 2657 __ bind(&exit);
2660 // Check if the current stack frame is marked as the outermost JS frame. 2658 // Check if the current stack frame is marked as the outermost JS frame.
2661 __ pop(ebx); 2659 __ pop(ebx);
2662 __ cmp(ebx, Immediate(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME))); 2660 __ cmp(ebx, Immediate(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME)));
2663 __ j(not_equal, &not_outermost_js_2); 2661 __ j(not_equal, &not_outermost_js_2);
2664 __ mov(Operand::StaticVariable(js_entry_sp), Immediate(0)); 2662 __ mov(Operand::StaticVariable(js_entry_sp), Immediate(0));
2665 __ bind(&not_outermost_js_2); 2663 __ bind(&not_outermost_js_2);
2666 2664
2667 // Restore the top frame descriptor from the stack. 2665 // Restore the top frame descriptor from the stack.
(...skipping 2516 matching lines...) Expand 10 before | Expand all | Expand 10 after
5184 ApiParameterOperand(2), kStackSpace, nullptr, 5182 ApiParameterOperand(2), kStackSpace, nullptr,
5185 Operand(ebp, 7 * kPointerSize), NULL); 5183 Operand(ebp, 7 * kPointerSize), NULL);
5186 } 5184 }
5187 5185
5188 5186
5189 #undef __ 5187 #undef __
5190 5188
5191 } } // namespace v8::internal 5189 } } // namespace v8::internal
5192 5190
5193 #endif // V8_TARGET_ARCH_IA32 5191 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698