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

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

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

Powered by Google App Engine
This is Rietveld 408576698