| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 | 74 |
| 75 void NumberToStringStub::InitializeInterfaceDescriptor( | 75 void NumberToStringStub::InitializeInterfaceDescriptor( |
| 76 Isolate* isolate, | 76 Isolate* isolate, |
| 77 CodeStubInterfaceDescriptor* descriptor) { | 77 CodeStubInterfaceDescriptor* descriptor) { |
| 78 // x0: value | 78 // x0: value |
| 79 static Register registers[] = { x0 }; | 79 static Register registers[] = { x0 }; |
| 80 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 80 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
| 81 descriptor->register_params_ = registers; | 81 descriptor->register_params_ = registers; |
| 82 descriptor->deoptimization_handler_ = | 82 descriptor->deoptimization_handler_ = |
| 83 Runtime::FunctionForId(Runtime::kNumberToString)->entry; | 83 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; |
| 84 } | 84 } |
| 85 | 85 |
| 86 | 86 |
| 87 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 87 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
| 88 Isolate* isolate, | 88 Isolate* isolate, |
| 89 CodeStubInterfaceDescriptor* descriptor) { | 89 CodeStubInterfaceDescriptor* descriptor) { |
| 90 // x3: array literals array | 90 // x3: array literals array |
| 91 // x2: array literal index | 91 // x2: array literal index |
| 92 // x1: constant elements | 92 // x1: constant elements |
| 93 static Register registers[] = { x3, x2, x1 }; | 93 static Register registers[] = { x3, x2, x1 }; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 void RegExpConstructResultStub::InitializeInterfaceDescriptor( | 154 void RegExpConstructResultStub::InitializeInterfaceDescriptor( |
| 155 Isolate* isolate, | 155 Isolate* isolate, |
| 156 CodeStubInterfaceDescriptor* descriptor) { | 156 CodeStubInterfaceDescriptor* descriptor) { |
| 157 // x2: length | 157 // x2: length |
| 158 // x1: index (of last match) | 158 // x1: index (of last match) |
| 159 // x0: string | 159 // x0: string |
| 160 static Register registers[] = { x2, x1, x0 }; | 160 static Register registers[] = { x2, x1, x0 }; |
| 161 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 161 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
| 162 descriptor->register_params_ = registers; | 162 descriptor->register_params_ = registers; |
| 163 descriptor->deoptimization_handler_ = | 163 descriptor->deoptimization_handler_ = |
| 164 Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry; | 164 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry; |
| 165 } | 165 } |
| 166 | 166 |
| 167 | 167 |
| 168 void LoadFieldStub::InitializeInterfaceDescriptor( | 168 void LoadFieldStub::InitializeInterfaceDescriptor( |
| 169 Isolate* isolate, | 169 Isolate* isolate, |
| 170 CodeStubInterfaceDescriptor* descriptor) { | 170 CodeStubInterfaceDescriptor* descriptor) { |
| 171 // x0: receiver | 171 // x0: receiver |
| 172 static Register registers[] = { x0 }; | 172 static Register registers[] = { x0 }; |
| 173 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 173 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
| 174 descriptor->register_params_ = registers; | 174 descriptor->register_params_ = registers; |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 | 422 |
| 423 void StringAddStub::InitializeInterfaceDescriptor( | 423 void StringAddStub::InitializeInterfaceDescriptor( |
| 424 Isolate* isolate, | 424 Isolate* isolate, |
| 425 CodeStubInterfaceDescriptor* descriptor) { | 425 CodeStubInterfaceDescriptor* descriptor) { |
| 426 // x1: left operand | 426 // x1: left operand |
| 427 // x0: right operand | 427 // x0: right operand |
| 428 static Register registers[] = { x1, x0 }; | 428 static Register registers[] = { x1, x0 }; |
| 429 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 429 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
| 430 descriptor->register_params_ = registers; | 430 descriptor->register_params_ = registers; |
| 431 descriptor->deoptimization_handler_ = | 431 descriptor->deoptimization_handler_ = |
| 432 Runtime::FunctionForId(Runtime::kStringAdd)->entry; | 432 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry; |
| 433 } | 433 } |
| 434 | 434 |
| 435 | 435 |
| 436 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 436 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
| 437 static PlatformCallInterfaceDescriptor default_descriptor = | 437 static PlatformCallInterfaceDescriptor default_descriptor = |
| 438 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); | 438 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); |
| 439 | 439 |
| 440 static PlatformCallInterfaceDescriptor noInlineDescriptor = | 440 static PlatformCallInterfaceDescriptor noInlineDescriptor = |
| 441 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); | 441 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); |
| 442 | 442 |
| (...skipping 2684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3127 | 3127 |
| 3128 __ Bind(&failure); | 3128 __ Bind(&failure); |
| 3129 __ Mov(x0, Operand(masm->isolate()->factory()->null_value())); | 3129 __ Mov(x0, Operand(masm->isolate()->factory()->null_value())); |
| 3130 __ PopCPURegList(used_callee_saved_registers); | 3130 __ PopCPURegList(used_callee_saved_registers); |
| 3131 // Drop the 4 arguments of the stub from the stack. | 3131 // Drop the 4 arguments of the stub from the stack. |
| 3132 __ Drop(4); | 3132 __ Drop(4); |
| 3133 __ Ret(); | 3133 __ Ret(); |
| 3134 | 3134 |
| 3135 __ Bind(&runtime); | 3135 __ Bind(&runtime); |
| 3136 __ PopCPURegList(used_callee_saved_registers); | 3136 __ PopCPURegList(used_callee_saved_registers); |
| 3137 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); | 3137 __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1); |
| 3138 | 3138 |
| 3139 // Deferred code for string handling. | 3139 // Deferred code for string handling. |
| 3140 // (6) Not a long external string? If yes, go to (8). | 3140 // (6) Not a long external string? If yes, go to (8). |
| 3141 __ Bind(¬_seq_nor_cons); | 3141 __ Bind(¬_seq_nor_cons); |
| 3142 // Compare flags are still set. | 3142 // Compare flags are still set. |
| 3143 __ B(ne, ¬_long_external); // Go to (8). | 3143 __ B(ne, ¬_long_external); // Go to (8). |
| 3144 | 3144 |
| 3145 // (7) External string. Make it, offset-wise, look like a sequential string. | 3145 // (7) External string. Make it, offset-wise, look like a sequential string. |
| 3146 __ Bind(&external_string); | 3146 __ Bind(&external_string); |
| 3147 if (masm->emit_debug_code()) { | 3147 if (masm->emit_debug_code()) { |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3543 // Otherwise, return to the fast path. | 3543 // Otherwise, return to the fast path. |
| 3544 __ B(&got_smi_index_); | 3544 __ B(&got_smi_index_); |
| 3545 | 3545 |
| 3546 // Call runtime. We get here when the receiver is a string and the | 3546 // Call runtime. We get here when the receiver is a string and the |
| 3547 // index is a number, but the code of getting the actual character | 3547 // index is a number, but the code of getting the actual character |
| 3548 // is too complex (e.g., when the string needs to be flattened). | 3548 // is too complex (e.g., when the string needs to be flattened). |
| 3549 __ Bind(&call_runtime_); | 3549 __ Bind(&call_runtime_); |
| 3550 call_helper.BeforeCall(masm); | 3550 call_helper.BeforeCall(masm); |
| 3551 __ SmiTag(index_); | 3551 __ SmiTag(index_); |
| 3552 __ Push(object_, index_); | 3552 __ Push(object_, index_); |
| 3553 __ CallRuntime(Runtime::kStringCharCodeAt, 2); | 3553 __ CallRuntime(Runtime::kHiddenStringCharCodeAt, 2); |
| 3554 __ Mov(result_, x0); | 3554 __ Mov(result_, x0); |
| 3555 call_helper.AfterCall(masm); | 3555 call_helper.AfterCall(masm); |
| 3556 __ B(&exit_); | 3556 __ B(&exit_); |
| 3557 | 3557 |
| 3558 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); | 3558 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); |
| 3559 } | 3559 } |
| 3560 | 3560 |
| 3561 | 3561 |
| 3562 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { | 3562 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { |
| 3563 __ JumpIfNotSmi(code_, &slow_case_); | 3563 __ JumpIfNotSmi(code_, &slow_case_); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3825 StringCompareStub::GenerateCompareFlatAsciiStrings( | 3825 StringCompareStub::GenerateCompareFlatAsciiStrings( |
| 3826 masm, lhs, rhs, x10, x11, x12, x13); | 3826 masm, lhs, rhs, x10, x11, x12, x13); |
| 3827 } | 3827 } |
| 3828 | 3828 |
| 3829 // Handle more complex cases in runtime. | 3829 // Handle more complex cases in runtime. |
| 3830 __ Bind(&runtime); | 3830 __ Bind(&runtime); |
| 3831 __ Push(lhs, rhs); | 3831 __ Push(lhs, rhs); |
| 3832 if (equality) { | 3832 if (equality) { |
| 3833 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); | 3833 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); |
| 3834 } else { | 3834 } else { |
| 3835 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 3835 __ TailCallRuntime(Runtime::kHiddenStringCompare, 2, 1); |
| 3836 } | 3836 } |
| 3837 | 3837 |
| 3838 __ Bind(&miss); | 3838 __ Bind(&miss); |
| 3839 GenerateMiss(masm); | 3839 GenerateMiss(masm); |
| 3840 } | 3840 } |
| 3841 | 3841 |
| 3842 | 3842 |
| 3843 void ICCompareStub::GenerateObjects(MacroAssembler* masm) { | 3843 void ICCompareStub::GenerateObjects(MacroAssembler* masm) { |
| 3844 ASSERT(state_ == CompareIC::OBJECT); | 3844 ASSERT(state_ == CompareIC::OBJECT); |
| 3845 ASM_LOCATION("ICCompareStub[Objects]"); | 3845 ASM_LOCATION("ICCompareStub[Objects]"); |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4215 __ Add(result_length, result_length, result_length); | 4215 __ Add(result_length, result_length, result_length); |
| 4216 __ CopyBytes(result_char0, substring_char0, result_length, x3, kCopyLong); | 4216 __ CopyBytes(result_char0, substring_char0, result_length, x3, kCopyLong); |
| 4217 | 4217 |
| 4218 __ Bind(&return_x0); | 4218 __ Bind(&return_x0); |
| 4219 Counters* counters = masm->isolate()->counters(); | 4219 Counters* counters = masm->isolate()->counters(); |
| 4220 __ IncrementCounter(counters->sub_string_native(), 1, x3, x4); | 4220 __ IncrementCounter(counters->sub_string_native(), 1, x3, x4); |
| 4221 __ Drop(3); | 4221 __ Drop(3); |
| 4222 __ Ret(); | 4222 __ Ret(); |
| 4223 | 4223 |
| 4224 __ Bind(&runtime); | 4224 __ Bind(&runtime); |
| 4225 __ TailCallRuntime(Runtime::kSubString, 3, 1); | 4225 __ TailCallRuntime(Runtime::kHiddenSubString, 3, 1); |
| 4226 | 4226 |
| 4227 __ bind(&single_char); | 4227 __ bind(&single_char); |
| 4228 // x1: result_length | 4228 // x1: result_length |
| 4229 // x10: input_string | 4229 // x10: input_string |
| 4230 // x12: input_type | 4230 // x12: input_type |
| 4231 // x15: from (untagged) | 4231 // x15: from (untagged) |
| 4232 __ SmiTag(from); | 4232 __ SmiTag(from); |
| 4233 StringCharAtGenerator generator( | 4233 StringCharAtGenerator generator( |
| 4234 input_string, from, result_length, x0, | 4234 input_string, from, result_length, x0, |
| 4235 &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER); | 4235 &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4392 | 4392 |
| 4393 __ Bind(&runtime); | 4393 __ Bind(&runtime); |
| 4394 | 4394 |
| 4395 // Push arguments back on to the stack. | 4395 // Push arguments back on to the stack. |
| 4396 // sp[0] = right string | 4396 // sp[0] = right string |
| 4397 // sp[8] = left string. | 4397 // sp[8] = left string. |
| 4398 __ Push(left, right); | 4398 __ Push(left, right); |
| 4399 | 4399 |
| 4400 // Call the runtime. | 4400 // Call the runtime. |
| 4401 // Returns -1 (less), 0 (equal), or 1 (greater) tagged as a small integer. | 4401 // Returns -1 (less), 0 (equal), or 1 (greater) tagged as a small integer. |
| 4402 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 4402 __ TailCallRuntime(Runtime::kHiddenStringCompare, 2, 1); |
| 4403 } | 4403 } |
| 4404 | 4404 |
| 4405 | 4405 |
| 4406 void ArrayPushStub::Generate(MacroAssembler* masm) { | 4406 void ArrayPushStub::Generate(MacroAssembler* masm) { |
| 4407 Register receiver = x0; | 4407 Register receiver = x0; |
| 4408 | 4408 |
| 4409 int argc = arguments_count(); | 4409 int argc = arguments_count(); |
| 4410 | 4410 |
| 4411 if (argc == 0) { | 4411 if (argc == 0) { |
| 4412 // Nothing to do, just return the length. | 4412 // Nothing to do, just return the length. |
| (...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5726 MemOperand(fp, 6 * kPointerSize), | 5726 MemOperand(fp, 6 * kPointerSize), |
| 5727 NULL); | 5727 NULL); |
| 5728 } | 5728 } |
| 5729 | 5729 |
| 5730 | 5730 |
| 5731 #undef __ | 5731 #undef __ |
| 5732 | 5732 |
| 5733 } } // namespace v8::internal | 5733 } } // namespace v8::internal |
| 5734 | 5734 |
| 5735 #endif // V8_TARGET_ARCH_ARM64 | 5735 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |