OLD | NEW |
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate); | 131 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate); |
132 } | 132 } |
133 | 133 |
134 | 134 |
135 static void InitializeArrayConstructorDescriptor( | 135 static void InitializeArrayConstructorDescriptor( |
136 Isolate* isolate, | 136 Isolate* isolate, |
137 CodeStubInterfaceDescriptor* descriptor, | 137 CodeStubInterfaceDescriptor* descriptor, |
138 int constant_stack_parameter_count) { | 138 int constant_stack_parameter_count) { |
139 // register state | 139 // register state |
140 // r0 -- number of arguments | 140 // r0 -- number of arguments |
| 141 // r1 -- function |
141 // r2 -- type info cell with elements kind | 142 // r2 -- type info cell with elements kind |
142 static Register registers[] = { r2 }; | 143 static Register registers[] = { r1, r2 }; |
143 descriptor->register_param_count_ = 1; | 144 descriptor->register_param_count_ = 2; |
144 if (constant_stack_parameter_count != 0) { | 145 if (constant_stack_parameter_count != 0) { |
145 // stack param count needs (constructor pointer, and single argument) | 146 // stack param count needs (constructor pointer, and single argument) |
146 descriptor->stack_parameter_count_ = &r0; | 147 descriptor->stack_parameter_count_ = &r0; |
147 } | 148 } |
148 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 149 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
149 descriptor->register_params_ = registers; | 150 descriptor->register_params_ = registers; |
150 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 151 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
151 descriptor->deoptimization_handler_ = | 152 descriptor->deoptimization_handler_ = |
152 FUNCTION_ADDR(ArrayConstructor_StubFailure); | 153 FUNCTION_ADDR(ArrayConstructor_StubFailure); |
153 } | 154 } |
(...skipping 7200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7354 __ cmp(r3, Operand(global_property_cell_map)); | 7355 __ cmp(r3, Operand(global_property_cell_map)); |
7355 __ Assert(eq, "Expected property cell in register ebx"); | 7356 __ Assert(eq, "Expected property cell in register ebx"); |
7356 __ bind(&okay_here); | 7357 __ bind(&okay_here); |
7357 } | 7358 } |
7358 | 7359 |
7359 if (FLAG_optimize_constructed_arrays) { | 7360 if (FLAG_optimize_constructed_arrays) { |
7360 Label no_info, switch_ready; | 7361 Label no_info, switch_ready; |
7361 // Get the elements kind and case on that. | 7362 // Get the elements kind and case on that. |
7362 __ cmp(r2, Operand(undefined_sentinel)); | 7363 __ cmp(r2, Operand(undefined_sentinel)); |
7363 __ b(eq, &no_info); | 7364 __ b(eq, &no_info); |
7364 __ ldr(r3, FieldMemOperand(r2, kPointerSize)); | 7365 __ ldr(r3, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset)); |
7365 | 7366 __ JumpIfNotSmi(r3, &no_info); |
7366 // There is no info if the call site went megamorphic either | |
7367 // TODO(mvstanton): Really? I thought if it was the array function that | |
7368 // the cell wouldn't get stamped as megamorphic. | |
7369 __ cmp(r3, | |
7370 Operand(TypeFeedbackCells::MegamorphicSentinel(masm->isolate()))); | |
7371 __ b(eq, &no_info); | |
7372 __ SmiUntag(r3); | 7367 __ SmiUntag(r3); |
7373 __ jmp(&switch_ready); | 7368 __ jmp(&switch_ready); |
7374 __ bind(&no_info); | 7369 __ bind(&no_info); |
7375 __ mov(r3, Operand(GetInitialFastElementsKind())); | 7370 __ mov(r3, Operand(GetInitialFastElementsKind())); |
7376 __ bind(&switch_ready); | 7371 __ bind(&switch_ready); |
7377 | 7372 |
7378 if (argument_count_ == ANY) { | 7373 if (argument_count_ == ANY) { |
7379 Label not_zero_case, not_one_case; | 7374 Label not_zero_case, not_one_case; |
7380 __ tst(r0, r0); | 7375 __ tst(r0, r0); |
7381 __ b(ne, ¬_zero_case); | 7376 __ b(ne, ¬_zero_case); |
(...skipping 28 matching lines...) Expand all Loading... |
7410 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); | 7405 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); |
7411 } | 7406 } |
7412 } | 7407 } |
7413 | 7408 |
7414 | 7409 |
7415 #undef __ | 7410 #undef __ |
7416 | 7411 |
7417 } } // namespace v8::internal | 7412 } } // namespace v8::internal |
7418 | 7413 |
7419 #endif // V8_TARGET_ARCH_ARM | 7414 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |