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

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

Issue 14761004: MIPS: Becuase of cross-context calls, hydrogen-based Array constructor needs to ensure the array co… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « no previous file | no next file » | 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate); 132 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate);
133 } 133 }
134 134
135 135
136 static void InitializeArrayConstructorDescriptor( 136 static void InitializeArrayConstructorDescriptor(
137 Isolate* isolate, 137 Isolate* isolate,
138 CodeStubInterfaceDescriptor* descriptor, 138 CodeStubInterfaceDescriptor* descriptor,
139 int constant_stack_parameter_count) { 139 int constant_stack_parameter_count) {
140 // register state 140 // register state
141 // a0 -- number of arguments 141 // a0 -- number of arguments
142 // a1 -- function
142 // a2 -- type info cell with elements kind 143 // a2 -- type info cell with elements kind
143 static Register registers[] = { a2 }; 144 static Register registers[] = { a1, a2 };
144 descriptor->register_param_count_ = 1; 145 descriptor->register_param_count_ = 2;
145 if (constant_stack_parameter_count != 0) { 146 if (constant_stack_parameter_count != 0) {
146 // stack param count needs (constructor pointer, and single argument) 147 // stack param count needs (constructor pointer, and single argument)
147 descriptor->stack_parameter_count_ = &a0; 148 descriptor->stack_parameter_count_ = &a0;
148 } 149 }
149 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 150 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
150 descriptor->register_params_ = registers; 151 descriptor->register_params_ = registers;
151 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 152 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
152 descriptor->deoptimization_handler_ = 153 descriptor->deoptimization_handler_ =
153 FUNCTION_ADDR(ArrayConstructor_StubFailure); 154 FUNCTION_ADDR(ArrayConstructor_StubFailure);
154 } 155 }
(...skipping 7590 matching lines...) Expand 10 before | Expand all | Expand 10 after
7745 __ lw(a3, FieldMemOperand(a2, 0)); 7746 __ lw(a3, FieldMemOperand(a2, 0));
7746 __ Assert(eq, "Expected property cell in register ebx", 7747 __ Assert(eq, "Expected property cell in register ebx",
7747 a3, Operand(global_property_cell_map)); 7748 a3, Operand(global_property_cell_map));
7748 __ bind(&okay_here); 7749 __ bind(&okay_here);
7749 } 7750 }
7750 7751
7751 if (FLAG_optimize_constructed_arrays) { 7752 if (FLAG_optimize_constructed_arrays) {
7752 Label no_info, switch_ready; 7753 Label no_info, switch_ready;
7753 // Get the elements kind and case on that. 7754 // Get the elements kind and case on that.
7754 __ Branch(&no_info, eq, a2, Operand(undefined_sentinel)); 7755 __ Branch(&no_info, eq, a2, Operand(undefined_sentinel));
7755 __ lw(a3, FieldMemOperand(a2, kPointerSize)); 7756 __ lw(a3, FieldMemOperand(a2, JSGlobalPropertyCell::kValueOffset));
7756 7757 __ JumpIfNotSmi(a3, &no_info);
7757 // There is no info if the call site went megamorphic either
7758 // TODO(mvstanton): Really? I thought if it was the array function that
7759 // the cell wouldn't get stamped as megamorphic.
7760 __ Branch(&no_info, eq, a3,
7761 Operand(TypeFeedbackCells::MegamorphicSentinel(masm->isolate())));
7762 __ SmiUntag(a3); 7758 __ SmiUntag(a3);
7763 __ jmp(&switch_ready); 7759 __ jmp(&switch_ready);
7764 __ bind(&no_info); 7760 __ bind(&no_info);
7765 __ li(a3, Operand(GetInitialFastElementsKind())); 7761 __ li(a3, Operand(GetInitialFastElementsKind()));
7766 __ bind(&switch_ready); 7762 __ bind(&switch_ready);
7767 7763
7768 if (argument_count_ == ANY) { 7764 if (argument_count_ == ANY) {
7769 Label not_zero_case, not_one_case; 7765 Label not_zero_case, not_one_case;
7770 __ And(at, a0, a0); 7766 __ And(at, a0, a0);
7771 __ Branch(&not_zero_case, ne, at, Operand(zero_reg)); 7767 __ Branch(&not_zero_case, ne, at, Operand(zero_reg));
(...skipping 27 matching lines...) Expand all
7799 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); 7795 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET);
7800 } 7796 }
7801 } 7797 }
7802 7798
7803 7799
7804 #undef __ 7800 #undef __
7805 7801
7806 } } // namespace v8::internal 7802 } } // namespace v8::internal
7807 7803
7808 #endif // V8_TARGET_ARCH_MIPS 7804 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698