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

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

Issue 14846017: Becuase of cross-context calls, hydrogen-based Array constructor needs to ensure (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Enable optimize_constructed_arrays Created 7 years, 7 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/hydrogen.cc ('k') | src/x64/code-stubs-x64.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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; 123 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry;
124 } 124 }
125 125
126 126
127 static void InitializeArrayConstructorDescriptor( 127 static void InitializeArrayConstructorDescriptor(
128 Isolate* isolate, 128 Isolate* isolate,
129 CodeStubInterfaceDescriptor* descriptor, 129 CodeStubInterfaceDescriptor* descriptor,
130 int constant_stack_parameter_count) { 130 int constant_stack_parameter_count) {
131 // register state 131 // register state
132 // eax -- number of arguments 132 // eax -- number of arguments
133 // edi -- function
133 // ebx -- type info cell with elements kind 134 // ebx -- type info cell with elements kind
134 static Register registers[] = { ebx }; 135 static Register registers[] = { edi, ebx };
135 descriptor->register_param_count_ = 1; 136 descriptor->register_param_count_ = 2;
136 137
137 if (constant_stack_parameter_count != 0) { 138 if (constant_stack_parameter_count != 0) {
138 // stack param count needs (constructor pointer, and single argument) 139 // stack param count needs (constructor pointer, and single argument)
139 descriptor->stack_parameter_count_ = &eax; 140 descriptor->stack_parameter_count_ = &eax;
140 } 141 }
141 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 142 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
142 descriptor->register_params_ = registers; 143 descriptor->register_params_ = registers;
143 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 144 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
144 descriptor->deoptimization_handler_ = 145 descriptor->deoptimization_handler_ =
145 FUNCTION_ADDR(ArrayConstructor_StubFailure); 146 FUNCTION_ADDR(ArrayConstructor_StubFailure);
(...skipping 7768 matching lines...) Expand 10 before | Expand all | Expand 10 after
7914 __ cmp(FieldOperand(ebx, 0), Immediate(global_property_cell_map)); 7915 __ cmp(FieldOperand(ebx, 0), Immediate(global_property_cell_map));
7915 __ Assert(equal, "Expected property cell in register ebx"); 7916 __ Assert(equal, "Expected property cell in register ebx");
7916 __ bind(&okay_here); 7917 __ bind(&okay_here);
7917 } 7918 }
7918 7919
7919 if (FLAG_optimize_constructed_arrays) { 7920 if (FLAG_optimize_constructed_arrays) {
7920 Label no_info, switch_ready; 7921 Label no_info, switch_ready;
7921 // Get the elements kind and case on that. 7922 // Get the elements kind and case on that.
7922 __ cmp(ebx, Immediate(undefined_sentinel)); 7923 __ cmp(ebx, Immediate(undefined_sentinel));
7923 __ j(equal, &no_info); 7924 __ j(equal, &no_info);
7924 __ mov(edx, FieldOperand(ebx, kPointerSize)); 7925 __ mov(edx, FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset));
7925 7926 __ JumpIfNotSmi(edx, &no_info);
7926 // There is no info if the call site went megamorphic either
7927
7928 // TODO(mvstanton): Really? I thought if it was the array function that
7929 // the cell wouldn't get stamped as megamorphic.
7930 __ cmp(edx, Immediate(TypeFeedbackCells::MegamorphicSentinel(
7931 masm->isolate())));
7932 __ j(equal, &no_info);
7933 __ SmiUntag(edx); 7927 __ SmiUntag(edx);
7934 __ jmp(&switch_ready); 7928 __ jmp(&switch_ready);
7935 __ bind(&no_info); 7929 __ bind(&no_info);
7936 __ mov(edx, Immediate(GetInitialFastElementsKind())); 7930 __ mov(edx, Immediate(GetInitialFastElementsKind()));
7937 __ bind(&switch_ready); 7931 __ bind(&switch_ready);
7938 7932
7939 if (argument_count_ == ANY) { 7933 if (argument_count_ == ANY) {
7940 Label not_zero_case, not_one_case; 7934 Label not_zero_case, not_one_case;
7941 __ test(eax, eax); 7935 __ test(eax, eax);
7942 __ j(not_zero, &not_zero_case); 7936 __ j(not_zero, &not_zero_case);
(...skipping 28 matching lines...) Expand all
7971 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); 7965 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET);
7972 } 7966 }
7973 } 7967 }
7974 7968
7975 7969
7976 #undef __ 7970 #undef __
7977 7971
7978 } } // namespace v8::internal 7972 } } // namespace v8::internal
7979 7973
7980 #endif // V8_TARGET_ARCH_IA32 7974 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698