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

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

Issue 346413004: Remove distinction between hidden and normal runtime functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_ARM 7 #if V8_TARGET_ARCH_ARM
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 static Register registers[] = { r2 }; 20 static Register registers[] = { r2 };
21 descriptor->register_param_count_ = 1; 21 descriptor->register_param_count_ = 1;
22 descriptor->register_params_ = registers; 22 descriptor->register_params_ = registers;
23 descriptor->deoptimization_handler_ = 23 descriptor->deoptimization_handler_ =
24 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry; 24 Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry;
25 } 25 }
26 26
27 27
28 void FastNewContextStub::InitializeInterfaceDescriptor( 28 void FastNewContextStub::InitializeInterfaceDescriptor(
29 CodeStubInterfaceDescriptor* descriptor) { 29 CodeStubInterfaceDescriptor* descriptor) {
30 static Register registers[] = { r1 }; 30 static Register registers[] = { r1 };
31 descriptor->register_param_count_ = 1; 31 descriptor->register_param_count_ = 1;
32 descriptor->register_params_ = registers; 32 descriptor->register_params_ = registers;
33 descriptor->deoptimization_handler_ = NULL; 33 descriptor->deoptimization_handler_ = NULL;
34 } 34 }
35 35
36 36
37 void ToNumberStub::InitializeInterfaceDescriptor( 37 void ToNumberStub::InitializeInterfaceDescriptor(
38 CodeStubInterfaceDescriptor* descriptor) { 38 CodeStubInterfaceDescriptor* descriptor) {
39 static Register registers[] = { r0 }; 39 static Register registers[] = { r0 };
40 descriptor->register_param_count_ = 1; 40 descriptor->register_param_count_ = 1;
41 descriptor->register_params_ = registers; 41 descriptor->register_params_ = registers;
42 descriptor->deoptimization_handler_ = NULL; 42 descriptor->deoptimization_handler_ = NULL;
43 } 43 }
44 44
45 45
46 void NumberToStringStub::InitializeInterfaceDescriptor( 46 void NumberToStringStub::InitializeInterfaceDescriptor(
47 CodeStubInterfaceDescriptor* descriptor) { 47 CodeStubInterfaceDescriptor* descriptor) {
48 static Register registers[] = { r0 }; 48 static Register registers[] = { r0 };
49 descriptor->register_param_count_ = 1; 49 descriptor->register_param_count_ = 1;
50 descriptor->register_params_ = registers; 50 descriptor->register_params_ = registers;
51 descriptor->deoptimization_handler_ = 51 descriptor->deoptimization_handler_ =
52 Runtime::FunctionForId(Runtime::kHiddenNumberToString)->entry; 52 Runtime::FunctionForId(Runtime::kNumberToString)->entry;
53 } 53 }
54 54
55 55
56 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( 56 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
57 CodeStubInterfaceDescriptor* descriptor) { 57 CodeStubInterfaceDescriptor* descriptor) {
58 static Register registers[] = { r3, r2, r1 }; 58 static Register registers[] = { r3, r2, r1 };
59 descriptor->register_param_count_ = 3; 59 descriptor->register_param_count_ = 3;
60 descriptor->register_params_ = registers; 60 descriptor->register_params_ = registers;
61 static Representation representations[] = { 61 static Representation representations[] = {
62 Representation::Tagged(), 62 Representation::Tagged(),
63 Representation::Smi(), 63 Representation::Smi(),
64 Representation::Tagged() }; 64 Representation::Tagged() };
65 descriptor->register_param_representations_ = representations; 65 descriptor->register_param_representations_ = representations;
66 descriptor->deoptimization_handler_ = 66 descriptor->deoptimization_handler_ =
67 Runtime::FunctionForId( 67 Runtime::FunctionForId(
68 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; 68 Runtime::kCreateArrayLiteralStubBailout)->entry;
Michael Starzinger 2014/06/24 13:06:05 nit: Does this fit into one line now?
danno 2014/06/24 16:22:48 Done.
69 } 69 }
70 70
71 71
72 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( 72 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
73 CodeStubInterfaceDescriptor* descriptor) { 73 CodeStubInterfaceDescriptor* descriptor) {
74 static Register registers[] = { r3, r2, r1, r0 }; 74 static Register registers[] = { r3, r2, r1, r0 };
75 descriptor->register_param_count_ = 4; 75 descriptor->register_param_count_ = 4;
76 descriptor->register_params_ = registers; 76 descriptor->register_params_ = registers;
77 descriptor->deoptimization_handler_ = 77 descriptor->deoptimization_handler_ =
78 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry; 78 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry;
79 } 79 }
80 80
81 81
82 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( 82 void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
83 CodeStubInterfaceDescriptor* descriptor) { 83 CodeStubInterfaceDescriptor* descriptor) {
84 static Register registers[] = { r2, r3 }; 84 static Register registers[] = { r2, r3 };
85 descriptor->register_param_count_ = 2; 85 descriptor->register_param_count_ = 2;
86 descriptor->register_params_ = registers; 86 descriptor->register_params_ = registers;
87 descriptor->deoptimization_handler_ = NULL; 87 descriptor->deoptimization_handler_ = NULL;
88 } 88 }
(...skipping 18 matching lines...) Expand all
107 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); 107 FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure);
108 } 108 }
109 109
110 110
111 void RegExpConstructResultStub::InitializeInterfaceDescriptor( 111 void RegExpConstructResultStub::InitializeInterfaceDescriptor(
112 CodeStubInterfaceDescriptor* descriptor) { 112 CodeStubInterfaceDescriptor* descriptor) {
113 static Register registers[] = { r2, r1, r0 }; 113 static Register registers[] = { r2, r1, r0 };
114 descriptor->register_param_count_ = 3; 114 descriptor->register_param_count_ = 3;
115 descriptor->register_params_ = registers; 115 descriptor->register_params_ = registers;
116 descriptor->deoptimization_handler_ = 116 descriptor->deoptimization_handler_ =
117 Runtime::FunctionForId(Runtime::kHiddenRegExpConstructResult)->entry; 117 Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry;
118 } 118 }
119 119
120 120
121 void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor( 121 void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor(
122 CodeStubInterfaceDescriptor* descriptor) { 122 CodeStubInterfaceDescriptor* descriptor) {
123 static Register registers[] = { r1, r0 }; 123 static Register registers[] = { r1, r0 };
124 descriptor->register_param_count_ = 2; 124 descriptor->register_param_count_ = 2;
125 descriptor->register_params_ = registers; 125 descriptor->register_params_ = registers;
126 descriptor->deoptimization_handler_ = 126 descriptor->deoptimization_handler_ =
127 Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry; 127 Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 static Representation representations[] = { 219 static Representation representations[] = {
220 Representation::Tagged(), 220 Representation::Tagged(),
221 Representation::Tagged(), 221 Representation::Tagged(),
222 Representation::Integer32() }; 222 Representation::Integer32() };
223 descriptor->register_param_representations_ = representations; 223 descriptor->register_param_representations_ = representations;
224 } 224 }
225 225
226 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 226 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
227 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 227 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
228 descriptor->deoptimization_handler_ = 228 descriptor->deoptimization_handler_ =
229 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; 229 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry;
230 } 230 }
231 231
232 232
233 static void InitializeInternalArrayConstructorDescriptor( 233 static void InitializeInternalArrayConstructorDescriptor(
234 CodeStubInterfaceDescriptor* descriptor, 234 CodeStubInterfaceDescriptor* descriptor,
235 int constant_stack_parameter_count) { 235 int constant_stack_parameter_count) {
236 // register state 236 // register state
237 // r0 -- number of arguments 237 // r0 -- number of arguments
238 // r1 -- constructor function 238 // r1 -- constructor function
239 static Register registers_variable_args[] = { r1, r0 }; 239 static Register registers_variable_args[] = { r1, r0 };
(...skipping 10 matching lines...) Expand all
250 descriptor->register_params_ = registers_variable_args; 250 descriptor->register_params_ = registers_variable_args;
251 static Representation representations[] = { 251 static Representation representations[] = {
252 Representation::Tagged(), 252 Representation::Tagged(),
253 Representation::Integer32() }; 253 Representation::Integer32() };
254 descriptor->register_param_representations_ = representations; 254 descriptor->register_param_representations_ = representations;
255 } 255 }
256 256
257 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; 257 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
258 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; 258 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE;
259 descriptor->deoptimization_handler_ = 259 descriptor->deoptimization_handler_ =
260 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; 260 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry;
261 } 261 }
262 262
263 263
264 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( 264 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
265 CodeStubInterfaceDescriptor* descriptor) { 265 CodeStubInterfaceDescriptor* descriptor) {
266 InitializeArrayConstructorDescriptor(descriptor, 0); 266 InitializeArrayConstructorDescriptor(descriptor, 0);
267 } 267 }
268 268
269 269
270 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor( 270 void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite); 349 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite);
350 } 350 }
351 351
352 352
353 void StringAddStub::InitializeInterfaceDescriptor( 353 void StringAddStub::InitializeInterfaceDescriptor(
354 CodeStubInterfaceDescriptor* descriptor) { 354 CodeStubInterfaceDescriptor* descriptor) {
355 static Register registers[] = { r1, r0 }; 355 static Register registers[] = { r1, r0 };
356 descriptor->register_param_count_ = 2; 356 descriptor->register_param_count_ = 2;
357 descriptor->register_params_ = registers; 357 descriptor->register_params_ = registers;
358 descriptor->deoptimization_handler_ = 358 descriptor->deoptimization_handler_ =
359 Runtime::FunctionForId(Runtime::kHiddenStringAdd)->entry; 359 Runtime::FunctionForId(Runtime::kStringAdd)->entry;
360 } 360 }
361 361
362 362
363 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { 363 void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
364 static PlatformCallInterfaceDescriptor default_descriptor = 364 static PlatformCallInterfaceDescriptor default_descriptor =
365 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); 365 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
366 366
367 static PlatformCallInterfaceDescriptor noInlineDescriptor = 367 static PlatformCallInterfaceDescriptor noInlineDescriptor =
368 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); 368 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS);
369 369
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 // double_exponent may not containe the exponent value if the input was a 1392 // double_exponent may not containe the exponent value if the input was a
1393 // smi. We set it with exponent value before bailing out. 1393 // smi. We set it with exponent value before bailing out.
1394 __ vmov(single_scratch, exponent); 1394 __ vmov(single_scratch, exponent);
1395 __ vcvt_f64_s32(double_exponent, single_scratch); 1395 __ vcvt_f64_s32(double_exponent, single_scratch);
1396 1396
1397 // Returning or bailing out. 1397 // Returning or bailing out.
1398 Counters* counters = isolate()->counters(); 1398 Counters* counters = isolate()->counters();
1399 if (exponent_type_ == ON_STACK) { 1399 if (exponent_type_ == ON_STACK) {
1400 // The arguments are still on the stack. 1400 // The arguments are still on the stack.
1401 __ bind(&call_runtime); 1401 __ bind(&call_runtime);
1402 __ TailCallRuntime(Runtime::kHiddenMathPow, 2, 1); 1402 __ TailCallRuntime(Runtime::kMathPow, 2, 1);
1403 1403
1404 // The stub is called from non-optimized code, which expects the result 1404 // The stub is called from non-optimized code, which expects the result
1405 // as heap number in exponent. 1405 // as heap number in exponent.
1406 __ bind(&done); 1406 __ bind(&done);
1407 __ AllocateHeapNumber( 1407 __ AllocateHeapNumber(
1408 heapnumber, scratch, scratch2, heapnumbermap, &call_runtime); 1408 heapnumber, scratch, scratch2, heapnumbermap, &call_runtime);
1409 __ vstr(double_result, 1409 __ vstr(double_result,
1410 FieldMemOperand(heapnumber, HeapNumber::kValueOffset)); 1410 FieldMemOperand(heapnumber, HeapNumber::kValueOffset));
1411 ASSERT(heapnumber.is(r0)); 1411 ASSERT(heapnumber.is(r0));
1412 __ IncrementCounter(counters->math_pow(), 1, scratch, scratch2); 1412 __ IncrementCounter(counters->math_pow(), 1, scratch, scratch2);
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
2051 __ b(ne, &runtime); 2051 __ b(ne, &runtime);
2052 2052
2053 // Patch the arguments.length and the parameters pointer in the current frame. 2053 // Patch the arguments.length and the parameters pointer in the current frame.
2054 __ ldr(r2, MemOperand(r3, ArgumentsAdaptorFrameConstants::kLengthOffset)); 2054 __ ldr(r2, MemOperand(r3, ArgumentsAdaptorFrameConstants::kLengthOffset));
2055 __ str(r2, MemOperand(sp, 0 * kPointerSize)); 2055 __ str(r2, MemOperand(sp, 0 * kPointerSize));
2056 __ add(r3, r3, Operand(r2, LSL, 1)); 2056 __ add(r3, r3, Operand(r2, LSL, 1));
2057 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset)); 2057 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset));
2058 __ str(r3, MemOperand(sp, 1 * kPointerSize)); 2058 __ str(r3, MemOperand(sp, 1 * kPointerSize));
2059 2059
2060 __ bind(&runtime); 2060 __ bind(&runtime);
2061 __ TailCallRuntime(Runtime::kHiddenNewSloppyArguments, 3, 1); 2061 __ TailCallRuntime(Runtime::kNewSloppyArguments, 3, 1);
2062 } 2062 }
2063 2063
2064 2064
2065 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { 2065 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) {
2066 // Stack layout: 2066 // Stack layout:
2067 // sp[0] : number of parameters (tagged) 2067 // sp[0] : number of parameters (tagged)
2068 // sp[4] : address of receiver argument 2068 // sp[4] : address of receiver argument
2069 // sp[8] : function 2069 // sp[8] : function
2070 // Registers used over whole function: 2070 // Registers used over whole function:
2071 // r6 : allocated object (tagged) 2071 // r6 : allocated object (tagged)
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2255 2255
2256 // Return and remove the on-stack parameters. 2256 // Return and remove the on-stack parameters.
2257 __ add(sp, sp, Operand(3 * kPointerSize)); 2257 __ add(sp, sp, Operand(3 * kPointerSize));
2258 __ Ret(); 2258 __ Ret();
2259 2259
2260 // Do the runtime call to allocate the arguments object. 2260 // Do the runtime call to allocate the arguments object.
2261 // r0 = address of new object (tagged) 2261 // r0 = address of new object (tagged)
2262 // r2 = argument count (tagged) 2262 // r2 = argument count (tagged)
2263 __ bind(&runtime); 2263 __ bind(&runtime);
2264 __ str(r2, MemOperand(sp, 0 * kPointerSize)); // Patch argument count. 2264 __ str(r2, MemOperand(sp, 0 * kPointerSize)); // Patch argument count.
2265 __ TailCallRuntime(Runtime::kHiddenNewSloppyArguments, 3, 1); 2265 __ TailCallRuntime(Runtime::kNewSloppyArguments, 3, 1);
2266 } 2266 }
2267 2267
2268 2268
2269 void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { 2269 void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) {
2270 // sp[0] : number of parameters 2270 // sp[0] : number of parameters
2271 // sp[4] : receiver displacement 2271 // sp[4] : receiver displacement
2272 // sp[8] : function 2272 // sp[8] : function
2273 // Check if the calling frame is an arguments adaptor frame. 2273 // Check if the calling frame is an arguments adaptor frame.
2274 Label adaptor_frame, try_allocate, runtime; 2274 Label adaptor_frame, try_allocate, runtime;
2275 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 2275 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2349 __ cmp(r1, Operand::Zero()); 2349 __ cmp(r1, Operand::Zero());
2350 __ b(ne, &loop); 2350 __ b(ne, &loop);
2351 2351
2352 // Return and remove the on-stack parameters. 2352 // Return and remove the on-stack parameters.
2353 __ bind(&done); 2353 __ bind(&done);
2354 __ add(sp, sp, Operand(3 * kPointerSize)); 2354 __ add(sp, sp, Operand(3 * kPointerSize));
2355 __ Ret(); 2355 __ Ret();
2356 2356
2357 // Do the runtime call to allocate the arguments object. 2357 // Do the runtime call to allocate the arguments object.
2358 __ bind(&runtime); 2358 __ bind(&runtime);
2359 __ TailCallRuntime(Runtime::kHiddenNewStrictArguments, 3, 1); 2359 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1);
2360 } 2360 }
2361 2361
2362 2362
2363 void RegExpExecStub::Generate(MacroAssembler* masm) { 2363 void RegExpExecStub::Generate(MacroAssembler* masm) {
2364 // Just jump directly to runtime if native RegExp is not selected at compile 2364 // Just jump directly to runtime if native RegExp is not selected at compile
2365 // time or if regexp entry in generated code is turned off runtime switch or 2365 // time or if regexp entry in generated code is turned off runtime switch or
2366 // at compilation. 2366 // at compilation.
2367 #ifdef V8_INTERPRETED_REGEXP 2367 #ifdef V8_INTERPRETED_REGEXP
2368 __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1); 2368 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
2369 #else // V8_INTERPRETED_REGEXP 2369 #else // V8_INTERPRETED_REGEXP
2370 2370
2371 // Stack frame on entry. 2371 // Stack frame on entry.
2372 // sp[0]: last_match_info (expected JSArray) 2372 // sp[0]: last_match_info (expected JSArray)
2373 // sp[4]: previous index 2373 // sp[4]: previous index
2374 // sp[8]: subject string 2374 // sp[8]: subject string
2375 // sp[12]: JSRegExp object 2375 // sp[12]: JSRegExp object
2376 2376
2377 const int kLastMatchInfoOffset = 0 * kPointerSize; 2377 const int kLastMatchInfoOffset = 0 * kPointerSize;
2378 const int kPreviousIndexOffset = 1 * kPointerSize; 2378 const int kPreviousIndexOffset = 1 * kPointerSize;
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
2733 __ jmp(&next_capture); 2733 __ jmp(&next_capture);
2734 __ bind(&done); 2734 __ bind(&done);
2735 2735
2736 // Return last match info. 2736 // Return last match info.
2737 __ ldr(r0, MemOperand(sp, kLastMatchInfoOffset)); 2737 __ ldr(r0, MemOperand(sp, kLastMatchInfoOffset));
2738 __ add(sp, sp, Operand(4 * kPointerSize)); 2738 __ add(sp, sp, Operand(4 * kPointerSize));
2739 __ Ret(); 2739 __ Ret();
2740 2740
2741 // Do the runtime call to execute the regexp. 2741 // Do the runtime call to execute the regexp.
2742 __ bind(&runtime); 2742 __ bind(&runtime);
2743 __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1); 2743 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
2744 2744
2745 // Deferred code for string handling. 2745 // Deferred code for string handling.
2746 // (6) Not a long external string? If yes, go to (8). 2746 // (6) Not a long external string? If yes, go to (8).
2747 __ bind(&not_seq_nor_cons); 2747 __ bind(&not_seq_nor_cons);
2748 // Compare flags are still set. 2748 // Compare flags are still set.
2749 __ b(gt, &not_long_external); // Go to (8). 2749 __ b(gt, &not_long_external); // Go to (8).
2750 2750
2751 // (7) External string. Make it, offset-wise, look like a sequential string. 2751 // (7) External string. Make it, offset-wise, look like a sequential string.
2752 __ bind(&external_string); 2752 __ bind(&external_string);
2753 __ ldr(r0, FieldMemOperand(subject, HeapObject::kMapOffset)); 2753 __ ldr(r0, FieldMemOperand(subject, HeapObject::kMapOffset));
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
3248 index_not_number_, 3248 index_not_number_,
3249 DONT_DO_SMI_CHECK); 3249 DONT_DO_SMI_CHECK);
3250 call_helper.BeforeCall(masm); 3250 call_helper.BeforeCall(masm);
3251 __ push(object_); 3251 __ push(object_);
3252 __ push(index_); // Consumed by runtime conversion function. 3252 __ push(index_); // Consumed by runtime conversion function.
3253 if (index_flags_ == STRING_INDEX_IS_NUMBER) { 3253 if (index_flags_ == STRING_INDEX_IS_NUMBER) {
3254 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); 3254 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1);
3255 } else { 3255 } else {
3256 ASSERT(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); 3256 ASSERT(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX);
3257 // NumberToSmi discards numbers that are not exact integers. 3257 // NumberToSmi discards numbers that are not exact integers.
3258 __ CallRuntime(Runtime::kHiddenNumberToSmi, 1); 3258 __ CallRuntime(Runtime::kNumberToSmi, 1);
3259 } 3259 }
3260 // Save the conversion result before the pop instructions below 3260 // Save the conversion result before the pop instructions below
3261 // have a chance to overwrite it. 3261 // have a chance to overwrite it.
3262 __ Move(index_, r0); 3262 __ Move(index_, r0);
3263 __ pop(object_); 3263 __ pop(object_);
3264 // Reload the instance type. 3264 // Reload the instance type.
3265 __ ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); 3265 __ ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset));
3266 __ ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); 3266 __ ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset));
3267 call_helper.AfterCall(masm); 3267 call_helper.AfterCall(masm);
3268 // If index is still not a smi, it must be out of range. 3268 // If index is still not a smi, it must be out of range.
3269 __ JumpIfNotSmi(index_, index_out_of_range_); 3269 __ JumpIfNotSmi(index_, index_out_of_range_);
3270 // Otherwise, return to the fast path. 3270 // Otherwise, return to the fast path.
3271 __ jmp(&got_smi_index_); 3271 __ jmp(&got_smi_index_);
3272 3272
3273 // Call runtime. We get here when the receiver is a string and the 3273 // Call runtime. We get here when the receiver is a string and the
3274 // index is a number, but the code of getting the actual character 3274 // index is a number, but the code of getting the actual character
3275 // is too complex (e.g., when the string needs to be flattened). 3275 // is too complex (e.g., when the string needs to be flattened).
3276 __ bind(&call_runtime_); 3276 __ bind(&call_runtime_);
3277 call_helper.BeforeCall(masm); 3277 call_helper.BeforeCall(masm);
3278 __ SmiTag(index_); 3278 __ SmiTag(index_);
3279 __ Push(object_, index_); 3279 __ Push(object_, index_);
3280 __ CallRuntime(Runtime::kHiddenStringCharCodeAt, 2); 3280 __ CallRuntime(Runtime::kStringCharCodeAt, 2);
3281 __ Move(result_, r0); 3281 __ Move(result_, r0);
3282 call_helper.AfterCall(masm); 3282 call_helper.AfterCall(masm);
3283 __ jmp(&exit_); 3283 __ jmp(&exit_);
3284 3284
3285 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); 3285 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase);
3286 } 3286 }
3287 3287
3288 3288
3289 // ------------------------------------------------------------------------- 3289 // -------------------------------------------------------------------------
3290 // StringCharFromCodeGenerator 3290 // StringCharFromCodeGenerator
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
3611 masm, r1, r5, r2, r3, String::TWO_BYTE_ENCODING); 3611 masm, r1, r5, r2, r3, String::TWO_BYTE_ENCODING);
3612 3612
3613 __ bind(&return_r0); 3613 __ bind(&return_r0);
3614 Counters* counters = isolate()->counters(); 3614 Counters* counters = isolate()->counters();
3615 __ IncrementCounter(counters->sub_string_native(), 1, r3, r4); 3615 __ IncrementCounter(counters->sub_string_native(), 1, r3, r4);
3616 __ Drop(3); 3616 __ Drop(3);
3617 __ Ret(); 3617 __ Ret();
3618 3618
3619 // Just jump to runtime to create the sub string. 3619 // Just jump to runtime to create the sub string.
3620 __ bind(&runtime); 3620 __ bind(&runtime);
3621 __ TailCallRuntime(Runtime::kHiddenSubString, 3, 1); 3621 __ TailCallRuntime(Runtime::kSubString, 3, 1);
3622 3622
3623 __ bind(&single_char); 3623 __ bind(&single_char);
3624 // r0: original string 3624 // r0: original string
3625 // r1: instance type 3625 // r1: instance type
3626 // r2: length 3626 // r2: length
3627 // r3: from index (untagged) 3627 // r3: from index (untagged)
3628 __ SmiTag(r3, r3); 3628 __ SmiTag(r3, r3);
3629 StringCharAtGenerator generator( 3629 StringCharAtGenerator generator(
3630 r0, r3, r2, r0, &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER); 3630 r0, r3, r2, r0, &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER);
3631 generator.GenerateFast(masm); 3631 generator.GenerateFast(masm);
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
3769 __ JumpIfNotBothSequentialAsciiStrings(r1, r0, r2, r3, &runtime); 3769 __ JumpIfNotBothSequentialAsciiStrings(r1, r0, r2, r3, &runtime);
3770 3770
3771 // Compare flat ASCII strings natively. Remove arguments from stack first. 3771 // Compare flat ASCII strings natively. Remove arguments from stack first.
3772 __ IncrementCounter(counters->string_compare_native(), 1, r2, r3); 3772 __ IncrementCounter(counters->string_compare_native(), 1, r2, r3);
3773 __ add(sp, sp, Operand(2 * kPointerSize)); 3773 __ add(sp, sp, Operand(2 * kPointerSize));
3774 GenerateCompareFlatAsciiStrings(masm, r1, r0, r2, r3, r4, r5); 3774 GenerateCompareFlatAsciiStrings(masm, r1, r0, r2, r3, r4, r5);
3775 3775
3776 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) 3776 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
3777 // tagged as a small integer. 3777 // tagged as a small integer.
3778 __ bind(&runtime); 3778 __ bind(&runtime);
3779 __ TailCallRuntime(Runtime::kHiddenStringCompare, 2, 1); 3779 __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
3780 } 3780 }
3781 3781
3782 3782
3783 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { 3783 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) {
3784 // ----------- S t a t e ------------- 3784 // ----------- S t a t e -------------
3785 // -- r1 : left 3785 // -- r1 : left
3786 // -- r0 : right 3786 // -- r0 : right
3787 // -- lr : return address 3787 // -- lr : return address
3788 // ----------------------------------- 3788 // -----------------------------------
3789 3789
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
4050 StringCompareStub::GenerateCompareFlatAsciiStrings( 4050 StringCompareStub::GenerateCompareFlatAsciiStrings(
4051 masm, left, right, tmp1, tmp2, tmp3, tmp4); 4051 masm, left, right, tmp1, tmp2, tmp3, tmp4);
4052 } 4052 }
4053 4053
4054 // Handle more complex cases in runtime. 4054 // Handle more complex cases in runtime.
4055 __ bind(&runtime); 4055 __ bind(&runtime);
4056 __ Push(left, right); 4056 __ Push(left, right);
4057 if (equality) { 4057 if (equality) {
4058 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); 4058 __ TailCallRuntime(Runtime::kStringEquals, 2, 1);
4059 } else { 4059 } else {
4060 __ TailCallRuntime(Runtime::kHiddenStringCompare, 2, 1); 4060 __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
4061 } 4061 }
4062 4062
4063 __ bind(&miss); 4063 __ bind(&miss);
4064 GenerateMiss(masm); 4064 GenerateMiss(masm);
4065 } 4065 }
4066 4066
4067 4067
4068 void ICCompareStub::GenerateObjects(MacroAssembler* masm) { 4068 void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
4069 ASSERT(state_ == CompareIC::OBJECT); 4069 ASSERT(state_ == CompareIC::OBJECT);
4070 Label miss; 4070 Label miss;
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after
5179 MemOperand(fp, 6 * kPointerSize), 5179 MemOperand(fp, 6 * kPointerSize),
5180 NULL); 5180 NULL);
5181 } 5181 }
5182 5182
5183 5183
5184 #undef __ 5184 #undef __
5185 5185
5186 } } // namespace v8::internal 5186 } } // namespace v8::internal
5187 5187
5188 #endif // V8_TARGET_ARCH_ARM 5188 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698