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

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

Issue 545163002: Unify JSEntryStub and JSConstructEntryStub, and some more code stub cleanups. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/code-stubs-ia32.h ('k') | src/x64/code-stubs-x64.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 // 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 2380 matching lines...) Expand 10 before | Expand all | Expand 10 after
2391 __ j(equal, &throw_termination_exception); 2391 __ j(equal, &throw_termination_exception);
2392 2392
2393 // Handle normal exception. 2393 // Handle normal exception.
2394 __ Throw(eax); 2394 __ Throw(eax);
2395 2395
2396 __ bind(&throw_termination_exception); 2396 __ bind(&throw_termination_exception);
2397 __ ThrowUncatchable(eax); 2397 __ ThrowUncatchable(eax);
2398 } 2398 }
2399 2399
2400 2400
2401 void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) { 2401 void JSEntryStub::Generate(MacroAssembler* masm) {
2402 Label invoke, handler_entry, exit; 2402 Label invoke, handler_entry, exit;
2403 Label not_outermost_js, not_outermost_js_2; 2403 Label not_outermost_js, not_outermost_js_2;
2404 2404
2405 ProfileEntryHookStub::MaybeCallEntryHook(masm); 2405 ProfileEntryHookStub::MaybeCallEntryHook(masm);
2406 2406
2407 // Set up frame. 2407 // Set up frame.
2408 __ push(ebp); 2408 __ push(ebp);
2409 __ mov(ebp, esp); 2409 __ mov(ebp, esp);
2410 2410
2411 // Push marker in two places. 2411 // Push marker in two places.
2412 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; 2412 int marker = type();
2413 __ push(Immediate(Smi::FromInt(marker))); // context slot 2413 __ push(Immediate(Smi::FromInt(marker))); // context slot
2414 __ push(Immediate(Smi::FromInt(marker))); // function slot 2414 __ push(Immediate(Smi::FromInt(marker))); // function slot
2415 // Save callee-saved registers (C calling conventions). 2415 // Save callee-saved registers (C calling conventions).
2416 __ push(edi); 2416 __ push(edi);
2417 __ push(esi); 2417 __ push(esi);
2418 __ push(ebx); 2418 __ push(ebx);
2419 2419
2420 // Save copies of the top frame descriptor on the stack. 2420 // Save copies of the top frame descriptor on the stack.
2421 ExternalReference c_entry_fp(Isolate::kCEntryFPAddress, isolate()); 2421 ExternalReference c_entry_fp(Isolate::kCEntryFPAddress, isolate());
2422 __ push(Operand::StaticVariable(c_entry_fp)); 2422 __ push(Operand::StaticVariable(c_entry_fp));
(...skipping 30 matching lines...) Expand all
2453 __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); 2453 __ mov(edx, Immediate(isolate()->factory()->the_hole_value()));
2454 __ mov(Operand::StaticVariable(pending_exception), edx); 2454 __ mov(Operand::StaticVariable(pending_exception), edx);
2455 2455
2456 // Fake a receiver (NULL). 2456 // Fake a receiver (NULL).
2457 __ push(Immediate(0)); // receiver 2457 __ push(Immediate(0)); // receiver
2458 2458
2459 // Invoke the function by calling through JS entry trampoline builtin and 2459 // Invoke the function by calling through JS entry trampoline builtin and
2460 // pop the faked function when we return. Notice that we cannot store a 2460 // pop the faked function when we return. Notice that we cannot store a
2461 // reference to the trampoline code directly in this stub, because the 2461 // reference to the trampoline code directly in this stub, because the
2462 // builtin stubs may not have been generated yet. 2462 // builtin stubs may not have been generated yet.
2463 if (is_construct) { 2463 if (type() == StackFrame::ENTRY_CONSTRUCT) {
2464 ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline, 2464 ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline,
2465 isolate()); 2465 isolate());
2466 __ mov(edx, Immediate(construct_entry)); 2466 __ mov(edx, Immediate(construct_entry));
2467 } else { 2467 } else {
2468 ExternalReference entry(Builtins::kJSEntryTrampoline, isolate()); 2468 ExternalReference entry(Builtins::kJSEntryTrampoline, isolate());
2469 __ mov(edx, Immediate(entry)); 2469 __ mov(edx, Immediate(entry));
2470 } 2470 }
2471 __ mov(edx, Operand(edx, 0)); // deref address 2471 __ mov(edx, Operand(edx, 0)); // deref address
2472 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); 2472 __ lea(edx, FieldOperand(edx, Code::kHeaderSize));
2473 __ call(edx); 2473 __ call(edx);
(...skipping 2205 matching lines...) Expand 10 before | Expand all | Expand 10 after
4679 Operand(ebp, 7 * kPointerSize), 4679 Operand(ebp, 7 * kPointerSize),
4680 NULL); 4680 NULL);
4681 } 4681 }
4682 4682
4683 4683
4684 #undef __ 4684 #undef __
4685 4685
4686 } } // namespace v8::internal 4686 } } // namespace v8::internal
4687 4687
4688 #endif // V8_TARGET_ARCH_IA32 4688 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.h ('k') | src/x64/code-stubs-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698