OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "codegen-inl.h" | 30 #include "codegen-inl.h" |
31 #include "debug.h" | 31 #include "debug.h" |
32 #include "runtime.h" | 32 #include "runtime.h" |
33 | 33 |
34 namespace v8 { namespace internal { | 34 namespace v8 { namespace internal { |
35 | 35 |
36 | 36 |
37 #define __ masm-> | 37 #define __ DEFINE_MASM(masm) |
38 | 38 |
39 | 39 |
40 void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) { | 40 void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) { |
41 // TODO(1238487): Don't pass the function in a static variable. | 41 // TODO(1238487): Don't pass the function in a static variable. |
42 __ mov(ip, Operand(ExternalReference::builtin_passed_function())); | 42 __ mov(ip, Operand(ExternalReference::builtin_passed_function())); |
43 __ str(r1, MemOperand(ip, 0)); | 43 __ str(r1, MemOperand(ip, 0)); |
44 | 44 |
45 // The actual argument count has already been loaded into register | 45 // The actual argument count has already been loaded into register |
46 // r0, but JumpToBuiltin expects r0 to contain the number of | 46 // r0, but JumpToBuiltin expects r0 to contain the number of |
47 // arguments including the receiver. | 47 // arguments including the receiver. |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 __ bind(&entry); | 211 __ bind(&entry); |
212 __ cmp(r4, Operand(r2)); | 212 __ cmp(r4, Operand(r2)); |
213 __ b(ne, &loop); | 213 __ b(ne, &loop); |
214 | 214 |
215 // Initialize all JavaScript callee-saved registers, since they will be seen | 215 // Initialize all JavaScript callee-saved registers, since they will be seen |
216 // by the garbage collector as part of handlers. | 216 // by the garbage collector as part of handlers. |
217 __ mov(r4, Operand(Factory::undefined_value())); | 217 __ mov(r4, Operand(Factory::undefined_value())); |
218 __ mov(r5, Operand(r4)); | 218 __ mov(r5, Operand(r4)); |
219 __ mov(r6, Operand(r4)); | 219 __ mov(r6, Operand(r4)); |
220 __ mov(r7, Operand(r4)); | 220 __ mov(r7, Operand(r4)); |
221 if (kR9Available == 1) | 221 if (kR9Available == 1) { |
222 __ mov(r9, Operand(r4)); | 222 __ mov(r9, Operand(r4)); |
| 223 } |
223 | 224 |
224 // Invoke the code and pass argc as r0. | 225 // Invoke the code and pass argc as r0. |
225 __ mov(r0, Operand(r3)); | 226 __ mov(r0, Operand(r3)); |
226 if (is_construct) { | 227 if (is_construct) { |
227 __ Call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)), | 228 __ Call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)), |
228 RelocInfo::CODE_TARGET); | 229 RelocInfo::CODE_TARGET); |
229 } else { | 230 } else { |
230 ParameterCount actual(r0); | 231 ParameterCount actual(r0); |
231 __ InvokeFunction(r1, actual, CALL_FUNCTION); | 232 __ InvokeFunction(r1, actual, CALL_FUNCTION); |
232 } | 233 } |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 // Dont adapt arguments. | 650 // Dont adapt arguments. |
650 // ------------------------------------------- | 651 // ------------------------------------------- |
651 __ bind(&dont_adapt_arguments); | 652 __ bind(&dont_adapt_arguments); |
652 __ mov(pc, r3); | 653 __ mov(pc, r3); |
653 } | 654 } |
654 | 655 |
655 | 656 |
656 #undef __ | 657 #undef __ |
657 | 658 |
658 } } // namespace v8::internal | 659 } } // namespace v8::internal |
OLD | NEW |