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

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

Issue 209353006: Refactor optimized in hydrogen only runtime functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 6 years, 9 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
OLDNEW
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
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
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
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 2678 matching lines...) Expand 10 before | Expand all | Expand 10 after
3121 3121
3122 __ Bind(&failure); 3122 __ Bind(&failure);
3123 __ Mov(x0, Operand(masm->isolate()->factory()->null_value())); 3123 __ Mov(x0, Operand(masm->isolate()->factory()->null_value()));
3124 __ PopCPURegList(used_callee_saved_registers); 3124 __ PopCPURegList(used_callee_saved_registers);
3125 // Drop the 4 arguments of the stub from the stack. 3125 // Drop the 4 arguments of the stub from the stack.
3126 __ Drop(4); 3126 __ Drop(4);
3127 __ Ret(); 3127 __ Ret();
3128 3128
3129 __ Bind(&runtime); 3129 __ Bind(&runtime);
3130 __ PopCPURegList(used_callee_saved_registers); 3130 __ PopCPURegList(used_callee_saved_registers);
3131 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); 3131 __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1);
3132 3132
3133 // Deferred code for string handling. 3133 // Deferred code for string handling.
3134 // (6) Not a long external string? If yes, go to (8). 3134 // (6) Not a long external string? If yes, go to (8).
3135 __ Bind(&not_seq_nor_cons); 3135 __ Bind(&not_seq_nor_cons);
3136 // Compare flags are still set. 3136 // Compare flags are still set.
3137 __ B(ne, &not_long_external); // Go to (8). 3137 __ B(ne, &not_long_external); // Go to (8).
3138 3138
3139 // (7) External string. Make it, offset-wise, look like a sequential string. 3139 // (7) External string. Make it, offset-wise, look like a sequential string.
3140 __ Bind(&external_string); 3140 __ Bind(&external_string);
3141 if (masm->emit_debug_code()) { 3141 if (masm->emit_debug_code()) {
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
3537 // Otherwise, return to the fast path. 3537 // Otherwise, return to the fast path.
3538 __ B(&got_smi_index_); 3538 __ B(&got_smi_index_);
3539 3539
3540 // Call runtime. We get here when the receiver is a string and the 3540 // Call runtime. We get here when the receiver is a string and the
3541 // index is a number, but the code of getting the actual character 3541 // index is a number, but the code of getting the actual character
3542 // is too complex (e.g., when the string needs to be flattened). 3542 // is too complex (e.g., when the string needs to be flattened).
3543 __ Bind(&call_runtime_); 3543 __ Bind(&call_runtime_);
3544 call_helper.BeforeCall(masm); 3544 call_helper.BeforeCall(masm);
3545 __ SmiTag(index_); 3545 __ SmiTag(index_);
3546 __ Push(object_, index_); 3546 __ Push(object_, index_);
3547 __ CallRuntime(Runtime::kStringCharCodeAt, 2); 3547 __ CallRuntime(Runtime::kHiddenStringCharCodeAt, 2);
3548 __ Mov(result_, x0); 3548 __ Mov(result_, x0);
3549 call_helper.AfterCall(masm); 3549 call_helper.AfterCall(masm);
3550 __ B(&exit_); 3550 __ B(&exit_);
3551 3551
3552 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); 3552 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase);
3553 } 3553 }
3554 3554
3555 3555
3556 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { 3556 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) {
3557 __ JumpIfNotSmi(code_, &slow_case_); 3557 __ JumpIfNotSmi(code_, &slow_case_);
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
3819 StringCompareStub::GenerateCompareFlatAsciiStrings( 3819 StringCompareStub::GenerateCompareFlatAsciiStrings(
3820 masm, lhs, rhs, x10, x11, x12, x13); 3820 masm, lhs, rhs, x10, x11, x12, x13);
3821 } 3821 }
3822 3822
3823 // Handle more complex cases in runtime. 3823 // Handle more complex cases in runtime.
3824 __ Bind(&runtime); 3824 __ Bind(&runtime);
3825 __ Push(lhs, rhs); 3825 __ Push(lhs, rhs);
3826 if (equality) { 3826 if (equality) {
3827 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); 3827 __ TailCallRuntime(Runtime::kStringEquals, 2, 1);
3828 } else { 3828 } else {
3829 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); 3829 __ TailCallRuntime(Runtime::kHiddenStringCompare, 2, 1);
3830 } 3830 }
3831 3831
3832 __ Bind(&miss); 3832 __ Bind(&miss);
3833 GenerateMiss(masm); 3833 GenerateMiss(masm);
3834 } 3834 }
3835 3835
3836 3836
3837 void ICCompareStub::GenerateObjects(MacroAssembler* masm) { 3837 void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
3838 ASSERT(state_ == CompareIC::OBJECT); 3838 ASSERT(state_ == CompareIC::OBJECT);
3839 ASM_LOCATION("ICCompareStub[Objects]"); 3839 ASM_LOCATION("ICCompareStub[Objects]");
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
4209 __ Add(result_length, result_length, result_length); 4209 __ Add(result_length, result_length, result_length);
4210 __ CopyBytes(result_char0, substring_char0, result_length, x3, kCopyLong); 4210 __ CopyBytes(result_char0, substring_char0, result_length, x3, kCopyLong);
4211 4211
4212 __ Bind(&return_x0); 4212 __ Bind(&return_x0);
4213 Counters* counters = masm->isolate()->counters(); 4213 Counters* counters = masm->isolate()->counters();
4214 __ IncrementCounter(counters->sub_string_native(), 1, x3, x4); 4214 __ IncrementCounter(counters->sub_string_native(), 1, x3, x4);
4215 __ Drop(3); 4215 __ Drop(3);
4216 __ Ret(); 4216 __ Ret();
4217 4217
4218 __ Bind(&runtime); 4218 __ Bind(&runtime);
4219 __ TailCallRuntime(Runtime::kSubString, 3, 1); 4219 __ TailCallRuntime(Runtime::kHiddenSubString, 3, 1);
4220 4220
4221 __ bind(&single_char); 4221 __ bind(&single_char);
4222 // x1: result_length 4222 // x1: result_length
4223 // x10: input_string 4223 // x10: input_string
4224 // x12: input_type 4224 // x12: input_type
4225 // x15: from (untagged) 4225 // x15: from (untagged)
4226 __ SmiTag(from); 4226 __ SmiTag(from);
4227 StringCharAtGenerator generator( 4227 StringCharAtGenerator generator(
4228 input_string, from, result_length, x0, 4228 input_string, from, result_length, x0,
4229 &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER); 4229 &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
4386 4386
4387 __ Bind(&runtime); 4387 __ Bind(&runtime);
4388 4388
4389 // Push arguments back on to the stack. 4389 // Push arguments back on to the stack.
4390 // sp[0] = right string 4390 // sp[0] = right string
4391 // sp[8] = left string. 4391 // sp[8] = left string.
4392 __ Push(left, right); 4392 __ Push(left, right);
4393 4393
4394 // Call the runtime. 4394 // Call the runtime.
4395 // Returns -1 (less), 0 (equal), or 1 (greater) tagged as a small integer. 4395 // Returns -1 (less), 0 (equal), or 1 (greater) tagged as a small integer.
4396 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); 4396 __ TailCallRuntime(Runtime::kHiddenStringCompare, 2, 1);
4397 } 4397 }
4398 4398
4399 4399
4400 void ArrayPushStub::Generate(MacroAssembler* masm) { 4400 void ArrayPushStub::Generate(MacroAssembler* masm) {
4401 Register receiver = x0; 4401 Register receiver = x0;
4402 4402
4403 int argc = arguments_count(); 4403 int argc = arguments_count();
4404 4404
4405 if (argc == 0) { 4405 if (argc == 0) {
4406 // Nothing to do, just return the length. 4406 // Nothing to do, just return the length.
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after
5720 MemOperand(fp, 6 * kPointerSize), 5720 MemOperand(fp, 6 * kPointerSize),
5721 NULL); 5721 NULL);
5722 } 5722 }
5723 5723
5724 5724
5725 #undef __ 5725 #undef __
5726 5726
5727 } } // namespace v8::internal 5727 } } // namespace v8::internal
5728 5728
5729 #endif // V8_TARGET_ARCH_ARM64 5729 #endif // V8_TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698