OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void ToNumberStub::InitializeInterfaceDescriptor( | 53 void ToNumberStub::InitializeInterfaceDescriptor( |
54 Isolate* isolate, | 54 Isolate* isolate, |
55 CodeStubInterfaceDescriptor* descriptor) { | 55 CodeStubInterfaceDescriptor* descriptor) { |
56 static Register registers[] = { rax }; | 56 static Register registers[] = { rax }; |
57 descriptor->register_param_count_ = 1; | 57 descriptor->register_param_count_ = 1; |
58 descriptor->register_params_ = registers; | 58 descriptor->register_params_ = registers; |
59 descriptor->deoptimization_handler_ = NULL; | 59 descriptor->deoptimization_handler_ = NULL; |
60 } | 60 } |
61 | 61 |
62 | 62 |
| 63 void NumberToStringStub::InitializeInterfaceDescriptor( |
| 64 Isolate* isolate, |
| 65 CodeStubInterfaceDescriptor* descriptor) { |
| 66 static Register registers[] = { rax }; |
| 67 descriptor->register_param_count_ = 1; |
| 68 descriptor->register_params_ = registers; |
| 69 descriptor->deoptimization_handler_ = NULL; |
| 70 } |
| 71 |
| 72 |
63 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 73 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
64 Isolate* isolate, | 74 Isolate* isolate, |
65 CodeStubInterfaceDescriptor* descriptor) { | 75 CodeStubInterfaceDescriptor* descriptor) { |
66 static Register registers[] = { rax, rbx, rcx }; | 76 static Register registers[] = { rax, rbx, rcx }; |
67 descriptor->register_param_count_ = 3; | 77 descriptor->register_param_count_ = 3; |
68 descriptor->register_params_ = registers; | 78 descriptor->register_params_ = registers; |
69 descriptor->deoptimization_handler_ = | 79 descriptor->deoptimization_handler_ = |
70 Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry; | 80 Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry; |
71 } | 81 } |
72 | 82 |
(...skipping 2829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2902 __ jmp(&loop); | 2912 __ jmp(&loop); |
2903 | 2913 |
2904 __ bind(&done); | 2914 __ bind(&done); |
2905 __ ret(3 * kPointerSize); | 2915 __ ret(3 * kPointerSize); |
2906 | 2916 |
2907 __ bind(&slowcase); | 2917 __ bind(&slowcase); |
2908 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); | 2918 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); |
2909 } | 2919 } |
2910 | 2920 |
2911 | 2921 |
2912 void NumberToStringStub::Generate(MacroAssembler* masm) { | |
2913 Label runtime; | |
2914 | |
2915 StackArgumentsAccessor args(rsp, 1, ARGUMENTS_DONT_CONTAIN_RECEIVER); | |
2916 __ movq(rbx, args.GetArgumentOperand(0)); | |
2917 | |
2918 // Generate code to lookup number in the number string cache. | |
2919 __ LookupNumberStringCache(rbx, rax, r8, r9, &runtime); | |
2920 __ ret(1 * kPointerSize); | |
2921 | |
2922 __ bind(&runtime); | |
2923 // Handle number to string in the runtime system if not found in the cache. | |
2924 __ TailCallRuntime(Runtime::kNumberToStringSkipCache, 1, 1); | |
2925 } | |
2926 | |
2927 | |
2928 static int NegativeComparisonResult(Condition cc) { | 2922 static int NegativeComparisonResult(Condition cc) { |
2929 ASSERT(cc != equal); | 2923 ASSERT(cc != equal); |
2930 ASSERT((cc == less) || (cc == less_equal) | 2924 ASSERT((cc == less) || (cc == less_equal) |
2931 || (cc == greater) || (cc == greater_equal)); | 2925 || (cc == greater) || (cc == greater_equal)); |
2932 return (cc == greater || cc == greater_equal) ? LESS : GREATER; | 2926 return (cc == greater || cc == greater_equal) ? LESS : GREATER; |
2933 } | 2927 } |
2934 | 2928 |
2935 | 2929 |
2936 static void CheckInputType(MacroAssembler* masm, | 2930 static void CheckInputType(MacroAssembler* masm, |
2937 Register input, | 2931 Register input, |
(...skipping 3608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6546 __ bind(&fast_elements_case); | 6540 __ bind(&fast_elements_case); |
6547 GenerateCase(masm, FAST_ELEMENTS); | 6541 GenerateCase(masm, FAST_ELEMENTS); |
6548 } | 6542 } |
6549 | 6543 |
6550 | 6544 |
6551 #undef __ | 6545 #undef __ |
6552 | 6546 |
6553 } } // namespace v8::internal | 6547 } } // namespace v8::internal |
6554 | 6548 |
6555 #endif // V8_TARGET_ARCH_X64 | 6549 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |