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

Side by Side Diff: runtime/vm/stub_code_ia32.cc

Issue 12315087: Hook up simulator (if needed) when calling Dart code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 | « runtime/vm/stub_code_arm_test.cc ('k') | runtime/vm/stub_code_ia32_test.cc » ('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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/assembler_macros.h" 9 #include "vm/assembler_macros.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 // returning here. 672 // returning here.
673 // If no call method exists, throw a NoSuchMethodError. 673 // If no call method exists, throw a NoSuchMethodError.
674 // EDI: non-closure object. 674 // EDI: non-closure object.
675 // EDX: arguments descriptor array. 675 // EDX: arguments descriptor array.
676 676
677 // Create a stub frame as we are pushing some objects on the stack before 677 // Create a stub frame as we are pushing some objects on the stack before
678 // calling into the runtime. 678 // calling into the runtime.
679 AssemblerMacros::EnterStubFrame(assembler); 679 AssemblerMacros::EnterStubFrame(assembler);
680 680
681 __ pushl(raw_null); // Setup space on stack for result from error reporting. 681 __ pushl(raw_null); // Setup space on stack for result from error reporting.
682 __ pushl(EDI); // Non-closure object.
683 __ pushl(EDX); // Arguments descriptor. 682 __ pushl(EDX); // Arguments descriptor.
684 // Load smi-tagged arguments array length, including the non-closure. 683 // Load smi-tagged arguments array length, including the non-closure.
685 __ movl(EDX, FieldAddress(EDX, ArgumentsDescriptor::count_offset())); 684 __ movl(EDX, FieldAddress(EDX, ArgumentsDescriptor::count_offset()));
686 // See stack layout below explaining "wordSize * 6" offset. 685 // See stack layout below explaining "wordSize * 5" offset.
687 PushArgumentsArray(assembler, (kWordSize * 6)); 686 PushArgumentsArray(assembler, (kWordSize * 5));
688 687
689 // Stack: 688 // Stack:
690 // TOS + 0: Argument array. 689 // TOS + 0: Argument array.
691 // TOS + 1: Arguments descriptor array. 690 // TOS + 1: Arguments descriptor array.
692 // TOS + 2: Non-closure object. 691 // TOS + 2: Place for result from the call.
693 // TOS + 3: Place for result from the call. 692 // TOS + 3: PC marker => RawInstruction object.
694 // TOS + 4: PC marker => RawInstruction object. 693 // TOS + 4: Saved EBP of previous frame. <== EBP
695 // TOS + 5: Saved EBP of previous frame. <== EBP 694 // TOS + 5: Dart code return address
696 // TOS + 6: Dart code return address 695 // TOS + 6: Last argument of caller.
697 // TOS + 7: Last argument of caller.
698 // .... 696 // ....
699 __ CallRuntime(kInvokeNonClosureRuntimeEntry); 697 __ CallRuntime(kInvokeNonClosureRuntimeEntry);
700 // Remove arguments. 698 // Remove arguments.
701 __ popl(EAX); 699 __ popl(EAX);
702 __ popl(EAX); 700 __ popl(EAX);
703 __ popl(EAX);
704 __ popl(EAX); // Get result into EAX. 701 __ popl(EAX); // Get result into EAX.
705 702
706 // Remove the stub frame as we are about to return. 703 // Remove the stub frame as we are about to return.
707 __ LeaveFrame(); 704 __ LeaveFrame();
708 __ ret(); 705 __ ret();
709 } 706 }
710 707
711 708
712 // Called when invoking dart code from C++ (VM code). 709 // Called when invoking dart code from C++ (VM code).
713 // Input parameters: 710 // Input parameters:
(...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after
2124 __ Bind(&done); 2121 __ Bind(&done);
2125 __ popl(temp); 2122 __ popl(temp);
2126 __ popl(right); 2123 __ popl(right);
2127 __ popl(left); 2124 __ popl(left);
2128 __ ret(); 2125 __ ret();
2129 } 2126 }
2130 2127
2131 } // namespace dart 2128 } // namespace dart
2132 2129
2133 #endif // defined TARGET_ARCH_IA32 2130 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm_test.cc ('k') | runtime/vm/stub_code_ia32_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698