| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 descriptor->deoptimization_handler_ = NULL; | 58 descriptor->deoptimization_handler_ = NULL; |
| 59 } | 59 } |
| 60 | 60 |
| 61 | 61 |
| 62 void NumberToStringStub::InitializeInterfaceDescriptor( | 62 void NumberToStringStub::InitializeInterfaceDescriptor( |
| 63 Isolate* isolate, | 63 Isolate* isolate, |
| 64 CodeStubInterfaceDescriptor* descriptor) { | 64 CodeStubInterfaceDescriptor* descriptor) { |
| 65 static Register registers[] = { r0 }; | 65 static Register registers[] = { r0 }; |
| 66 descriptor->register_param_count_ = 1; | 66 descriptor->register_param_count_ = 1; |
| 67 descriptor->register_params_ = registers; | 67 descriptor->register_params_ = registers; |
| 68 descriptor->deoptimization_handler_ = NULL; | 68 descriptor->deoptimization_handler_ = |
| 69 Runtime::FunctionForId(Runtime::kNumberToString)->entry; |
| 69 } | 70 } |
| 70 | 71 |
| 71 | 72 |
| 72 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 73 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
| 73 Isolate* isolate, | 74 Isolate* isolate, |
| 74 CodeStubInterfaceDescriptor* descriptor) { | 75 CodeStubInterfaceDescriptor* descriptor) { |
| 75 static Register registers[] = { r3, r2, r1 }; | 76 static Register registers[] = { r3, r2, r1 }; |
| 76 descriptor->register_param_count_ = 3; | 77 descriptor->register_param_count_ = 3; |
| 77 descriptor->register_params_ = registers; | 78 descriptor->register_params_ = registers; |
| 78 descriptor->deoptimization_handler_ = | 79 descriptor->deoptimization_handler_ = |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 CodeStubInterfaceDescriptor* descriptor, | 186 CodeStubInterfaceDescriptor* descriptor, |
| 186 int constant_stack_parameter_count) { | 187 int constant_stack_parameter_count) { |
| 187 // register state | 188 // register state |
| 188 // r0 -- number of arguments | 189 // r0 -- number of arguments |
| 189 // r1 -- function | 190 // r1 -- function |
| 190 // r2 -- type info cell with elements kind | 191 // r2 -- type info cell with elements kind |
| 191 static Register registers[] = { r1, r2 }; | 192 static Register registers[] = { r1, r2 }; |
| 192 descriptor->register_param_count_ = 2; | 193 descriptor->register_param_count_ = 2; |
| 193 if (constant_stack_parameter_count != 0) { | 194 if (constant_stack_parameter_count != 0) { |
| 194 // stack param count needs (constructor pointer, and single argument) | 195 // stack param count needs (constructor pointer, and single argument) |
| 195 descriptor->stack_parameter_count_ = &r0; | 196 descriptor->stack_parameter_count_ = r0; |
| 196 } | 197 } |
| 197 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 198 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
| 198 descriptor->register_params_ = registers; | 199 descriptor->register_params_ = registers; |
| 199 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 200 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
| 200 descriptor->deoptimization_handler_ = | 201 descriptor->deoptimization_handler_ = |
| 201 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; | 202 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; |
| 202 } | 203 } |
| 203 | 204 |
| 204 | 205 |
| 205 static void InitializeInternalArrayConstructorDescriptor( | 206 static void InitializeInternalArrayConstructorDescriptor( |
| 206 Isolate* isolate, | 207 Isolate* isolate, |
| 207 CodeStubInterfaceDescriptor* descriptor, | 208 CodeStubInterfaceDescriptor* descriptor, |
| 208 int constant_stack_parameter_count) { | 209 int constant_stack_parameter_count) { |
| 209 // register state | 210 // register state |
| 210 // r0 -- number of arguments | 211 // r0 -- number of arguments |
| 211 // r1 -- constructor function | 212 // r1 -- constructor function |
| 212 static Register registers[] = { r1 }; | 213 static Register registers[] = { r1 }; |
| 213 descriptor->register_param_count_ = 1; | 214 descriptor->register_param_count_ = 1; |
| 214 | 215 |
| 215 if (constant_stack_parameter_count != 0) { | 216 if (constant_stack_parameter_count != 0) { |
| 216 // stack param count needs (constructor pointer, and single argument) | 217 // stack param count needs (constructor pointer, and single argument) |
| 217 descriptor->stack_parameter_count_ = &r0; | 218 descriptor->stack_parameter_count_ = r0; |
| 218 } | 219 } |
| 219 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 220 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
| 220 descriptor->register_params_ = registers; | 221 descriptor->register_params_ = registers; |
| 221 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 222 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
| 222 descriptor->deoptimization_handler_ = | 223 descriptor->deoptimization_handler_ = |
| 223 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; | 224 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; |
| 224 } | 225 } |
| 225 | 226 |
| 226 | 227 |
| 227 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 228 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
| (...skipping 4438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4666 // r5: first character of result. | 4667 // r5: first character of result. |
| 4667 StringHelper::GenerateCopyCharacters(masm, r5, r6, r2, r4, false); | 4668 StringHelper::GenerateCopyCharacters(masm, r5, r6, r2, r4, false); |
| 4668 // r5: next character of result. | 4669 // r5: next character of result. |
| 4669 StringHelper::GenerateCopyCharacters(masm, r5, r1, r3, r4, false); | 4670 StringHelper::GenerateCopyCharacters(masm, r5, r1, r3, r4, false); |
| 4670 __ IncrementCounter(counters->string_add_native(), 1, r2, r3); | 4671 __ IncrementCounter(counters->string_add_native(), 1, r2, r3); |
| 4671 __ add(sp, sp, Operand(2 * kPointerSize)); | 4672 __ add(sp, sp, Operand(2 * kPointerSize)); |
| 4672 __ Ret(); | 4673 __ Ret(); |
| 4673 | 4674 |
| 4674 // Just jump to runtime to add the two strings. | 4675 // Just jump to runtime to add the two strings. |
| 4675 __ bind(&call_runtime); | 4676 __ bind(&call_runtime); |
| 4676 if ((flags_ & STRING_ADD_ERECT_FRAME) != 0) { | 4677 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); |
| 4677 GenerateRegisterArgsPop(masm); | |
| 4678 // Build a frame | |
| 4679 { | |
| 4680 FrameScope scope(masm, StackFrame::INTERNAL); | |
| 4681 GenerateRegisterArgsPush(masm); | |
| 4682 __ CallRuntime(Runtime::kStringAdd, 2); | |
| 4683 } | |
| 4684 __ Ret(); | |
| 4685 } else { | |
| 4686 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); | |
| 4687 } | |
| 4688 | 4678 |
| 4689 if (call_builtin.is_linked()) { | 4679 if (call_builtin.is_linked()) { |
| 4690 __ bind(&call_builtin); | 4680 __ bind(&call_builtin); |
| 4691 if ((flags_ & STRING_ADD_ERECT_FRAME) != 0) { | 4681 __ InvokeBuiltin(builtin_id, JUMP_FUNCTION); |
| 4692 GenerateRegisterArgsPop(masm); | |
| 4693 // Build a frame | |
| 4694 { | |
| 4695 FrameScope scope(masm, StackFrame::INTERNAL); | |
| 4696 GenerateRegisterArgsPush(masm); | |
| 4697 __ InvokeBuiltin(builtin_id, CALL_FUNCTION); | |
| 4698 } | |
| 4699 __ Ret(); | |
| 4700 } else { | |
| 4701 __ InvokeBuiltin(builtin_id, JUMP_FUNCTION); | |
| 4702 } | |
| 4703 } | 4682 } |
| 4704 } | 4683 } |
| 4705 | 4684 |
| 4706 | 4685 |
| 4707 void StringAddStub::GenerateRegisterArgsPush(MacroAssembler* masm) { | 4686 void StringAddStub::GenerateRegisterArgsPush(MacroAssembler* masm) { |
| 4708 __ push(r0); | 4687 __ push(r0); |
| 4709 __ push(r1); | 4688 __ push(r1); |
| 4710 } | 4689 } |
| 4711 | 4690 |
| 4712 | 4691 |
| (...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6089 __ bind(&fast_elements_case); | 6068 __ bind(&fast_elements_case); |
| 6090 GenerateCase(masm, FAST_ELEMENTS); | 6069 GenerateCase(masm, FAST_ELEMENTS); |
| 6091 } | 6070 } |
| 6092 | 6071 |
| 6093 | 6072 |
| 6094 #undef __ | 6073 #undef __ |
| 6095 | 6074 |
| 6096 } } // namespace v8::internal | 6075 } } // namespace v8::internal |
| 6097 | 6076 |
| 6098 #endif // V8_TARGET_ARCH_ARM | 6077 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |