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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 1480003002: [runtime] Replace global object link with native context link in all contexts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add patch from Orion for interpreter cementation test. Disable obsolete/invalid tests. Created 5 years 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 | « src/ia32/builtins-ia32.cc ('k') | src/ia32/macro-assembler-ia32.h » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 // Do the allocation of all three objects in one go. 885 // Do the allocation of all three objects in one go.
886 __ Allocate(ebx, eax, edi, no_reg, &runtime, TAG_OBJECT); 886 __ Allocate(ebx, eax, edi, no_reg, &runtime, TAG_OBJECT);
887 887
888 // eax = address of new object(s) (tagged) 888 // eax = address of new object(s) (tagged)
889 // ecx = argument count (smi-tagged) 889 // ecx = argument count (smi-tagged)
890 // esp[0] = mapped parameter count (tagged) 890 // esp[0] = mapped parameter count (tagged)
891 // esp[4] = function 891 // esp[4] = function
892 // esp[8] = parameter count (tagged) 892 // esp[8] = parameter count (tagged)
893 // Get the arguments map from the current native context into edi. 893 // Get the arguments map from the current native context into edi.
894 Label has_mapped_parameters, instantiate; 894 Label has_mapped_parameters, instantiate;
895 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 895 __ mov(edi, NativeContextOperand());
896 __ mov(edi, FieldOperand(edi, JSGlobalObject::kNativeContextOffset));
897 __ mov(ebx, Operand(esp, 0 * kPointerSize)); 896 __ mov(ebx, Operand(esp, 0 * kPointerSize));
898 __ test(ebx, ebx); 897 __ test(ebx, ebx);
899 __ j(not_zero, &has_mapped_parameters, Label::kNear); 898 __ j(not_zero, &has_mapped_parameters, Label::kNear);
900 __ mov( 899 __ mov(
901 edi, 900 edi,
902 Operand(edi, Context::SlotOffset(Context::SLOPPY_ARGUMENTS_MAP_INDEX))); 901 Operand(edi, Context::SlotOffset(Context::SLOPPY_ARGUMENTS_MAP_INDEX)));
903 __ jmp(&instantiate, Label::kNear); 902 __ jmp(&instantiate, Label::kNear);
904 903
905 __ bind(&has_mapped_parameters); 904 __ bind(&has_mapped_parameters);
906 __ mov(edi, Operand(edi, Context::SlotOffset( 905 __ mov(edi, Operand(edi, Context::SlotOffset(
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 __ test(eax, eax); 1088 __ test(eax, eax);
1090 __ j(zero, &add_arguments_object, Label::kNear); 1089 __ j(zero, &add_arguments_object, Label::kNear);
1091 __ lea(eax, Operand(eax, times_2, FixedArray::kHeaderSize)); 1090 __ lea(eax, Operand(eax, times_2, FixedArray::kHeaderSize));
1092 __ bind(&add_arguments_object); 1091 __ bind(&add_arguments_object);
1093 __ add(eax, Immediate(Heap::kStrictArgumentsObjectSize)); 1092 __ add(eax, Immediate(Heap::kStrictArgumentsObjectSize));
1094 1093
1095 // Do the allocation of both objects in one go. 1094 // Do the allocation of both objects in one go.
1096 __ Allocate(eax, eax, ebx, no_reg, &runtime, TAG_OBJECT); 1095 __ Allocate(eax, eax, ebx, no_reg, &runtime, TAG_OBJECT);
1097 1096
1098 // Get the arguments map from the current native context. 1097 // Get the arguments map from the current native context.
1099 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 1098 __ mov(edi, NativeContextOperand());
1100 __ mov(edi, FieldOperand(edi, JSGlobalObject::kNativeContextOffset)); 1099 __ mov(edi, ContextOperand(edi, Context::STRICT_ARGUMENTS_MAP_INDEX));
1101 const int offset = Context::SlotOffset(Context::STRICT_ARGUMENTS_MAP_INDEX);
1102 __ mov(edi, Operand(edi, offset));
1103 1100
1104 __ mov(FieldOperand(eax, JSObject::kMapOffset), edi); 1101 __ mov(FieldOperand(eax, JSObject::kMapOffset), edi);
1105 __ mov(FieldOperand(eax, JSObject::kPropertiesOffset), 1102 __ mov(FieldOperand(eax, JSObject::kPropertiesOffset),
1106 masm->isolate()->factory()->empty_fixed_array()); 1103 masm->isolate()->factory()->empty_fixed_array());
1107 __ mov(FieldOperand(eax, JSObject::kElementsOffset), 1104 __ mov(FieldOperand(eax, JSObject::kElementsOffset),
1108 masm->isolate()->factory()->empty_fixed_array()); 1105 masm->isolate()->factory()->empty_fixed_array());
1109 1106
1110 // Get the length (smi tagged) and set that as an in-object property too. 1107 // Get the length (smi tagged) and set that as an in-object property too.
1111 STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0); 1108 STATIC_ASSERT(Heap::kArgumentsLengthIndex == 0);
1112 __ AssertSmi(ecx); 1109 __ AssertSmi(ecx);
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
2181 // Goto miss case if we do not have a function. 2178 // Goto miss case if we do not have a function.
2182 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); 2179 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx);
2183 __ j(not_equal, &miss); 2180 __ j(not_equal, &miss);
2184 2181
2185 // Make sure the function is not the Array() function, which requires special 2182 // Make sure the function is not the Array() function, which requires special
2186 // behavior on MISS. 2183 // behavior on MISS.
2187 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); 2184 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx);
2188 __ cmp(edi, ecx); 2185 __ cmp(edi, ecx);
2189 __ j(equal, &miss); 2186 __ j(equal, &miss);
2190 2187
2191 // Make sure the function belongs to the same native context (which implies 2188 // Make sure the function belongs to the same native context.
2192 // the same global object).
2193 __ mov(ecx, FieldOperand(edi, JSFunction::kContextOffset)); 2189 __ mov(ecx, FieldOperand(edi, JSFunction::kContextOffset));
2194 __ mov(ecx, ContextOperand(ecx, Context::GLOBAL_OBJECT_INDEX)); 2190 __ mov(ecx, ContextOperand(ecx, Context::NATIVE_CONTEXT_INDEX));
2195 __ cmp(ecx, GlobalObjectOperand()); 2191 __ cmp(ecx, NativeContextOperand());
2196 __ j(not_equal, &miss); 2192 __ j(not_equal, &miss);
2197 2193
2198 // Update stats. 2194 // Update stats.
2199 __ add(FieldOperand(ebx, with_types_offset), Immediate(Smi::FromInt(1))); 2195 __ add(FieldOperand(ebx, with_types_offset), Immediate(Smi::FromInt(1)));
2200 2196
2201 // Initialize the call counter. 2197 // Initialize the call counter.
2202 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, 2198 __ mov(FieldOperand(ebx, edx, times_half_pointer_size,
2203 FixedArray::kHeaderSize + kPointerSize), 2199 FixedArray::kHeaderSize + kPointerSize),
2204 Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement))); 2200 Immediate(Smi::FromInt(CallICNexus::kCallCountIncrement)));
2205 2201
(...skipping 3436 matching lines...) Expand 10 before | Expand all | Expand 10 after
5642 Operand(ebp, 7 * kPointerSize), NULL); 5638 Operand(ebp, 7 * kPointerSize), NULL);
5643 } 5639 }
5644 5640
5645 5641
5646 #undef __ 5642 #undef __
5647 5643
5648 } // namespace internal 5644 } // namespace internal
5649 } // namespace v8 5645 } // namespace v8
5650 5646
5651 #endif // V8_TARGET_ARCH_IA32 5647 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698