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

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

Issue 1406113007: Merge GlobalObject with JSGlobalObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/heap/heap.cc ('k') | src/ia32/macro-assembler-ia32.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 // 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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
896 __ mov(edi, FieldOperand(edi, GlobalObject::kNativeContextOffset)); 896 __ mov(edi, FieldOperand(edi, JSGlobalObject::kNativeContextOffset));
897 __ mov(ebx, Operand(esp, 0 * kPointerSize)); 897 __ mov(ebx, Operand(esp, 0 * kPointerSize));
898 __ test(ebx, ebx); 898 __ test(ebx, ebx);
899 __ j(not_zero, &has_mapped_parameters, Label::kNear); 899 __ j(not_zero, &has_mapped_parameters, Label::kNear);
900 __ mov( 900 __ mov(
901 edi, 901 edi,
902 Operand(edi, Context::SlotOffset(Context::SLOPPY_ARGUMENTS_MAP_INDEX))); 902 Operand(edi, Context::SlotOffset(Context::SLOPPY_ARGUMENTS_MAP_INDEX)));
903 __ jmp(&instantiate, Label::kNear); 903 __ jmp(&instantiate, Label::kNear);
904 904
905 __ bind(&has_mapped_parameters); 905 __ bind(&has_mapped_parameters);
906 __ mov(edi, Operand(edi, Context::SlotOffset( 906 __ mov(edi, Operand(edi, Context::SlotOffset(
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 __ j(zero, &add_arguments_object, Label::kNear); 1090 __ j(zero, &add_arguments_object, Label::kNear);
1091 __ lea(eax, Operand(eax, times_2, FixedArray::kHeaderSize)); 1091 __ lea(eax, Operand(eax, times_2, FixedArray::kHeaderSize));
1092 __ bind(&add_arguments_object); 1092 __ bind(&add_arguments_object);
1093 __ add(eax, Immediate(Heap::kStrictArgumentsObjectSize)); 1093 __ add(eax, Immediate(Heap::kStrictArgumentsObjectSize));
1094 1094
1095 // Do the allocation of both objects in one go. 1095 // Do the allocation of both objects in one go.
1096 __ Allocate(eax, eax, ebx, no_reg, &runtime, TAG_OBJECT); 1096 __ Allocate(eax, eax, ebx, no_reg, &runtime, TAG_OBJECT);
1097 1097
1098 // Get the arguments map from the current native context. 1098 // Get the arguments map from the current native context.
1099 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 1099 __ mov(edi, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
1100 __ mov(edi, FieldOperand(edi, GlobalObject::kNativeContextOffset)); 1100 __ mov(edi, FieldOperand(edi, JSGlobalObject::kNativeContextOffset));
1101 const int offset = Context::SlotOffset(Context::STRICT_ARGUMENTS_MAP_INDEX); 1101 const int offset = Context::SlotOffset(Context::STRICT_ARGUMENTS_MAP_INDEX);
1102 __ mov(edi, Operand(edi, offset)); 1102 __ mov(edi, Operand(edi, offset));
1103 1103
1104 __ mov(FieldOperand(eax, JSObject::kMapOffset), edi); 1104 __ mov(FieldOperand(eax, JSObject::kMapOffset), edi);
1105 __ mov(FieldOperand(eax, JSObject::kPropertiesOffset), 1105 __ mov(FieldOperand(eax, JSObject::kPropertiesOffset),
1106 masm->isolate()->factory()->empty_fixed_array()); 1106 masm->isolate()->factory()->empty_fixed_array());
1107 __ mov(FieldOperand(eax, JSObject::kElementsOffset), 1107 __ mov(FieldOperand(eax, JSObject::kElementsOffset),
1108 masm->isolate()->factory()->empty_fixed_array()); 1108 masm->isolate()->factory()->empty_fixed_array());
1109 1109
1110 // Get the length (smi tagged) and set that as an in-object property too. 1110 // Get the length (smi tagged) and set that as an in-object property too.
(...skipping 4757 matching lines...) Expand 10 before | Expand all | Expand 10 after
5868 Operand(ebp, 7 * kPointerSize), NULL); 5868 Operand(ebp, 7 * kPointerSize), NULL);
5869 } 5869 }
5870 5870
5871 5871
5872 #undef __ 5872 #undef __
5873 5873
5874 } // namespace internal 5874 } // namespace internal
5875 } // namespace v8 5875 } // namespace v8
5876 5876
5877 #endif // V8_TARGET_ARCH_IA32 5877 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698