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

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

Issue 23726041: Turn the NumberToStringStub into a hydrogen stub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments. Created 7 years, 3 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 | « src/arm/code-stubs-arm.h ('k') | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 void ToNumberStub::InitializeInterfaceDescriptor( 52 void ToNumberStub::InitializeInterfaceDescriptor(
53 Isolate* isolate, 53 Isolate* isolate,
54 CodeStubInterfaceDescriptor* descriptor) { 54 CodeStubInterfaceDescriptor* descriptor) {
55 static Register registers[] = { r0 }; 55 static Register registers[] = { r0 };
56 descriptor->register_param_count_ = 1; 56 descriptor->register_param_count_ = 1;
57 descriptor->register_params_ = registers; 57 descriptor->register_params_ = registers;
58 descriptor->deoptimization_handler_ = NULL; 58 descriptor->deoptimization_handler_ = NULL;
59 } 59 }
60 60
61 61
62 void NumberToStringStub::InitializeInterfaceDescriptor(
63 Isolate* isolate,
64 CodeStubInterfaceDescriptor* descriptor) {
65 static Register registers[] = { r0 };
66 descriptor->register_param_count_ = 1;
67 descriptor->register_params_ = registers;
68 descriptor->deoptimization_handler_ = NULL;
69 }
70
71
62 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( 72 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
63 Isolate* isolate, 73 Isolate* isolate,
64 CodeStubInterfaceDescriptor* descriptor) { 74 CodeStubInterfaceDescriptor* descriptor) {
65 static Register registers[] = { r3, r2, r1 }; 75 static Register registers[] = { r3, r2, r1 };
66 descriptor->register_param_count_ = 3; 76 descriptor->register_param_count_ = 3;
67 descriptor->register_params_ = registers; 77 descriptor->register_params_ = registers;
68 descriptor->deoptimization_handler_ = 78 descriptor->deoptimization_handler_ =
69 Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry; 79 Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry;
70 } 80 }
71 81
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 __ ldr(r3, FieldMemOperand(rhs, HeapObject::kMapOffset)); 975 __ ldr(r3, FieldMemOperand(rhs, HeapObject::kMapOffset));
966 __ ldrb(r2, FieldMemOperand(r2, Map::kBitFieldOffset)); 976 __ ldrb(r2, FieldMemOperand(r2, Map::kBitFieldOffset));
967 __ ldrb(r3, FieldMemOperand(r3, Map::kBitFieldOffset)); 977 __ ldrb(r3, FieldMemOperand(r3, Map::kBitFieldOffset));
968 __ and_(r0, r2, Operand(r3)); 978 __ and_(r0, r2, Operand(r3));
969 __ and_(r0, r0, Operand(1 << Map::kIsUndetectable)); 979 __ and_(r0, r0, Operand(1 << Map::kIsUndetectable));
970 __ eor(r0, r0, Operand(1 << Map::kIsUndetectable)); 980 __ eor(r0, r0, Operand(1 << Map::kIsUndetectable));
971 __ Ret(); 981 __ Ret();
972 } 982 }
973 983
974 984
975 void NumberToStringStub::Generate(MacroAssembler* masm) {
976 Label runtime;
977
978 __ ldr(r1, MemOperand(sp, 0));
979
980 // Generate code to lookup number in the number string cache.
981 __ LookupNumberStringCache(r1, r0, r2, r3, r4, &runtime);
982 __ add(sp, sp, Operand(1 * kPointerSize));
983 __ Ret();
984
985 __ bind(&runtime);
986 // Handle number to string in the runtime system if not found in the cache.
987 __ TailCallRuntime(Runtime::kNumberToStringSkipCache, 1, 1);
988 }
989
990
991 static void ICCompareStub_CheckInputType(MacroAssembler* masm, 985 static void ICCompareStub_CheckInputType(MacroAssembler* masm,
992 Register input, 986 Register input,
993 Register scratch, 987 Register scratch,
994 CompareIC::State expected, 988 CompareIC::State expected,
995 Label* fail) { 989 Label* fail) {
996 Label ok; 990 Label ok;
997 if (expected == CompareIC::SMI) { 991 if (expected == CompareIC::SMI) {
998 __ JumpIfNotSmi(input, fail); 992 __ JumpIfNotSmi(input, fail);
999 } else if (expected == CompareIC::NUMBER) { 993 } else if (expected == CompareIC::NUMBER) {
1000 __ JumpIfSmi(input, &ok); 994 __ JumpIfSmi(input, &ok);
(...skipping 6060 matching lines...) Expand 10 before | Expand all | Expand 10 after
7061 __ bind(&fast_elements_case); 7055 __ bind(&fast_elements_case);
7062 GenerateCase(masm, FAST_ELEMENTS); 7056 GenerateCase(masm, FAST_ELEMENTS);
7063 } 7057 }
7064 7058
7065 7059
7066 #undef __ 7060 #undef __
7067 7061
7068 } } // namespace v8::internal 7062 } } // namespace v8::internal
7069 7063
7070 #endif // V8_TARGET_ARCH_ARM 7064 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.h ('k') | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698