| 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 | |
| 73 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 63 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
| 74 Isolate* isolate, | 64 Isolate* isolate, |
| 75 CodeStubInterfaceDescriptor* descriptor) { | 65 CodeStubInterfaceDescriptor* descriptor) { |
| 76 static Register registers[] = { rax, rbx, rcx }; | 66 static Register registers[] = { rax, rbx, rcx }; |
| 77 descriptor->register_param_count_ = 3; | 67 descriptor->register_param_count_ = 3; |
| 78 descriptor->register_params_ = registers; | 68 descriptor->register_params_ = registers; |
| 79 descriptor->deoptimization_handler_ = | 69 descriptor->deoptimization_handler_ = |
| 80 Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry; | 70 Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry; |
| 81 } | 71 } |
| 82 | 72 |
| (...skipping 2829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2912 __ jmp(&loop); | 2902 __ jmp(&loop); |
| 2913 | 2903 |
| 2914 __ bind(&done); | 2904 __ bind(&done); |
| 2915 __ ret(3 * kPointerSize); | 2905 __ ret(3 * kPointerSize); |
| 2916 | 2906 |
| 2917 __ bind(&slowcase); | 2907 __ bind(&slowcase); |
| 2918 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); | 2908 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); |
| 2919 } | 2909 } |
| 2920 | 2910 |
| 2921 | 2911 |
| 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 |
| 2922 static int NegativeComparisonResult(Condition cc) { | 2928 static int NegativeComparisonResult(Condition cc) { |
| 2923 ASSERT(cc != equal); | 2929 ASSERT(cc != equal); |
| 2924 ASSERT((cc == less) || (cc == less_equal) | 2930 ASSERT((cc == less) || (cc == less_equal) |
| 2925 || (cc == greater) || (cc == greater_equal)); | 2931 || (cc == greater) || (cc == greater_equal)); |
| 2926 return (cc == greater || cc == greater_equal) ? LESS : GREATER; | 2932 return (cc == greater || cc == greater_equal) ? LESS : GREATER; |
| 2927 } | 2933 } |
| 2928 | 2934 |
| 2929 | 2935 |
| 2930 static void CheckInputType(MacroAssembler* masm, | 2936 static void CheckInputType(MacroAssembler* masm, |
| 2931 Register input, | 2937 Register input, |
| (...skipping 3608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6540 __ bind(&fast_elements_case); | 6546 __ bind(&fast_elements_case); |
| 6541 GenerateCase(masm, FAST_ELEMENTS); | 6547 GenerateCase(masm, FAST_ELEMENTS); |
| 6542 } | 6548 } |
| 6543 | 6549 |
| 6544 | 6550 |
| 6545 #undef __ | 6551 #undef __ |
| 6546 | 6552 |
| 6547 } } // namespace v8::internal | 6553 } } // namespace v8::internal |
| 6548 | 6554 |
| 6549 #endif // V8_TARGET_ARCH_X64 | 6555 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |