OLD | NEW |
---|---|
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 16 matching lines...) Expand all Loading... | |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #if V8_TARGET_ARCH_ARM | 30 #if V8_TARGET_ARCH_ARM |
31 | 31 |
32 #include "codegen.h" | 32 #include "codegen.h" |
33 #include "debug.h" | 33 #include "debug.h" |
34 #include "deoptimizer.h" | 34 #include "deoptimizer.h" |
35 #include "full-codegen.h" | 35 #include "full-codegen.h" |
36 #include "runtime.h" | 36 #include "runtime.h" |
37 #include "stub-cache.h" | |
37 | 38 |
38 namespace v8 { | 39 namespace v8 { |
39 namespace internal { | 40 namespace internal { |
40 | 41 |
41 | 42 |
42 #define __ ACCESS_MASM(masm) | 43 #define __ ACCESS_MASM(masm) |
43 | 44 |
44 | 45 |
45 void Builtins::Generate_Adaptor(MacroAssembler* masm, | 46 void Builtins::Generate_Adaptor(MacroAssembler* masm, |
46 CFunctionId id, | 47 CFunctionId id, |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1067 } | 1068 } |
1068 | 1069 |
1069 // Restore the function to r1, and the flag to r4. | 1070 // Restore the function to r1, and the flag to r4. |
1070 __ ldr(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); | 1071 __ ldr(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); |
1071 __ mov(r4, Operand::Zero()); | 1072 __ mov(r4, Operand::Zero()); |
1072 __ jmp(&patch_receiver); | 1073 __ jmp(&patch_receiver); |
1073 | 1074 |
1074 // Use the global receiver object from the called function as the | 1075 // Use the global receiver object from the called function as the |
1075 // receiver. | 1076 // receiver. |
1076 __ bind(&use_global_receiver); | 1077 __ bind(&use_global_receiver); |
1077 const int kGlobalIndex = | 1078 __ ldr(r2, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
dcarney
2013/12/26 13:35:52
here and below we load from the correct context di
| |
1078 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize; | 1079 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset)); |
1079 __ ldr(r2, FieldMemOperand(cp, kGlobalIndex)); | |
1080 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kNativeContextOffset)); | |
1081 __ ldr(r2, FieldMemOperand(r2, kGlobalIndex)); | |
1082 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset)); | |
1083 | 1080 |
1084 __ bind(&patch_receiver); | 1081 __ bind(&patch_receiver); |
1085 __ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2)); | 1082 __ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2)); |
1086 __ str(r2, MemOperand(r3, -kPointerSize)); | 1083 __ str(r2, MemOperand(r3, -kPointerSize)); |
1087 | 1084 |
1088 __ jmp(&shift_arguments); | 1085 __ jmp(&shift_arguments); |
1089 } | 1086 } |
1090 | 1087 |
1091 // 3b. Check for function proxy. | 1088 // 3b. Check for function proxy. |
1092 __ bind(&slow); | 1089 __ bind(&slow); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1263 | 1260 |
1264 // Convert the receiver to a regular object. | 1261 // Convert the receiver to a regular object. |
1265 // r0: receiver | 1262 // r0: receiver |
1266 __ bind(&call_to_object); | 1263 __ bind(&call_to_object); |
1267 __ push(r0); | 1264 __ push(r0); |
1268 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); | 1265 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
1269 __ b(&push_receiver); | 1266 __ b(&push_receiver); |
1270 | 1267 |
1271 // Use the current global receiver object as the receiver. | 1268 // Use the current global receiver object as the receiver. |
1272 __ bind(&use_global_receiver); | 1269 __ bind(&use_global_receiver); |
1273 const int kGlobalOffset = | 1270 __ ldr(r0, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
1274 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize; | |
1275 __ ldr(r0, FieldMemOperand(cp, kGlobalOffset)); | |
1276 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kNativeContextOffset)); | |
1277 __ ldr(r0, FieldMemOperand(r0, kGlobalOffset)); | |
1278 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset)); | 1271 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset)); |
1279 | 1272 |
1280 // Push the receiver. | 1273 // Push the receiver. |
1281 // r0: receiver | 1274 // r0: receiver |
1282 __ bind(&push_receiver); | 1275 __ bind(&push_receiver); |
1283 __ push(r0); | 1276 __ push(r0); |
1284 | 1277 |
1285 // Copy all arguments from the array to the stack. | 1278 // Copy all arguments from the array to the stack. |
1286 Label entry, loop; | 1279 Label entry, loop; |
1287 __ ldr(r0, MemOperand(fp, kIndexOffset)); | 1280 __ ldr(r0, MemOperand(fp, kIndexOffset)); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1473 __ bind(&dont_adapt_arguments); | 1466 __ bind(&dont_adapt_arguments); |
1474 __ Jump(r3); | 1467 __ Jump(r3); |
1475 } | 1468 } |
1476 | 1469 |
1477 | 1470 |
1478 #undef __ | 1471 #undef __ |
1479 | 1472 |
1480 } } // namespace v8::internal | 1473 } } // namespace v8::internal |
1481 | 1474 |
1482 #endif // V8_TARGET_ARCH_ARM | 1475 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |