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

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

Issue 10832342: Rename "global context" to "native context", (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // JumpToExternalReference expects r0 to contain the number of arguments 68 // JumpToExternalReference expects r0 to contain the number of arguments
69 // including the receiver and the extra arguments. 69 // including the receiver and the extra arguments.
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 global context. 78 // Load the native context.
79 79
80 __ ldr(result, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 80 __ ldr(result, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
81 __ ldr(result, 81 __ ldr(result,
82 FieldMemOperand(result, GlobalObject::kGlobalContextOffset)); 82 FieldMemOperand(result, GlobalObject::kNativeContextOffset));
83 // Load the InternalArray function from the global context. 83 // Load the InternalArray function from the native context.
84 __ ldr(result, 84 __ ldr(result,
85 MemOperand(result, 85 MemOperand(result,
86 Context::SlotOffset( 86 Context::SlotOffset(
87 Context::INTERNAL_ARRAY_FUNCTION_INDEX))); 87 Context::INTERNAL_ARRAY_FUNCTION_INDEX)));
88 } 88 }
89 89
90 90
91 // Load the built-in Array function from the current context. 91 // Load the built-in Array function from the current context.
92 static void GenerateLoadArrayFunction(MacroAssembler* masm, Register result) { 92 static void GenerateLoadArrayFunction(MacroAssembler* masm, Register result) {
93 // Load the global context. 93 // Load the native context.
94 94
95 __ ldr(result, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 95 __ ldr(result, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
96 __ ldr(result, 96 __ ldr(result,
97 FieldMemOperand(result, GlobalObject::kGlobalContextOffset)); 97 FieldMemOperand(result, GlobalObject::kNativeContextOffset));
98 // Load the Array function from the global context. 98 // Load the Array function from the native context.
99 __ ldr(result, 99 __ ldr(result,
100 MemOperand(result, 100 MemOperand(result,
101 Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX))); 101 Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX)));
102 } 102 }
103 103
104 104
105 // Allocate an empty JSArray. The allocated array is put into the result 105 // Allocate an empty JSArray. The allocated array is put into the result
106 // register. An elements backing store is allocated with size initial_capacity 106 // register. An elements backing store is allocated with size initial_capacity
107 // and filled with the hole values. 107 // and filled with the hole values.
108 static void AllocateEmptyJSArray(MacroAssembler* masm, 108 static void AllocateEmptyJSArray(MacroAssembler* masm,
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 __ ldr(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); 1398 __ ldr(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2));
1399 __ mov(r4, Operand(0, RelocInfo::NONE)); 1399 __ mov(r4, Operand(0, RelocInfo::NONE));
1400 __ jmp(&patch_receiver); 1400 __ jmp(&patch_receiver);
1401 1401
1402 // Use the global receiver object from the called function as the 1402 // Use the global receiver object from the called function as the
1403 // receiver. 1403 // receiver.
1404 __ bind(&use_global_receiver); 1404 __ bind(&use_global_receiver);
1405 const int kGlobalIndex = 1405 const int kGlobalIndex =
1406 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; 1406 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
1407 __ ldr(r2, FieldMemOperand(cp, kGlobalIndex)); 1407 __ ldr(r2, FieldMemOperand(cp, kGlobalIndex));
1408 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalContextOffset)); 1408 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kNativeContextOffset));
1409 __ ldr(r2, FieldMemOperand(r2, kGlobalIndex)); 1409 __ ldr(r2, FieldMemOperand(r2, kGlobalIndex));
1410 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset)); 1410 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset));
1411 1411
1412 __ bind(&patch_receiver); 1412 __ bind(&patch_receiver);
1413 __ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2)); 1413 __ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2));
1414 __ str(r2, MemOperand(r3, -kPointerSize)); 1414 __ str(r2, MemOperand(r3, -kPointerSize));
1415 1415
1416 __ jmp(&shift_arguments); 1416 __ jmp(&shift_arguments);
1417 } 1417 }
1418 1418
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 __ bind(&call_to_object); 1593 __ bind(&call_to_object);
1594 __ push(r0); 1594 __ push(r0);
1595 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 1595 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION);
1596 __ b(&push_receiver); 1596 __ b(&push_receiver);
1597 1597
1598 // Use the current global receiver object as the receiver. 1598 // Use the current global receiver object as the receiver.
1599 __ bind(&use_global_receiver); 1599 __ bind(&use_global_receiver);
1600 const int kGlobalOffset = 1600 const int kGlobalOffset =
1601 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; 1601 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize;
1602 __ ldr(r0, FieldMemOperand(cp, kGlobalOffset)); 1602 __ ldr(r0, FieldMemOperand(cp, kGlobalOffset));
1603 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalContextOffset)); 1603 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kNativeContextOffset));
1604 __ ldr(r0, FieldMemOperand(r0, kGlobalOffset)); 1604 __ ldr(r0, FieldMemOperand(r0, kGlobalOffset));
1605 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset)); 1605 __ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset));
1606 1606
1607 // Push the receiver. 1607 // Push the receiver.
1608 // r0: receiver 1608 // r0: receiver
1609 __ bind(&push_receiver); 1609 __ bind(&push_receiver);
1610 __ push(r0); 1610 __ push(r0);
1611 1611
1612 // Copy all arguments from the array to the stack. 1612 // Copy all arguments from the array to the stack.
1613 Label entry, loop; 1613 Label entry, loop;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1797 __ bind(&dont_adapt_arguments); 1797 __ bind(&dont_adapt_arguments);
1798 __ Jump(r3); 1798 __ Jump(r3);
1799 } 1799 }
1800 1800
1801 1801
1802 #undef __ 1802 #undef __
1803 1803
1804 } } // namespace v8::internal 1804 } } // namespace v8::internal
1805 1805
1806 #endif // V8_TARGET_ARCH_ARM 1806 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/arm/code-stubs-arm.cc » ('j') | src/contexts.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698