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

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

Issue 209353006: Refactor optimized in hydrogen only runtime functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Patch 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
« no previous file with comments | « no previous file | src/arm/full-codegen-arm.cc » ('j') | src/runtime.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 71
72 void NumberToStringStub::InitializeInterfaceDescriptor( 72 void NumberToStringStub::InitializeInterfaceDescriptor(
73 Isolate* isolate, 73 Isolate* isolate,
74 CodeStubInterfaceDescriptor* descriptor) { 74 CodeStubInterfaceDescriptor* descriptor) {
75 static Register registers[] = { r0 }; 75 static Register registers[] = { r0 };
76 descriptor->register_param_count_ = 1; 76 descriptor->register_param_count_ = 1;
77 descriptor->register_params_ = registers; 77 descriptor->register_params_ = registers;
78 descriptor->deoptimization_handler_ = 78 descriptor->deoptimization_handler_ =
79 Runtime::FunctionForId(Runtime::kNumberToString)->entry; 79 Runtime::FunctionForId(Runtime::kNumberToStringInternal)->entry;
80 } 80 }
81 81
82 82
83 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( 83 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
84 Isolate* isolate, 84 Isolate* isolate,
85 CodeStubInterfaceDescriptor* descriptor) { 85 CodeStubInterfaceDescriptor* descriptor) {
86 static Register registers[] = { r3, r2, r1 }; 86 static Register registers[] = { r3, r2, r1 };
87 descriptor->register_param_count_ = 3; 87 descriptor->register_param_count_ = 3;
88 descriptor->register_params_ = registers; 88 descriptor->register_params_ = registers;
89 descriptor->deoptimization_handler_ = 89 descriptor->deoptimization_handler_ =
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 136
137 void RegExpConstructResultStub::InitializeInterfaceDescriptor( 137 void RegExpConstructResultStub::InitializeInterfaceDescriptor(
138 Isolate* isolate, 138 Isolate* isolate,
139 CodeStubInterfaceDescriptor* descriptor) { 139 CodeStubInterfaceDescriptor* descriptor) {
140 static Register registers[] = { r2, r1, r0 }; 140 static Register registers[] = { r2, r1, r0 };
141 descriptor->register_param_count_ = 3; 141 descriptor->register_param_count_ = 3;
142 descriptor->register_params_ = registers; 142 descriptor->register_params_ = registers;
143 descriptor->deoptimization_handler_ = 143 descriptor->deoptimization_handler_ =
144 Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry; 144 Runtime::FunctionForId(Runtime::kRegExpConstructResultInternal)->entry;
145 } 145 }
146 146
147 147
148 void LoadFieldStub::InitializeInterfaceDescriptor( 148 void LoadFieldStub::InitializeInterfaceDescriptor(
149 Isolate* isolate, 149 Isolate* isolate,
150 CodeStubInterfaceDescriptor* descriptor) { 150 CodeStubInterfaceDescriptor* descriptor) {
151 static Register registers[] = { r0 }; 151 static Register registers[] = { r0 };
152 descriptor->register_param_count_ = 1; 152 descriptor->register_param_count_ = 1;
153 descriptor->register_params_ = registers; 153 descriptor->register_params_ = registers;
154 descriptor->deoptimization_handler_ = NULL; 154 descriptor->deoptimization_handler_ = NULL;
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 } 378 }
379 379
380 380
381 void StringAddStub::InitializeInterfaceDescriptor( 381 void StringAddStub::InitializeInterfaceDescriptor(
382 Isolate* isolate, 382 Isolate* isolate,
383 CodeStubInterfaceDescriptor* descriptor) { 383 CodeStubInterfaceDescriptor* descriptor) {
384 static Register registers[] = { r1, r0 }; 384 static Register registers[] = { r1, r0 };
385 descriptor->register_param_count_ = 2; 385 descriptor->register_param_count_ = 2;
386 descriptor->register_params_ = registers; 386 descriptor->register_params_ = registers;
387 descriptor->deoptimization_handler_ = 387 descriptor->deoptimization_handler_ =
388 Runtime::FunctionForId(Runtime::kStringAdd)->entry; 388 Runtime::FunctionForId(Runtime::kStringAddInternal)->entry;
389 } 389 }
390 390
391 391
392 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { 392 void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
393 static PlatformCallInterfaceDescriptor default_descriptor = 393 static PlatformCallInterfaceDescriptor default_descriptor =
394 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); 394 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
395 395
396 static PlatformCallInterfaceDescriptor noInlineDescriptor = 396 static PlatformCallInterfaceDescriptor noInlineDescriptor =
397 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); 397 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS);
398 398
(...skipping 2467 matching lines...) Expand 10 before | Expand all | Expand 10 after
2866 __ jmp(&next_capture); 2866 __ jmp(&next_capture);
2867 __ bind(&done); 2867 __ bind(&done);
2868 2868
2869 // Return last match info. 2869 // Return last match info.
2870 __ ldr(r0, MemOperand(sp, kLastMatchInfoOffset)); 2870 __ ldr(r0, MemOperand(sp, kLastMatchInfoOffset));
2871 __ add(sp, sp, Operand(4 * kPointerSize)); 2871 __ add(sp, sp, Operand(4 * kPointerSize));
2872 __ Ret(); 2872 __ Ret();
2873 2873
2874 // Do the runtime call to execute the regexp. 2874 // Do the runtime call to execute the regexp.
2875 __ bind(&runtime); 2875 __ bind(&runtime);
2876 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); 2876 __ TailCallRuntime(Runtime::kRegExpExecInternal, 4, 1);
2877 2877
2878 // Deferred code for string handling. 2878 // Deferred code for string handling.
2879 // (6) Not a long external string? If yes, go to (8). 2879 // (6) Not a long external string? If yes, go to (8).
2880 __ bind(&not_seq_nor_cons); 2880 __ bind(&not_seq_nor_cons);
2881 // Compare flags are still set. 2881 // Compare flags are still set.
2882 __ b(gt, &not_long_external); // Go to (8). 2882 __ b(gt, &not_long_external); // Go to (8).
2883 2883
2884 // (7) External string. Make it, offset-wise, look like a sequential string. 2884 // (7) External string. Make it, offset-wise, look like a sequential string.
2885 __ bind(&external_string); 2885 __ bind(&external_string);
2886 __ ldr(r0, FieldMemOperand(subject, HeapObject::kMapOffset)); 2886 __ ldr(r0, FieldMemOperand(subject, HeapObject::kMapOffset));
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
3261 // Otherwise, return to the fast path. 3261 // Otherwise, return to the fast path.
3262 __ jmp(&got_smi_index_); 3262 __ jmp(&got_smi_index_);
3263 3263
3264 // Call runtime. We get here when the receiver is a string and the 3264 // Call runtime. We get here when the receiver is a string and the
3265 // index is a number, but the code of getting the actual character 3265 // index is a number, but the code of getting the actual character
3266 // is too complex (e.g., when the string needs to be flattened). 3266 // is too complex (e.g., when the string needs to be flattened).
3267 __ bind(&call_runtime_); 3267 __ bind(&call_runtime_);
3268 call_helper.BeforeCall(masm); 3268 call_helper.BeforeCall(masm);
3269 __ SmiTag(index_); 3269 __ SmiTag(index_);
3270 __ Push(object_, index_); 3270 __ Push(object_, index_);
3271 __ CallRuntime(Runtime::kStringCharCodeAt, 2); 3271 __ CallRuntime(Runtime::kStringCharCodeAtInternal, 2);
3272 __ Move(result_, r0); 3272 __ Move(result_, r0);
3273 call_helper.AfterCall(masm); 3273 call_helper.AfterCall(masm);
3274 __ jmp(&exit_); 3274 __ jmp(&exit_);
3275 3275
3276 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); 3276 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase);
3277 } 3277 }
3278 3278
3279 3279
3280 // ------------------------------------------------------------------------- 3280 // -------------------------------------------------------------------------
3281 // StringCharFromCodeGenerator 3281 // StringCharFromCodeGenerator
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
3709 masm, r1, r5, r2, r3, r4, r6, r9, DEST_ALWAYS_ALIGNED); 3709 masm, r1, r5, r2, r3, r4, r6, r9, DEST_ALWAYS_ALIGNED);
3710 3710
3711 __ bind(&return_r0); 3711 __ bind(&return_r0);
3712 Counters* counters = masm->isolate()->counters(); 3712 Counters* counters = masm->isolate()->counters();
3713 __ IncrementCounter(counters->sub_string_native(), 1, r3, r4); 3713 __ IncrementCounter(counters->sub_string_native(), 1, r3, r4);
3714 __ Drop(3); 3714 __ Drop(3);
3715 __ Ret(); 3715 __ Ret();
3716 3716
3717 // Just jump to runtime to create the sub string. 3717 // Just jump to runtime to create the sub string.
3718 __ bind(&runtime); 3718 __ bind(&runtime);
3719 __ TailCallRuntime(Runtime::kSubString, 3, 1); 3719 __ TailCallRuntime(Runtime::kSubStringInternal, 3, 1);
3720 3720
3721 __ bind(&single_char); 3721 __ bind(&single_char);
3722 // r0: original string 3722 // r0: original string
3723 // r1: instance type 3723 // r1: instance type
3724 // r2: length 3724 // r2: length
3725 // r3: from index (untagged) 3725 // r3: from index (untagged)
3726 __ SmiTag(r3, r3); 3726 __ SmiTag(r3, r3);
3727 StringCharAtGenerator generator( 3727 StringCharAtGenerator generator(
3728 r0, r3, r2, r0, &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER); 3728 r0, r3, r2, r0, &runtime, &runtime, &runtime, STRING_INDEX_IS_NUMBER);
3729 generator.GenerateFast(masm); 3729 generator.GenerateFast(masm);
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
3867 __ JumpIfNotBothSequentialAsciiStrings(r1, r0, r2, r3, &runtime); 3867 __ JumpIfNotBothSequentialAsciiStrings(r1, r0, r2, r3, &runtime);
3868 3868
3869 // Compare flat ASCII strings natively. Remove arguments from stack first. 3869 // Compare flat ASCII strings natively. Remove arguments from stack first.
3870 __ IncrementCounter(counters->string_compare_native(), 1, r2, r3); 3870 __ IncrementCounter(counters->string_compare_native(), 1, r2, r3);
3871 __ add(sp, sp, Operand(2 * kPointerSize)); 3871 __ add(sp, sp, Operand(2 * kPointerSize));
3872 GenerateCompareFlatAsciiStrings(masm, r1, r0, r2, r3, r4, r5); 3872 GenerateCompareFlatAsciiStrings(masm, r1, r0, r2, r3, r4, r5);
3873 3873
3874 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) 3874 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
3875 // tagged as a small integer. 3875 // tagged as a small integer.
3876 __ bind(&runtime); 3876 __ bind(&runtime);
3877 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); 3877 __ TailCallRuntime(Runtime::kStringCompareInternal, 2, 1);
3878 } 3878 }
3879 3879
3880 3880
3881 void ArrayPushStub::Generate(MacroAssembler* masm) { 3881 void ArrayPushStub::Generate(MacroAssembler* masm) {
3882 Register receiver = r0; 3882 Register receiver = r0;
3883 Register scratch = r1; 3883 Register scratch = r1;
3884 3884
3885 int argc = arguments_count(); 3885 int argc = arguments_count();
3886 3886
3887 if (argc == 0) { 3887 if (argc == 0) {
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
4354 StringCompareStub::GenerateCompareFlatAsciiStrings( 4354 StringCompareStub::GenerateCompareFlatAsciiStrings(
4355 masm, left, right, tmp1, tmp2, tmp3, tmp4); 4355 masm, left, right, tmp1, tmp2, tmp3, tmp4);
4356 } 4356 }
4357 4357
4358 // Handle more complex cases in runtime. 4358 // Handle more complex cases in runtime.
4359 __ bind(&runtime); 4359 __ bind(&runtime);
4360 __ Push(left, right); 4360 __ Push(left, right);
4361 if (equality) { 4361 if (equality) {
4362 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); 4362 __ TailCallRuntime(Runtime::kStringEquals, 2, 1);
4363 } else { 4363 } else {
4364 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); 4364 __ TailCallRuntime(Runtime::kStringCompareInternal, 2, 1);
4365 } 4365 }
4366 4366
4367 __ bind(&miss); 4367 __ bind(&miss);
4368 GenerateMiss(masm); 4368 GenerateMiss(masm);
4369 } 4369 }
4370 4370
4371 4371
4372 void ICCompareStub::GenerateObjects(MacroAssembler* masm) { 4372 void ICCompareStub::GenerateObjects(MacroAssembler* masm) {
4373 ASSERT(state_ == CompareIC::OBJECT); 4373 ASSERT(state_ == CompareIC::OBJECT);
4374 Label miss; 4374 Label miss;
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after
5495 MemOperand(fp, 6 * kPointerSize), 5495 MemOperand(fp, 6 * kPointerSize),
5496 NULL); 5496 NULL);
5497 } 5497 }
5498 5498
5499 5499
5500 #undef __ 5500 #undef __
5501 5501
5502 } } // namespace v8::internal 5502 } } // namespace v8::internal
5503 5503
5504 #endif // V8_TARGET_ARCH_ARM 5504 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/full-codegen-arm.cc » ('j') | src/runtime.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698