OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
11 #include "src/regexp-macro-assembler.h" | 11 #include "src/regexp-macro-assembler.h" |
12 #include "src/stub-cache.h" | 12 #include "src/stub-cache.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 | 16 |
17 | 17 |
18 void FastNewClosureStub::InitializeInterfaceDescriptor( | 18 void FastNewClosureStub::InitializeInterfaceDescriptor( |
19 CodeStubInterfaceDescriptor* descriptor) { | 19 CodeStubInterfaceDescriptor* descriptor) { |
20 // x2: function info | 20 // x2: function info |
21 static Register registers[] = { x2 }; | 21 static Register registers[] = { x2 }; |
22 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 22 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
23 descriptor->register_params_ = registers; | 23 descriptor->register_params_ = registers; |
24 descriptor->deoptimization_handler_ = | 24 descriptor->deoptimization_handler_ = |
25 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry; | 25 Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry; |
26 } | 26 } |
27 | 27 |
28 | 28 |
29 void FastNewContextStub::InitializeInterfaceDescriptor( | 29 void FastNewContextStub::InitializeInterfaceDescriptor( |
30 CodeStubInterfaceDescriptor* descriptor) { | 30 CodeStubInterfaceDescriptor* descriptor) { |
31 // x1: function | 31 // x1: function |
32 static Register registers[] = { x1 }; | 32 static Register registers[] = { x1 }; |
33 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 33 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
34 descriptor->register_params_ = registers; | 34 descriptor->register_params_ = registers; |
35 descriptor->deoptimization_handler_ = NULL; | 35 descriptor->deoptimization_handler_ = NULL; |
(...skipping 10 matching lines...) Loading... | |
46 } | 46 } |
47 | 47 |
48 | 48 |
49 void NumberToStringStub::InitializeInterfaceDescriptor( | 49 void NumberToStringStub::InitializeInterfaceDescriptor( |
50 CodeStubInterfaceDescriptor* descriptor) { | 50 CodeStubInterfaceDescriptor* descriptor) { |
51 // x0: value | 51 // x0: value |
52 static Register registers[] = { x0 }; | 52 static Register registers[] = { x0 }; |
53 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 53 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
54 descriptor->register_params_ = registers; | 54 descriptor->register_params_ = registers; |
55 descriptor->deoptimization_handler_ = | 55 descriptor->deoptimization_handler_ = |
56 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; | 56 Runtime::FunctionForId(Runtime::kNumberToString)->entry; |
57 } | 57 } |
58 | 58 |
59 | 59 |
60 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 60 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
61 CodeStubInterfaceDescriptor* descriptor) { | 61 CodeStubInterfaceDescriptor* descriptor) { |
62 // x3: array literals array | 62 // x3: array literals array |
63 // x2: array literal index | 63 // x2: array literal index |
64 // x1: constant elements | 64 // x1: constant elements |
65 static Register registers[] = { x3, x2, x1 }; | 65 static Register registers[] = { x3, x2, x1 }; |
66 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 66 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
67 descriptor->register_params_ = registers; | 67 descriptor->register_params_ = registers; |
68 static Representation representations[] = { | 68 static Representation representations[] = { |
69 Representation::Tagged(), | 69 Representation::Tagged(), |
70 Representation::Smi(), | 70 Representation::Smi(), |
71 Representation::Tagged() }; | 71 Representation::Tagged() }; |
72 descriptor->register_param_representations_ = representations; | 72 descriptor->register_param_representations_ = representations; |
73 descriptor->deoptimization_handler_ = | 73 descriptor->deoptimization_handler_ = |
74 Runtime::FunctionForId( | 74 Runtime::FunctionForId( |
Michael Starzinger
2014/06/24 13:06:05
nit: Likewise.
danno
2014/06/24 16:22:48
Done.
| |
75 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; | 75 Runtime::kCreateArrayLiteralStubBailout)->entry; |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 79 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
80 CodeStubInterfaceDescriptor* descriptor) { | 80 CodeStubInterfaceDescriptor* descriptor) { |
81 // x3: object literals array | 81 // x3: object literals array |
82 // x2: object literal index | 82 // x2: object literal index |
83 // x1: constant properties | 83 // x1: constant properties |
84 // x0: object literal flags | 84 // x0: object literal flags |
85 static Register registers[] = { x3, x2, x1, x0 }; | 85 static Register registers[] = { x3, x2, x1, x0 }; |
86 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 86 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
87 descriptor->register_params_ = registers; | 87 descriptor->register_params_ = registers; |
88 descriptor->deoptimization_handler_ = | 88 descriptor->deoptimization_handler_ = |
89 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry; | 89 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry; |
90 } | 90 } |
91 | 91 |
92 | 92 |
93 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( | 93 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
94 CodeStubInterfaceDescriptor* descriptor) { | 94 CodeStubInterfaceDescriptor* descriptor) { |
95 // x2: feedback vector | 95 // x2: feedback vector |
96 // x3: call feedback slot | 96 // x3: call feedback slot |
97 static Register registers[] = { x2, x3 }; | 97 static Register registers[] = { x2, x3 }; |
98 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 98 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
99 descriptor->register_params_ = registers; | 99 descriptor->register_params_ = registers; |
(...skipping 37 matching lines...) Loading... | |
137 | 137 |
138 void RegExpConstructResultStub::InitializeInterfaceDescriptor( | 138 void RegExpConstructResultStub::InitializeInterfaceDescriptor( |
139 CodeStubInterfaceDescriptor* descriptor) { | 139 CodeStubInterfaceDescriptor* descriptor) { |
140 // x2: length | 140 // x2: length |
141 // x1: index (of last match) | 141 // x1: index (of last match) |
142 // x0: string | 142 // x0: string |
143 static Register registers[] = { x2, x1, x0 }; | 143 static Register registers[] = { x2, x1, x0 }; |
144 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 144 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
145 descriptor->register_params_ = registers; | 145 descriptor->register_params_ = registers; |
146 descriptor->deoptimization_handler_ = | 146 descriptor->deoptimization_handler_ = |
147 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry; | 147 Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry; |
148 } | 148 } |
149 | 149 |
150 | 150 |
151 void LoadFieldStub::InitializeInterfaceDescriptor( | 151 void LoadFieldStub::InitializeInterfaceDescriptor( |
152 CodeStubInterfaceDescriptor* descriptor) { | 152 CodeStubInterfaceDescriptor* descriptor) { |
153 // x0: receiver | 153 // x0: receiver |
154 static Register registers[] = { x0 }; | 154 static Register registers[] = { x0 }; |
155 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 155 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
156 descriptor->register_params_ = registers; | 156 descriptor->register_params_ = registers; |
157 descriptor->deoptimization_handler_ = NULL; | 157 descriptor->deoptimization_handler_ = NULL; |
(...skipping 90 matching lines...) Loading... | |
248 static Representation representations[] = { | 248 static Representation representations[] = { |
249 Representation::Tagged(), | 249 Representation::Tagged(), |
250 Representation::Tagged(), | 250 Representation::Tagged(), |
251 Representation::Integer32() }; | 251 Representation::Integer32() }; |
252 descriptor->register_param_representations_ = representations; | 252 descriptor->register_param_representations_ = representations; |
253 } | 253 } |
254 | 254 |
255 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 255 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
256 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 256 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
257 descriptor->deoptimization_handler_ = | 257 descriptor->deoptimization_handler_ = |
258 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; | 258 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; |
259 } | 259 } |
260 | 260 |
261 | 261 |
262 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 262 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
263 CodeStubInterfaceDescriptor* descriptor) { | 263 CodeStubInterfaceDescriptor* descriptor) { |
264 InitializeArrayConstructorDescriptor(descriptor, 0); | 264 InitializeArrayConstructorDescriptor(descriptor, 0); |
265 } | 265 } |
266 | 266 |
267 | 267 |
268 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( | 268 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( |
(...skipping 29 matching lines...) Loading... | |
298 descriptor->register_params_ = registers_variable_args; | 298 descriptor->register_params_ = registers_variable_args; |
299 static Representation representations[] = { | 299 static Representation representations[] = { |
300 Representation::Tagged(), | 300 Representation::Tagged(), |
301 Representation::Integer32() }; | 301 Representation::Integer32() }; |
302 descriptor->register_param_representations_ = representations; | 302 descriptor->register_param_representations_ = representations; |
303 } | 303 } |
304 | 304 |
305 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 305 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
306 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 306 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
307 descriptor->deoptimization_handler_ = | 307 descriptor->deoptimization_handler_ = |
308 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; | 308 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; |
309 } | 309 } |
310 | 310 |
311 | 311 |
312 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 312 void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
313 CodeStubInterfaceDescriptor* descriptor) { | 313 CodeStubInterfaceDescriptor* descriptor) { |
314 InitializeInternalArrayConstructorDescriptor(descriptor, 0); | 314 InitializeInternalArrayConstructorDescriptor(descriptor, 0); |
315 } | 315 } |
316 | 316 |
317 | 317 |
318 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( | 318 void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( |
(...skipping 74 matching lines...) Loading... | |
393 | 393 |
394 | 394 |
395 void StringAddStub::InitializeInterfaceDescriptor( | 395 void StringAddStub::InitializeInterfaceDescriptor( |
396 CodeStubInterfaceDescriptor* descriptor) { | 396 CodeStubInterfaceDescriptor* descriptor) { |
397 // x1: left operand | 397 // x1: left operand |
398 // x0: right operand | 398 // x0: right operand |
399 static Register registers[] = { x1, x0 }; | 399 static Register registers[] = { x1, x0 }; |
400 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 400 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
401 descriptor->register_params_ = registers; | 401 descriptor->register_params_ = registers; |
402 descriptor->deoptimization_handler_ = | 402 descriptor->deoptimization_handler_ = |
403 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry; | 403 Runtime::FunctionForId(Runtime::kStringAdd)->entry; |
404 } | 404 } |
405 | 405 |
406 | 406 |
407 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 407 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
408 static PlatformCallInterfaceDescriptor default_descriptor = | 408 static PlatformCallInterfaceDescriptor default_descriptor = |
409 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); | 409 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); |
410 | 410 |
411 static PlatformCallInterfaceDescriptor noInlineDescriptor = | 411 static PlatformCallInterfaceDescriptor noInlineDescriptor = |
412 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); | 412 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); |
413 | 413 |
(...skipping 935 matching lines...) Loading... | |
1349 // catch this corner-case, we bail out if the result was 0. (This can only | 1349 // catch this corner-case, we bail out if the result was 0. (This can only |
1350 // occur if the divisor is infinity or the base is zero.) | 1350 // occur if the divisor is infinity or the base is zero.) |
1351 __ Fcmp(result_double, 0.0); | 1351 __ Fcmp(result_double, 0.0); |
1352 __ B(&done, ne); | 1352 __ B(&done, ne); |
1353 | 1353 |
1354 if (exponent_type_ == ON_STACK) { | 1354 if (exponent_type_ == ON_STACK) { |
1355 // Bail out to runtime code. | 1355 // Bail out to runtime code. |
1356 __ Bind(&call_runtime); | 1356 __ Bind(&call_runtime); |
1357 // Put the arguments back on the stack. | 1357 // Put the arguments back on the stack. |
1358 __ Push(base_tagged, exponent_tagged); | 1358 __ Push(base_tagged, exponent_tagged); |
1359 __ TailCallRuntime(Runtime::kHiddenMathPow, 2, 1); | 1359 __ TailCallRuntime(Runtime::kMathPow, 2, 1); |
1360 | 1360 |
1361 // Return. | 1361 // Return. |
1362 __ Bind(&done); | 1362 __ Bind(&done); |
1363 __ AllocateHeapNumber(result_tagged, &call_runtime, scratch0, scratch1, | 1363 __ AllocateHeapNumber(result_tagged, &call_runtime, scratch0, scratch1, |
1364 result_double); | 1364 result_double); |
1365 ASSERT(result_tagged.is(x0)); | 1365 ASSERT(result_tagged.is(x0)); |
1366 __ IncrementCounter( | 1366 __ IncrementCounter( |
1367 isolate()->counters()->math_pow(), 1, scratch0, scratch1); | 1367 isolate()->counters()->math_pow(), 1, scratch0, scratch1); |
1368 __ Ret(); | 1368 __ Ret(); |
1369 } else { | 1369 } else { |
(...skipping 744 matching lines...) Loading... | |
2114 | 2114 |
2115 // Patch the arguments.length and parameters pointer in the current frame. | 2115 // Patch the arguments.length and parameters pointer in the current frame. |
2116 __ Ldr(x11, MemOperand(caller_fp, | 2116 __ Ldr(x11, MemOperand(caller_fp, |
2117 ArgumentsAdaptorFrameConstants::kLengthOffset)); | 2117 ArgumentsAdaptorFrameConstants::kLengthOffset)); |
2118 __ Poke(x11, 0 * kXRegSize); | 2118 __ Poke(x11, 0 * kXRegSize); |
2119 __ Add(x10, caller_fp, Operand::UntagSmiAndScale(x11, kPointerSizeLog2)); | 2119 __ Add(x10, caller_fp, Operand::UntagSmiAndScale(x11, kPointerSizeLog2)); |
2120 __ Add(x10, x10, StandardFrameConstants::kCallerSPOffset); | 2120 __ Add(x10, x10, StandardFrameConstants::kCallerSPOffset); |
2121 __ Poke(x10, 1 * kXRegSize); | 2121 __ Poke(x10, 1 * kXRegSize); |
2122 | 2122 |
2123 __ Bind(&runtime); | 2123 __ Bind(&runtime); |
2124 __ TailCallRuntime(Runtime::kHiddenNewSloppyArguments, 3, 1); | 2124 __ TailCallRuntime(Runtime::kNewSloppyArguments, 3, 1); |
2125 } | 2125 } |
2126 | 2126 |
2127 | 2127 |
2128 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { | 2128 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { |
2129 // Stack layout on entry. | 2129 // Stack layout on entry. |
2130 // jssp[0]: number of parameters (tagged) | 2130 // jssp[0]: number of parameters (tagged) |
2131 // jssp[8]: address of receiver argument | 2131 // jssp[8]: address of receiver argument |
2132 // jssp[16]: function | 2132 // jssp[16]: function |
2133 // | 2133 // |
2134 // Returns pointer to result object in x0. | 2134 // Returns pointer to result object in x0. |
(...skipping 251 matching lines...) Loading... | |
2386 | 2386 |
2387 __ Bind(&arguments_test); | 2387 __ Bind(&arguments_test); |
2388 __ Cmp(x10, arg_count); | 2388 __ Cmp(x10, arg_count); |
2389 __ B(lt, &arguments_loop); | 2389 __ B(lt, &arguments_loop); |
2390 | 2390 |
2391 __ Ret(); | 2391 __ Ret(); |
2392 | 2392 |
2393 // Do the runtime call to allocate the arguments object. | 2393 // Do the runtime call to allocate the arguments object. |
2394 __ Bind(&runtime); | 2394 __ Bind(&runtime); |
2395 __ Push(function, recv_arg, arg_count_smi); | 2395 __ Push(function, recv_arg, arg_count_smi); |
2396 __ TailCallRuntime(Runtime::kHiddenNewSloppyArguments, 3, 1); | 2396 __ TailCallRuntime(Runtime::kNewSloppyArguments, 3, 1); |
2397 } | 2397 } |
2398 | 2398 |
2399 | 2399 |
2400 void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { | 2400 void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { |
2401 // Stack layout on entry. | 2401 // Stack layout on entry. |
2402 // jssp[0]: number of parameters (tagged) | 2402 // jssp[0]: number of parameters (tagged) |
2403 // jssp[8]: address of receiver argument | 2403 // jssp[8]: address of receiver argument |
2404 // jssp[16]: function | 2404 // jssp[16]: function |
2405 // | 2405 // |
2406 // Returns pointer to result object in x0. | 2406 // Returns pointer to result object in x0. |
(...skipping 112 matching lines...) Loading... | |
2519 __ Sub(param_count, param_count, 1); | 2519 __ Sub(param_count, param_count, 1); |
2520 __ Cbnz(param_count, &loop); | 2520 __ Cbnz(param_count, &loop); |
2521 | 2521 |
2522 // Return from stub. | 2522 // Return from stub. |
2523 __ Bind(&done); | 2523 __ Bind(&done); |
2524 __ Ret(); | 2524 __ Ret(); |
2525 | 2525 |
2526 // Do the runtime call to allocate the arguments object. | 2526 // Do the runtime call to allocate the arguments object. |
2527 __ Bind(&runtime); | 2527 __ Bind(&runtime); |
2528 __ Push(function, params, param_count_smi); | 2528 __ Push(function, params, param_count_smi); |
2529 __ TailCallRuntime(Runtime::kHiddenNewStrictArguments, 3, 1); | 2529 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); |
2530 } | 2530 } |
2531 | 2531 |
2532 | 2532 |
2533 void RegExpExecStub::Generate(MacroAssembler* masm) { | 2533 void RegExpExecStub::Generate(MacroAssembler* masm) { |
2534 #ifdef V8_INTERPRETED_REGEXP | 2534 #ifdef V8_INTERPRETED_REGEXP |
2535 __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1); | 2535 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); |
2536 #else // V8_INTERPRETED_REGEXP | 2536 #else // V8_INTERPRETED_REGEXP |
2537 | 2537 |
2538 // Stack frame on entry. | 2538 // Stack frame on entry. |
2539 // jssp[0]: last_match_info (expected JSArray) | 2539 // jssp[0]: last_match_info (expected JSArray) |
2540 // jssp[8]: previous index | 2540 // jssp[8]: previous index |
2541 // jssp[16]: subject string | 2541 // jssp[16]: subject string |
2542 // jssp[24]: JSRegExp object | 2542 // jssp[24]: JSRegExp object |
2543 Label runtime; | 2543 Label runtime; |
2544 | 2544 |
2545 // Use of registers for this function. | 2545 // Use of registers for this function. |
(...skipping 453 matching lines...) Loading... | |
2999 | 2999 |
3000 __ Bind(&failure); | 3000 __ Bind(&failure); |
3001 __ Mov(x0, Operand(isolate()->factory()->null_value())); | 3001 __ Mov(x0, Operand(isolate()->factory()->null_value())); |
3002 __ PopCPURegList(used_callee_saved_registers); | 3002 __ PopCPURegList(used_callee_saved_registers); |
3003 // Drop the 4 arguments of the stub from the stack. | 3003 // Drop the 4 arguments of the stub from the stack. |
3004 __ Drop(4); | 3004 __ Drop(4); |
3005 __ Ret(); | 3005 __ Ret(); |
3006 | 3006 |
3007 __ Bind(&runtime); | 3007 __ Bind(&runtime); |
3008 __ PopCPURegList(used_callee_saved_registers); | 3008 __ PopCPURegList(used_callee_saved_registers); |
3009 __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1); | 3009 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); |
3010 | 3010 |
3011 // Deferred code for string handling. | 3011 // Deferred code for string handling. |
3012 // (6) Not a long external string? If yes, go to (8). | 3012 // (6) Not a long external string? If yes, go to (8). |
3013 __ Bind(¬_seq_nor_cons); | 3013 __ Bind(¬_seq_nor_cons); |
3014 // Compare flags are still set. | 3014 // Compare flags are still set. |
3015 __ B(ne, ¬_long_external); // Go to (8). | 3015 __ B(ne, ¬_long_external); // Go to (8). |
3016 | 3016 |
3017 // (7) External string. Make it, offset-wise, look like a sequential string. | 3017 // (7) External string. Make it, offset-wise, look like a sequential string. |
3018 __ Bind(&external_string); | 3018 __ Bind(&external_string); |
3019 if (masm->emit_debug_code()) { | 3019 if (masm->emit_debug_code()) { |
(...skipping 530 matching lines...) Loading... | |
3550 index_not_number_, | 3550 index_not_number_, |
3551 DONT_DO_SMI_CHECK); | 3551 DONT_DO_SMI_CHECK); |
3552 call_helper.BeforeCall(masm); | 3552 call_helper.BeforeCall(masm); |
3553 // Save object_ on the stack and pass index_ as argument for runtime call. | 3553 // Save object_ on the stack and pass index_ as argument for runtime call. |
3554 __ Push(object_, index_); | 3554 __ Push(object_, index_); |
3555 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 3555 if (index_flags_ == STRING_INDEX_IS_NUMBER) { |
3556 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); | 3556 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); |
3557 } else { | 3557 } else { |
3558 ASSERT(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | 3558 ASSERT(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); |
3559 // NumberToSmi discards numbers that are not exact integers. | 3559 // NumberToSmi discards numbers that are not exact integers. |
3560 __ CallRuntime(Runtime::kHiddenNumberToSmi, 1); | 3560 __ CallRuntime(Runtime::kNumberToSmi, 1); |
3561 } | 3561 } |
3562 // Save the conversion result before the pop instructions below | 3562 // Save the conversion result before the pop instructions below |
3563 // have a chance to overwrite it. | 3563 // have a chance to overwrite it. |
3564 __ Mov(index_, x0); | 3564 __ Mov(index_, x0); |
3565 __ Pop(object_); | 3565 __ Pop(object_); |
3566 // Reload the instance type. | 3566 // Reload the instance type. |
3567 __ Ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); | 3567 __ Ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); |
3568 __ Ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); | 3568 __ Ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); |
3569 call_helper.AfterCall(masm); | 3569 call_helper.AfterCall(masm); |
3570 | 3570 |
3571 // If index is still not a smi, it must be out of range. | 3571 // If index is still not a smi, it must be out of range. |
3572 __ JumpIfNotSmi(index_, index_out_of_range_); | 3572 __ JumpIfNotSmi(index_, index_out_of_range_); |
3573 // Otherwise, return to the fast path. | 3573 // Otherwise, return to the fast path. |
3574 __ B(&got_smi_index_); | 3574 __ B(&got_smi_index_); |
3575 | 3575 |
3576 // Call runtime. We get here when the receiver is a string and the | 3576 // Call runtime. We get here when the receiver is a string and the |
3577 // index is a number, but the code of getting the actual character | 3577 // index is a number, but the code of getting the actual character |
3578 // is too complex (e.g., when the string needs to be flattened). | 3578 // is too complex (e.g., when the string needs to be flattened). |
3579 __ Bind(&call_runtime_); | 3579 __ Bind(&call_runtime_); |
3580 call_helper.BeforeCall(masm); | 3580 call_helper.BeforeCall(masm); |
3581 __ SmiTag(index_); | 3581 __ SmiTag(index_); |
3582 __ Push(object_, index_); | 3582 __ Push(object_, index_); |
3583 __ CallRuntime(Runtime::kHiddenStringCharCodeAt, 2); | 3583 __ CallRuntime(Runtime::kStringCharCodeAt, 2); |
3584 __ Mov(result_, x0); | 3584 __ Mov(result_, x0); |
3585 call_helper.AfterCall(masm); | 3585 call_helper.AfterCall(masm); |
3586 __ B(&exit_); | 3586 __ B(&exit_); |
3587 | 3587 |
3588 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); | 3588 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); |
3589 } | 3589 } |
3590 | 3590 |
3591 | 3591 |
3592 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { | 3592 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { |
3593 __ JumpIfNotSmi(code_, &slow_case_); | 3593 __ JumpIfNotSmi(code_, &slow_case_); |
(...skipping 261 matching lines...) Loading... | |
3855 StringCompareStub::GenerateCompareFlatAsciiStrings( | 3855 StringCompareStub::GenerateCompareFlatAsciiStrings( |
3856 masm, lhs, rhs, x10, x11, x12, x13); | 3856 masm, lhs, rhs, x10, x11, x12, x13); |
3857 } | 3857 } |
3858 | 3858 |
3859 // Handle more complex cases in runtime. | 3859 // Handle more complex cases in runtime. |
3860 __ Bind(&runtime); | 3860 __ Bind(&runtime); |
3861 __ Push(lhs, rhs); | 3861 __ Push(lhs, rhs); |
3862 if (equality) { | 3862 if (equality) { |
3863 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); | 3863 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); |
3864 } else { | 3864 } else { |
3865 __ TailCallRuntime(Runtime::kHiddenStringCompare, 2, 1); | 3865 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
3866 } | 3866 } |
3867 | 3867 |
3868 __ Bind(&miss); | 3868 __ Bind(&miss); |
3869 GenerateMiss(masm); | 3869 GenerateMiss(masm); |
3870 } | 3870 } |
3871 | 3871 |
3872 | 3872 |
3873 void ICCompareStub::GenerateObjects(MacroAssembler* masm) { | 3873 void ICCompareStub::GenerateObjects(MacroAssembler* masm) { |
3874 ASSERT(state_ == CompareIC::OBJECT); | 3874 ASSERT(state_ == CompareIC::OBJECT); |
3875 ASM_LOCATION("ICCompareStub[Objects]"); | 3875 ASM_LOCATION("ICCompareStub[Objects]"); |
(...skipping 369 matching lines...) Loading... | |
4245 __ Add(result_length, result_length, result_length); | 4245 __ Add(result_length, result_length, result_length); |
4246 __ CopyBytes(result_char0, substring_char0, result_length, x3, kCopyLong); | 4246 __ CopyBytes(result_char0, substring_char0, result_length, x3, kCopyLong); |
4247 | 4247 |
4248 __ Bind(&return_x0); | 4248 __ Bind(&return_x0); |
4249 Counters* counters = isolate()->counters(); | 4249 Counters* counters = isolate()->counters(); |
4250 __ IncrementCounter(counters->sub_string_native(), 1, x3, x4); | 4250 __ IncrementCounter(counters->sub_string_native(), 1, x3, x4); |
4251 __ Drop(3); | 4251 __ Drop(3); |
4252 __ Ret(); | 4252 __ Ret(); |
4253 | 4253 |
4254 __ Bind(&runtime); | 4254 __ Bind(&runtime); |
4255 __ TailCallRuntime(Runtime::kHiddenSubString, 3, 1); | 4255 __ TailCallRuntime(Runtime::kSubString, 3, 1); |
4256 | 4256 |
4257 __ bind(&single_char); | 4257 __ bind(&single_char); |
4258 // x1: result_length | 4258 // x1: result_length |
4259 // x10: input_string | 4259 // x10: input_string |
4260 // x12: input_type | 4260 // x12: input_type |
4261 // x15: from (untagged) | 4261 // x15: from (untagged) |
4262 __ SmiTag(from); | 4262 __ SmiTag(from); |
4263 StringCharAtGenerator generator( | 4263 StringCharAtGenerator generator( |
4264 input_string, from, result_length, x0, | 4264 input_string, from, result_length, x0, |
4265 &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER); | 4265 &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER); |
(...skipping 156 matching lines...) Loading... | |
4422 | 4422 |
4423 __ Bind(&runtime); | 4423 __ Bind(&runtime); |
4424 | 4424 |
4425 // Push arguments back on to the stack. | 4425 // Push arguments back on to the stack. |
4426 // sp[0] = right string | 4426 // sp[0] = right string |
4427 // sp[8] = left string. | 4427 // sp[8] = left string. |
4428 __ Push(left, right); | 4428 __ Push(left, right); |
4429 | 4429 |
4430 // Call the runtime. | 4430 // Call the runtime. |
4431 // Returns -1 (less), 0 (equal), or 1 (greater) tagged as a small integer. | 4431 // Returns -1 (less), 0 (equal), or 1 (greater) tagged as a small integer. |
4432 __ TailCallRuntime(Runtime::kHiddenStringCompare, 2, 1); | 4432 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
4433 } | 4433 } |
4434 | 4434 |
4435 | 4435 |
4436 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { | 4436 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { |
4437 // ----------- S t a t e ------------- | 4437 // ----------- S t a t e ------------- |
4438 // -- x1 : left | 4438 // -- x1 : left |
4439 // -- x0 : right | 4439 // -- x0 : right |
4440 // -- lr : return address | 4440 // -- lr : return address |
4441 // ----------------------------------- | 4441 // ----------------------------------- |
4442 | 4442 |
(...skipping 1103 matching lines...) Loading... | |
5546 MemOperand(fp, 6 * kPointerSize), | 5546 MemOperand(fp, 6 * kPointerSize), |
5547 NULL); | 5547 NULL); |
5548 } | 5548 } |
5549 | 5549 |
5550 | 5550 |
5551 #undef __ | 5551 #undef __ |
5552 | 5552 |
5553 } } // namespace v8::internal | 5553 } } // namespace v8::internal |
5554 | 5554 |
5555 #endif // V8_TARGET_ARCH_ARM64 | 5555 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |