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

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

Issue 10832365: Rename Context::global to Context::global_object, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Michael's comments. Created 8 years, 4 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 | « src/api.cc ('k') | 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 __ add(r0, r0, Operand(num_extra_args + 1)); 70 __ add(r0, r0, Operand(num_extra_args + 1));
71 __ JumpToExternalReference(ExternalReference(id, masm->isolate())); 71 __ JumpToExternalReference(ExternalReference(id, masm->isolate()));
72 } 72 }
73 73
74 74
75 // Load the built-in InternalArray function from the current context. 75 // Load the built-in InternalArray function from the current context.
76 static void GenerateLoadInternalArrayFunction(MacroAssembler* masm, 76 static void GenerateLoadInternalArrayFunction(MacroAssembler* masm,
77 Register result) { 77 Register result) {
78 // Load the native context. 78 // Load the native context.
79 79
80 __ ldr(result, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 80 __ ldr(result,
81 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
81 __ ldr(result, 82 __ ldr(result,
82 FieldMemOperand(result, GlobalObject::kNativeContextOffset)); 83 FieldMemOperand(result, GlobalObject::kNativeContextOffset));
83 // Load the InternalArray function from the native context. 84 // Load the InternalArray function from the native context.
84 __ ldr(result, 85 __ ldr(result,
85 MemOperand(result, 86 MemOperand(result,
86 Context::SlotOffset( 87 Context::SlotOffset(
87 Context::INTERNAL_ARRAY_FUNCTION_INDEX))); 88 Context::INTERNAL_ARRAY_FUNCTION_INDEX)));
88 } 89 }
89 90
90 91
91 // Load the built-in Array function from the current context. 92 // Load the built-in Array function from the current context.
92 static void GenerateLoadArrayFunction(MacroAssembler* masm, Register result) { 93 static void GenerateLoadArrayFunction(MacroAssembler* masm, Register result) {
93 // Load the native context. 94 // Load the native context.
94 95
95 __ ldr(result, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 96 __ ldr(result,
97 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
96 __ ldr(result, 98 __ ldr(result,
97 FieldMemOperand(result, GlobalObject::kNativeContextOffset)); 99 FieldMemOperand(result, GlobalObject::kNativeContextOffset));
98 // Load the Array function from the native context. 100 // Load the Array function from the native context.
99 __ ldr(result, 101 __ ldr(result,
100 MemOperand(result, 102 MemOperand(result,
101 Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX))); 103 Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX)));
102 } 104 }
103 105
104 106
105 // Allocate an empty JSArray. The allocated array is put into the result 107 // Allocate an empty JSArray. The allocated array is put into the result
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 1398
1397 // Restore the function to r1, and the flag to r4. 1399 // Restore the function to r1, and the flag to r4.
1398 __ ldr(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); 1400 __ ldr(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2));
1399 __ mov(r4, Operand(0, RelocInfo::NONE)); 1401 __ mov(r4, Operand(0, RelocInfo::NONE));
1400 __ jmp(&patch_receiver); 1402 __ jmp(&patch_receiver);
1401 1403
1402 // Use the global receiver object from the called function as the 1404 // Use the global receiver object from the called function as the
1403 // receiver. 1405 // receiver.
1404 __ bind(&use_global_receiver); 1406 __ bind(&use_global_receiver);
1405 const int kGlobalIndex = 1407 const int kGlobalIndex =
1406 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; 1408 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize;
1407 __ ldr(r2, FieldMemOperand(cp, kGlobalIndex)); 1409 __ ldr(r2, FieldMemOperand(cp, kGlobalIndex));
1408 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kNativeContextOffset)); 1410 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kNativeContextOffset));
1409 __ ldr(r2, FieldMemOperand(r2, kGlobalIndex)); 1411 __ ldr(r2, FieldMemOperand(r2, kGlobalIndex));
1410 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset)); 1412 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset));
1411 1413
1412 __ bind(&patch_receiver); 1414 __ bind(&patch_receiver);
1413 __ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2)); 1415 __ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2));
1414 __ str(r2, MemOperand(r3, -kPointerSize)); 1416 __ str(r2, MemOperand(r3, -kPointerSize));
1415 1417
1416 __ jmp(&shift_arguments); 1418 __ jmp(&shift_arguments);
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1591 // Convert the receiver to a regular object. 1593 // Convert the receiver to a regular object.
1592 // r0: receiver 1594 // r0: receiver
1593 __ bind(&call_to_object); 1595 __ bind(&call_to_object);
1594 __ push(r0); 1596 __ push(r0);
1595 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 1597 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
1596 __ b(&push_receiver); 1598 __ b(&push_receiver);
1597 1599
1598 // Use the current global receiver object as the receiver. 1600 // Use the current global receiver object as the receiver.
1599 __ bind(&use_global_receiver); 1601 __ bind(&use_global_receiver);
1600 const int kGlobalOffset = 1602 const int kGlobalOffset =
1601 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; 1603 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize;
1602 __ ldr(r0, FieldMemOperand(cp, kGlobalOffset)); 1604 __ ldr(r0, FieldMemOperand(cp, kGlobalOffset));
1603 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kNativeContextOffset)); 1605 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kNativeContextOffset));
1604 __ ldr(r0, FieldMemOperand(r0, kGlobalOffset)); 1606 __ ldr(r0, FieldMemOperand(r0, kGlobalOffset));
1605 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset)); 1607 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset));
1606 1608
1607 // Push the receiver. 1609 // Push the receiver.
1608 // r0: receiver 1610 // r0: receiver
1609 __ bind(&push_receiver); 1611 __ bind(&push_receiver);
1610 __ push(r0); 1612 __ push(r0);
1611 1613
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1797 __ bind(&dont_adapt_arguments); 1799 __ bind(&dont_adapt_arguments);
1798 __ Jump(r3); 1800 __ Jump(r3);
1799 } 1801 }
1800 1802
1801 1803
1802 #undef __ 1804 #undef __
1803 1805
1804 } } // namespace v8::internal 1806 } } // namespace v8::internal
1805 1807
1806 #endif // V8_TARGET_ARCH_ARM 1808 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698