| OLD | NEW |
| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void ToNumberStub::InitializeInterfaceDescriptor( | 57 void ToNumberStub::InitializeInterfaceDescriptor( |
| 58 Isolate* isolate, | 58 Isolate* isolate, |
| 59 CodeStubInterfaceDescriptor* descriptor) { | 59 CodeStubInterfaceDescriptor* descriptor) { |
| 60 static Register registers[] = { eax }; | 60 static Register registers[] = { eax }; |
| 61 descriptor->register_param_count_ = 1; | 61 descriptor->register_param_count_ = 1; |
| 62 descriptor->register_params_ = registers; | 62 descriptor->register_params_ = registers; |
| 63 descriptor->deoptimization_handler_ = NULL; | 63 descriptor->deoptimization_handler_ = NULL; |
| 64 } | 64 } |
| 65 | 65 |
| 66 | 66 |
| 67 void NumberToStringStub::InitializeInterfaceDescriptor( |
| 68 Isolate* isolate, |
| 69 CodeStubInterfaceDescriptor* descriptor) { |
| 70 static Register registers[] = { eax }; |
| 71 descriptor->register_param_count_ = 1; |
| 72 descriptor->register_params_ = registers; |
| 73 descriptor->deoptimization_handler_ = NULL; |
| 74 } |
| 75 |
| 76 |
| 67 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 77 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
| 68 Isolate* isolate, | 78 Isolate* isolate, |
| 69 CodeStubInterfaceDescriptor* descriptor) { | 79 CodeStubInterfaceDescriptor* descriptor) { |
| 70 static Register registers[] = { eax, ebx, ecx }; | 80 static Register registers[] = { eax, ebx, ecx }; |
| 71 descriptor->register_param_count_ = 3; | 81 descriptor->register_param_count_ = 3; |
| 72 descriptor->register_params_ = registers; | 82 descriptor->register_params_ = registers; |
| 73 descriptor->deoptimization_handler_ = | 83 descriptor->deoptimization_handler_ = |
| 74 Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry; | 84 Runtime::FunctionForId(Runtime::kCreateArrayLiteralShallow)->entry; |
| 75 } | 85 } |
| 76 | 86 |
| (...skipping 3683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3760 __ jmp(&loop); | 3770 __ jmp(&loop); |
| 3761 | 3771 |
| 3762 __ bind(&done); | 3772 __ bind(&done); |
| 3763 __ ret(3 * kPointerSize); | 3773 __ ret(3 * kPointerSize); |
| 3764 | 3774 |
| 3765 __ bind(&slowcase); | 3775 __ bind(&slowcase); |
| 3766 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); | 3776 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); |
| 3767 } | 3777 } |
| 3768 | 3778 |
| 3769 | 3779 |
| 3770 void NumberToStringStub::Generate(MacroAssembler* masm) { | |
| 3771 Label runtime; | |
| 3772 | |
| 3773 __ mov(ebx, Operand(esp, kPointerSize)); | |
| 3774 | |
| 3775 // Generate code to lookup number in the number string cache. | |
| 3776 __ LookupNumberStringCache(ebx, eax, ecx, edx, &runtime); | |
| 3777 __ ret(1 * kPointerSize); | |
| 3778 | |
| 3779 __ bind(&runtime); | |
| 3780 // Handle number to string in the runtime system if not found in the cache. | |
| 3781 __ TailCallRuntime(Runtime::kNumberToStringSkipCache, 1, 1); | |
| 3782 } | |
| 3783 | |
| 3784 | |
| 3785 static int NegativeComparisonResult(Condition cc) { | 3780 static int NegativeComparisonResult(Condition cc) { |
| 3786 ASSERT(cc != equal); | 3781 ASSERT(cc != equal); |
| 3787 ASSERT((cc == less) || (cc == less_equal) | 3782 ASSERT((cc == less) || (cc == less_equal) |
| 3788 || (cc == greater) || (cc == greater_equal)); | 3783 || (cc == greater) || (cc == greater_equal)); |
| 3789 return (cc == greater || cc == greater_equal) ? LESS : GREATER; | 3784 return (cc == greater || cc == greater_equal) ? LESS : GREATER; |
| 3790 } | 3785 } |
| 3791 | 3786 |
| 3792 | 3787 |
| 3793 static void CheckInputType(MacroAssembler* masm, | 3788 static void CheckInputType(MacroAssembler* masm, |
| 3794 Register input, | 3789 Register input, |
| (...skipping 3662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7457 __ bind(&fast_elements_case); | 7452 __ bind(&fast_elements_case); |
| 7458 GenerateCase(masm, FAST_ELEMENTS); | 7453 GenerateCase(masm, FAST_ELEMENTS); |
| 7459 } | 7454 } |
| 7460 | 7455 |
| 7461 | 7456 |
| 7462 #undef __ | 7457 #undef __ |
| 7463 | 7458 |
| 7464 } } // namespace v8::internal | 7459 } } // namespace v8::internal |
| 7465 | 7460 |
| 7466 #endif // V8_TARGET_ARCH_IA32 | 7461 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |