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

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

Issue 111613003: Load the global proxy from the context of the target function. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Also fix bug on ARM. Created 6 years, 11 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 | « no previous file | src/arm/code-stubs-arm.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 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
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 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 } 1085 }
1085 1086
1086 // Restore the function to r1, and the flag to r4. 1087 // Restore the function to r1, and the flag to r4.
1087 __ ldr(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); 1088 __ ldr(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2));
1088 __ mov(r4, Operand::Zero()); 1089 __ mov(r4, Operand::Zero());
1089 __ jmp(&patch_receiver); 1090 __ jmp(&patch_receiver);
1090 1091
1091 // Use the global receiver object from the called function as the 1092 // Use the global receiver object from the called function as the
1092 // receiver. 1093 // receiver.
1093 __ bind(&use_global_receiver); 1094 __ bind(&use_global_receiver);
1094 const int kGlobalIndex = 1095 __ ldr(r2, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
1095 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize; 1096 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset));
1096 __ ldr(r2, FieldMemOperand(cp, kGlobalIndex));
1097 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kNativeContextOffset));
1098 __ ldr(r2, FieldMemOperand(r2, kGlobalIndex));
1099 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset));
1100 1097
1101 __ bind(&patch_receiver); 1098 __ bind(&patch_receiver);
1102 __ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2)); 1099 __ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2));
1103 __ str(r2, MemOperand(r3, -kPointerSize)); 1100 __ str(r2, MemOperand(r3, -kPointerSize));
1104 1101
1105 __ jmp(&shift_arguments); 1102 __ jmp(&shift_arguments);
1106 } 1103 }
1107 1104
1108 // 3b. Check for function proxy. 1105 // 3b. Check for function proxy.
1109 __ bind(&slow); 1106 __ bind(&slow);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 1277
1281 // Convert the receiver to a regular object. 1278 // Convert the receiver to a regular object.
1282 // r0: receiver 1279 // r0: receiver
1283 __ bind(&call_to_object); 1280 __ bind(&call_to_object);
1284 __ push(r0); 1281 __ push(r0);
1285 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 1282 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
1286 __ b(&push_receiver); 1283 __ b(&push_receiver);
1287 1284
1288 // Use the current global receiver object as the receiver. 1285 // Use the current global receiver object as the receiver.
1289 __ bind(&use_global_receiver); 1286 __ bind(&use_global_receiver);
1290 const int kGlobalOffset = 1287 __ ldr(r0, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
1291 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize;
1292 __ ldr(r0, FieldMemOperand(cp, kGlobalOffset));
1293 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kNativeContextOffset));
1294 __ ldr(r0, FieldMemOperand(r0, kGlobalOffset));
1295 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset)); 1288 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset));
1296 1289
1297 // Push the receiver. 1290 // Push the receiver.
1298 // r0: receiver 1291 // r0: receiver
1299 __ bind(&push_receiver); 1292 __ bind(&push_receiver);
1300 __ push(r0); 1293 __ push(r0);
1301 1294
1302 // Copy all arguments from the array to the stack. 1295 // Copy all arguments from the array to the stack.
1303 Label entry, loop; 1296 Label entry, loop;
1304 __ ldr(r0, MemOperand(fp, kIndexOffset)); 1297 __ ldr(r0, MemOperand(fp, kIndexOffset));
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1492 __ bind(&dont_adapt_arguments); 1485 __ bind(&dont_adapt_arguments);
1493 __ Jump(r3); 1486 __ Jump(r3);
1494 } 1487 }
1495 1488
1496 1489
1497 #undef __ 1490 #undef __
1498 1491
1499 } } // namespace v8::internal 1492 } } // namespace v8::internal
1500 1493
1501 #endif // V8_TARGET_ARCH_ARM 1494 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698