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

Side by Side Diff: src/ia32/builtins-ia32.cc

Issue 10807024: Optimize functions on a second thread. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 ASSERT(extra_args == NO_EXTRA_ARGUMENTS); 67 ASSERT(extra_args == NO_EXTRA_ARGUMENTS);
68 } 68 }
69 69
70 // JumpToExternalReference expects eax to contain the number of arguments 70 // JumpToExternalReference expects eax to contain the number of arguments
71 // including the receiver and the extra arguments. 71 // including the receiver and the extra arguments.
72 __ add(eax, Immediate(num_extra_args + 1)); 72 __ add(eax, Immediate(num_extra_args + 1));
73 __ JumpToExternalReference(ExternalReference(id, masm->isolate())); 73 __ JumpToExternalReference(ExternalReference(id, masm->isolate()));
74 } 74 }
75 75
76 76
77 static void GenerateTailCallToSharedCode(MacroAssembler* masm) {
78 __ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
79 __ mov(eax, FieldOperand(eax, SharedFunctionInfo::kCodeOffset));
80 __ add(eax, Immediate(Code::kHeaderSize - kHeapObjectTag));
Yang 2012/07/19 12:47:30 Use the lea instruction and FieldOperand would be
sanjoy 2012/07/19 15:06:09 Done.
81 __ jmp(eax);
82 }
83
84
85 void Builtins::Generate_InRecompileQueue(MacroAssembler* masm) {
86 GenerateTailCallToSharedCode(masm);
87 }
88
89
90 void Builtins::Generate_ParallelRecompile(MacroAssembler* masm) {
91 {
92 FrameScope scope(masm, StackFrame::INTERNAL);
93
94 // Push a copy of the function onto the stack.
95 __ push(edi);
96 // Push call kind information.
97 __ push(ecx);
98
99 __ push(edi); // Function is also the parameter to the runtime call.
100 __ CallRuntime(Runtime::kParallelRecompile, 1);
101
102 // Restore call kind information.
103 __ pop(ecx);
104 // Restore receiver.
105 __ pop(edi);
106
107 // Tear down internal frame.
108 }
109
110 GenerateTailCallToSharedCode(masm);
111 }
112
113
77 static void Generate_JSConstructStubHelper(MacroAssembler* masm, 114 static void Generate_JSConstructStubHelper(MacroAssembler* masm,
78 bool is_api_function, 115 bool is_api_function,
79 bool count_constructions) { 116 bool count_constructions) {
80 // ----------- S t a t e ------------- 117 // ----------- S t a t e -------------
81 // -- eax: number of arguments 118 // -- eax: number of arguments
82 // -- edi: constructor function 119 // -- edi: constructor function
83 // ----------------------------------- 120 // -----------------------------------
84 121
85 // Should never count constructions for api objects. 122 // Should never count constructions for api objects.
86 ASSERT(!is_api_function || !count_constructions); 123 ASSERT(!is_api_function || !count_constructions);
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); 1767 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR);
1731 generator.Generate(); 1768 generator.Generate();
1732 } 1769 }
1733 1770
1734 1771
1735 #undef __ 1772 #undef __
1736 } 1773 }
1737 } // namespace v8::internal 1774 } // namespace v8::internal
1738 1775
1739 #endif // V8_TARGET_ARCH_IA32 1776 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698