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

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

Issue 126043002: MIPS: Reland v8:18458 "Load the global proxy from the context of the target function." (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: 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
« no previous file with comments | « no previous file | src/mips/code-stubs-mips.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 18 matching lines...) Expand all
29 29
30 #include "v8.h" 30 #include "v8.h"
31 31
32 #if V8_TARGET_ARCH_MIPS 32 #if V8_TARGET_ARCH_MIPS
33 33
34 #include "codegen.h" 34 #include "codegen.h"
35 #include "debug.h" 35 #include "debug.h"
36 #include "deoptimizer.h" 36 #include "deoptimizer.h"
37 #include "full-codegen.h" 37 #include "full-codegen.h"
38 #include "runtime.h" 38 #include "runtime.h"
39 #include "stub-cache.h"
39 40
40 namespace v8 { 41 namespace v8 {
41 namespace internal { 42 namespace internal {
42 43
43 44
44 #define __ ACCESS_MASM(masm) 45 #define __ ACCESS_MASM(masm)
45 46
46 47
47 void Builtins::Generate_Adaptor(MacroAssembler* masm, 48 void Builtins::Generate_Adaptor(MacroAssembler* masm,
48 CFunctionId id, 49 CFunctionId id,
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 // Restore the function to a1, and the flag to t0. 1110 // Restore the function to a1, and the flag to t0.
1110 __ sll(at, a0, kPointerSizeLog2); 1111 __ sll(at, a0, kPointerSizeLog2);
1111 __ addu(at, sp, at); 1112 __ addu(at, sp, at);
1112 __ lw(a1, MemOperand(at)); 1113 __ lw(a1, MemOperand(at));
1113 __ li(t0, Operand(0, RelocInfo::NONE32)); 1114 __ li(t0, Operand(0, RelocInfo::NONE32));
1114 __ Branch(&patch_receiver); 1115 __ Branch(&patch_receiver);
1115 1116
1116 // Use the global receiver object from the called function as the 1117 // Use the global receiver object from the called function as the
1117 // receiver. 1118 // receiver.
1118 __ bind(&use_global_receiver); 1119 __ bind(&use_global_receiver);
1119 const int kGlobalIndex = 1120 __ lw(a2, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
1120 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize;
1121 __ lw(a2, FieldMemOperand(cp, kGlobalIndex));
1122 __ lw(a2, FieldMemOperand(a2, GlobalObject::kNativeContextOffset));
1123 __ lw(a2, FieldMemOperand(a2, kGlobalIndex));
1124 __ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalReceiverOffset)); 1121 __ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalReceiverOffset));
1125 1122
1126 __ bind(&patch_receiver); 1123 __ bind(&patch_receiver);
1127 __ sll(at, a0, kPointerSizeLog2); 1124 __ sll(at, a0, kPointerSizeLog2);
1128 __ addu(a3, sp, at); 1125 __ addu(a3, sp, at);
1129 __ sw(a2, MemOperand(a3, -kPointerSize)); 1126 __ sw(a2, MemOperand(a3, -kPointerSize));
1130 1127
1131 __ Branch(&shift_arguments); 1128 __ Branch(&shift_arguments);
1132 } 1129 }
1133 1130
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1303 // Convert the receiver to a regular object. 1300 // Convert the receiver to a regular object.
1304 // a0: receiver 1301 // a0: receiver
1305 __ bind(&call_to_object); 1302 __ bind(&call_to_object);
1306 __ push(a0); 1303 __ push(a0);
1307 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 1304 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
1308 __ mov(a0, v0); // Put object in a0 to match other paths to push_receiver. 1305 __ mov(a0, v0); // Put object in a0 to match other paths to push_receiver.
1309 __ Branch(&push_receiver); 1306 __ Branch(&push_receiver);
1310 1307
1311 // Use the current global receiver object as the receiver. 1308 // Use the current global receiver object as the receiver.
1312 __ bind(&use_global_receiver); 1309 __ bind(&use_global_receiver);
1313 const int kGlobalOffset = 1310 __ lw(a0, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
1314 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize;
1315 __ lw(a0, FieldMemOperand(cp, kGlobalOffset));
1316 __ lw(a0, FieldMemOperand(a0, GlobalObject::kNativeContextOffset));
1317 __ lw(a0, FieldMemOperand(a0, kGlobalOffset));
1318 __ lw(a0, FieldMemOperand(a0, GlobalObject::kGlobalReceiverOffset)); 1311 __ lw(a0, FieldMemOperand(a0, GlobalObject::kGlobalReceiverOffset));
1319 1312
1320 // Push the receiver. 1313 // Push the receiver.
1321 // a0: receiver 1314 // a0: receiver
1322 __ bind(&push_receiver); 1315 __ bind(&push_receiver);
1323 __ push(a0); 1316 __ push(a0);
1324 1317
1325 // Copy all arguments from the array to the stack. 1318 // Copy all arguments from the array to the stack.
1326 Label entry, loop; 1319 Label entry, loop;
1327 __ lw(a0, MemOperand(fp, kIndexOffset)); 1320 __ lw(a0, MemOperand(fp, kIndexOffset));
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 __ bind(&dont_adapt_arguments); 1518 __ bind(&dont_adapt_arguments);
1526 __ Jump(a3); 1519 __ Jump(a3);
1527 } 1520 }
1528 1521
1529 1522
1530 #undef __ 1523 #undef __
1531 1524
1532 } } // namespace v8::internal 1525 } } // namespace v8::internal
1533 1526
1534 #endif // V8_TARGET_ARCH_MIPS 1527 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698