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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 | 70 |
71 | 71 |
72 void NumberToStringStub::InitializeInterfaceDescriptor( | 72 void NumberToStringStub::InitializeInterfaceDescriptor( |
73 Isolate* isolate, | 73 Isolate* isolate, |
74 CodeStubInterfaceDescriptor* descriptor) { | 74 CodeStubInterfaceDescriptor* descriptor) { |
75 static Register registers[] = { r0 }; | 75 static Register registers[] = { r0 }; |
76 descriptor->register_param_count_ = 1; | 76 descriptor->register_param_count_ = 1; |
77 descriptor->register_params_ = registers; | 77 descriptor->register_params_ = registers; |
78 descriptor->deoptimization_handler_ = | 78 descriptor->deoptimization_handler_ = |
79 Runtime::FunctionForId(Runtime::kNumberToString)->entry; | 79 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; |
80 } | 80 } |
81 | 81 |
82 | 82 |
83 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 83 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
84 Isolate* isolate, | 84 Isolate* isolate, |
85 CodeStubInterfaceDescriptor* descriptor) { | 85 CodeStubInterfaceDescriptor* descriptor) { |
86 static Register registers[] = { r3, r2, r1 }; | 86 static Register registers[] = { r3, r2, r1 }; |
87 descriptor->register_param_count_ = 3; | 87 descriptor->register_param_count_ = 3; |
88 descriptor->register_params_ = registers; | 88 descriptor->register_params_ = registers; |
89 descriptor->deoptimization_handler_ = | 89 descriptor->deoptimization_handler_ = |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } | 134 } |
135 | 135 |
136 | 136 |
137 void RegExpConstructResultStub::InitializeInterfaceDescriptor( | 137 void RegExpConstructResultStub::InitializeInterfaceDescriptor( |
138 Isolate* isolate, | 138 Isolate* isolate, |
139 CodeStubInterfaceDescriptor* descriptor) { | 139 CodeStubInterfaceDescriptor* descriptor) { |
140 static Register registers[] = { r2, r1, r0 }; | 140 static Register registers[] = { r2, r1, r0 }; |
141 descriptor->register_param_count_ = 3; | 141 descriptor->register_param_count_ = 3; |
142 descriptor->register_params_ = registers; | 142 descriptor->register_params_ = registers; |
143 descriptor->deoptimization_handler_ = | 143 descriptor->deoptimization_handler_ = |
144 Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry; | 144 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry; |
145 } | 145 } |
146 | 146 |
147 | 147 |
148 void LoadFieldStub::InitializeInterfaceDescriptor( | 148 void LoadFieldStub::InitializeInterfaceDescriptor( |
149 Isolate* isolate, | 149 Isolate* isolate, |
150 CodeStubInterfaceDescriptor* descriptor) { | 150 CodeStubInterfaceDescriptor* descriptor) { |
151 static Register registers[] = { r0 }; | 151 static Register registers[] = { r0 }; |
152 descriptor->register_param_count_ = 1; | 152 descriptor->register_param_count_ = 1; |
153 descriptor->register_params_ = registers; | 153 descriptor->register_params_ = registers; |
154 descriptor->deoptimization_handler_ = NULL; | 154 descriptor->deoptimization_handler_ = NULL; |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 } | 378 } |
379 | 379 |
380 | 380 |
381 void StringAddStub::InitializeInterfaceDescriptor( | 381 void StringAddStub::InitializeInterfaceDescriptor( |
382 Isolate* isolate, | 382 Isolate* isolate, |
383 CodeStubInterfaceDescriptor* descriptor) { | 383 CodeStubInterfaceDescriptor* descriptor) { |
384 static Register registers[] = { r1, r0 }; | 384 static Register registers[] = { r1, r0 }; |
385 descriptor->register_param_count_ = 2; | 385 descriptor->register_param_count_ = 2; |
386 descriptor->register_params_ = registers; | 386 descriptor->register_params_ = registers; |
387 descriptor->deoptimization_handler_ = | 387 descriptor->deoptimization_handler_ = |
388 Runtime::FunctionForId(Runtime::kStringAdd)->entry; | 388 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry; |
389 } | 389 } |
390 | 390 |
391 | 391 |
392 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 392 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
393 static PlatformCallInterfaceDescriptor default_descriptor = | 393 static PlatformCallInterfaceDescriptor default_descriptor = |
394 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); | 394 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); |
395 | 395 |
396 static PlatformCallInterfaceDescriptor noInlineDescriptor = | 396 static PlatformCallInterfaceDescriptor noInlineDescriptor = |
397 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); | 397 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); |
398 | 398 |
(...skipping 2424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2823 __ jmp(&next_capture); | 2823 __ jmp(&next_capture); |
2824 __ bind(&done); | 2824 __ bind(&done); |
2825 | 2825 |
2826 // Return last match info. | 2826 // Return last match info. |
2827 __ ldr(r0, MemOperand(sp, kLastMatchInfoOffset)); | 2827 __ ldr(r0, MemOperand(sp, kLastMatchInfoOffset)); |
2828 __ add(sp, sp, Operand(4 * kPointerSize)); | 2828 __ add(sp, sp, Operand(4 * kPointerSize)); |
2829 __ Ret(); | 2829 __ Ret(); |
2830 | 2830 |
2831 // Do the runtime call to execute the regexp. | 2831 // Do the runtime call to execute the regexp. |
2832 __ bind(&runtime); | 2832 __ bind(&runtime); |
2833 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); | 2833 __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1); |
2834 | 2834 |
2835 // Deferred code for string handling. | 2835 // Deferred code for string handling. |
2836 // (6) Not a long external string? If yes, go to (8). | 2836 // (6) Not a long external string? If yes, go to (8). |
2837 __ bind(¬_seq_nor_cons); | 2837 __ bind(¬_seq_nor_cons); |
2838 // Compare flags are still set. | 2838 // Compare flags are still set. |
2839 __ b(gt, ¬_long_external); // Go to (8). | 2839 __ b(gt, ¬_long_external); // Go to (8). |
2840 | 2840 |
2841 // (7) External string. Make it, offset-wise, look like a sequential string. | 2841 // (7) External string. Make it, offset-wise, look like a sequential string. |
2842 __ bind(&external_string); | 2842 __ bind(&external_string); |
2843 __ ldr(r0, FieldMemOperand(subject, HeapObject::kMapOffset)); | 2843 __ ldr(r0, FieldMemOperand(subject, HeapObject::kMapOffset)); |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3218 // Otherwise, return to the fast path. | 3218 // Otherwise, return to the fast path. |
3219 __ jmp(&got_smi_index_); | 3219 __ jmp(&got_smi_index_); |
3220 | 3220 |
3221 // Call runtime. We get here when the receiver is a string and the | 3221 // Call runtime. We get here when the receiver is a string and the |
3222 // index is a number, but the code of getting the actual character | 3222 // index is a number, but the code of getting the actual character |
3223 // is too complex (e.g., when the string needs to be flattened). | 3223 // is too complex (e.g., when the string needs to be flattened). |
3224 __ bind(&call_runtime_); | 3224 __ bind(&call_runtime_); |
3225 call_helper.BeforeCall(masm); | 3225 call_helper.BeforeCall(masm); |
3226 __ SmiTag(index_); | 3226 __ SmiTag(index_); |
3227 __ Push(object_, index_); | 3227 __ Push(object_, index_); |
3228 __ CallRuntime(Runtime::kStringCharCodeAt, 2); | 3228 __ CallRuntime(Runtime::kHiddenStringCharCodeAt, 2); |
3229 __ Move(result_, r0); | 3229 __ Move(result_, r0); |
3230 call_helper.AfterCall(masm); | 3230 call_helper.AfterCall(masm); |
3231 __ jmp(&exit_); | 3231 __ jmp(&exit_); |
3232 | 3232 |
3233 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); | 3233 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); |
3234 } | 3234 } |
3235 | 3235 |
3236 | 3236 |
3237 // ------------------------------------------------------------------------- | 3237 // ------------------------------------------------------------------------- |
3238 // StringCharFromCodeGenerator | 3238 // StringCharFromCodeGenerator |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3666 masm, r1, r5, r2, r3, r4, r6, r9, DEST_ALWAYS_ALIGNED); | 3666 masm, r1, r5, r2, r3, r4, r6, r9, DEST_ALWAYS_ALIGNED); |
3667 | 3667 |
3668 __ bind(&return_r0); | 3668 __ bind(&return_r0); |
3669 Counters* counters = masm->isolate()->counters(); | 3669 Counters* counters = masm->isolate()->counters(); |
3670 __ IncrementCounter(counters->sub_string_native(), 1, r3, r4); | 3670 __ IncrementCounter(counters->sub_string_native(), 1, r3, r4); |
3671 __ Drop(3); | 3671 __ Drop(3); |
3672 __ Ret(); | 3672 __ Ret(); |
3673 | 3673 |
3674 // Just jump to runtime to create the sub string. | 3674 // Just jump to runtime to create the sub string. |
3675 __ bind(&runtime); | 3675 __ bind(&runtime); |
3676 __ TailCallRuntime(Runtime::kSubString, 3, 1); | 3676 __ TailCallRuntime(Runtime::kHiddenSubString, 3, 1); |
3677 | 3677 |
3678 __ bind(&single_char); | 3678 __ bind(&single_char); |
3679 // r0: original string | 3679 // r0: original string |
3680 // r1: instance type | 3680 // r1: instance type |
3681 // r2: length | 3681 // r2: length |
3682 // r3: from index (untagged) | 3682 // r3: from index (untagged) |
3683 __ SmiTag(r3, r3); | 3683 __ SmiTag(r3, r3); |
3684 StringCharAtGenerator generator( | 3684 StringCharAtGenerator generator( |
3685 r0, r3, r2, r0, &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER); | 3685 r0, r3, r2, r0, &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER); |
3686 generator.GenerateFast(masm); | 3686 generator.GenerateFast(masm); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3824 __ JumpIfNotBothSequentialAsciiStrings(r1, r0, r2, r3, &runtime); | 3824 __ JumpIfNotBothSequentialAsciiStrings(r1, r0, r2, r3, &runtime); |
3825 | 3825 |
3826 // Compare flat ASCII strings natively. Remove arguments from stack first. | 3826 // Compare flat ASCII strings natively. Remove arguments from stack first. |
3827 __ IncrementCounter(counters->string_compare_native(), 1, r2, r3); | 3827 __ IncrementCounter(counters->string_compare_native(), 1, r2, r3); |
3828 __ add(sp, sp, Operand(2 * kPointerSize)); | 3828 __ add(sp, sp, Operand(2 * kPointerSize)); |
3829 GenerateCompareFlatAsciiStrings(masm, r1, r0, r2, r3, r4, r5); | 3829 GenerateCompareFlatAsciiStrings(masm, r1, r0, r2, r3, r4, r5); |
3830 | 3830 |
3831 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 3831 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
3832 // tagged as a small integer. | 3832 // tagged as a small integer. |
3833 __ bind(&runtime); | 3833 __ bind(&runtime); |
3834 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 3834 __ TailCallRuntime(Runtime::kHiddenStringCompare, 2, 1); |
3835 } | 3835 } |
3836 | 3836 |
3837 | 3837 |
3838 void ArrayPushStub::Generate(MacroAssembler* masm) { | 3838 void ArrayPushStub::Generate(MacroAssembler* masm) { |
3839 Register receiver = r0; | 3839 Register receiver = r0; |
3840 Register scratch = r1; | 3840 Register scratch = r1; |
3841 | 3841 |
3842 int argc = arguments_count(); | 3842 int argc = arguments_count(); |
3843 | 3843 |
3844 if (argc == 0) { | 3844 if (argc == 0) { |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4311 StringCompareStub::GenerateCompareFlatAsciiStrings( | 4311 StringCompareStub::GenerateCompareFlatAsciiStrings( |
4312 masm, left, right, tmp1, tmp2, tmp3, tmp4); | 4312 masm, left, right, tmp1, tmp2, tmp3, tmp4); |
4313 } | 4313 } |
4314 | 4314 |
4315 // Handle more complex cases in runtime. | 4315 // Handle more complex cases in runtime. |
4316 __ bind(&runtime); | 4316 __ bind(&runtime); |
4317 __ Push(left, right); | 4317 __ Push(left, right); |
4318 if (equality) { | 4318 if (equality) { |
4319 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); | 4319 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); |
4320 } else { | 4320 } else { |
4321 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 4321 __ TailCallRuntime(Runtime::kHiddenStringCompare, 2, 1); |
4322 } | 4322 } |
4323 | 4323 |
4324 __ bind(&miss); | 4324 __ bind(&miss); |
4325 GenerateMiss(masm); | 4325 GenerateMiss(masm); |
4326 } | 4326 } |
4327 | 4327 |
4328 | 4328 |
4329 void ICCompareStub::GenerateObjects(MacroAssembler* masm) { | 4329 void ICCompareStub::GenerateObjects(MacroAssembler* masm) { |
4330 ASSERT(state_ == CompareIC::OBJECT); | 4330 ASSERT(state_ == CompareIC::OBJECT); |
4331 Label miss; | 4331 Label miss; |
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5452 MemOperand(fp, 6 * kPointerSize), | 5452 MemOperand(fp, 6 * kPointerSize), |
5453 NULL); | 5453 NULL); |
5454 } | 5454 } |
5455 | 5455 |
5456 | 5456 |
5457 #undef __ | 5457 #undef __ |
5458 | 5458 |
5459 } } // namespace v8::internal | 5459 } } // namespace v8::internal |
5460 | 5460 |
5461 #endif // V8_TARGET_ARCH_ARM | 5461 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |