| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2093 __ movq(result, FieldOperand(result, instr->hydrogen()->offset())); | 2093 __ movq(result, FieldOperand(result, instr->hydrogen()->offset())); |
| 2094 } | 2094 } |
| 2095 } | 2095 } |
| 2096 | 2096 |
| 2097 | 2097 |
| 2098 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2098 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
| 2099 ASSERT(ToRegister(instr->object()).is(rax)); | 2099 ASSERT(ToRegister(instr->object()).is(rax)); |
| 2100 ASSERT(ToRegister(instr->result()).is(rax)); | 2100 ASSERT(ToRegister(instr->result()).is(rax)); |
| 2101 | 2101 |
| 2102 __ Move(rcx, instr->name()); | 2102 __ Move(rcx, instr->name()); |
| 2103 Handle<Code> ic(isolate()->builtins()->builtin(Builtins::LoadIC_Initialize)); | 2103 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); |
| 2104 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2104 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2105 } | 2105 } |
| 2106 | 2106 |
| 2107 | 2107 |
| 2108 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 2108 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
| 2109 Register function = ToRegister(instr->function()); | 2109 Register function = ToRegister(instr->function()); |
| 2110 Register result = ToRegister(instr->result()); | 2110 Register result = ToRegister(instr->result()); |
| 2111 | 2111 |
| 2112 // Check that the function really is a function. | 2112 // Check that the function really is a function. |
| 2113 __ CmpObjectType(function, JS_FUNCTION_TYPE, result); | 2113 __ CmpObjectType(function, JS_FUNCTION_TYPE, result); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2219 | 2219 |
| 2220 // Load the result. | 2220 // Load the result. |
| 2221 __ movzxbq(result, Operand(external_elements, key, times_1, 0)); | 2221 __ movzxbq(result, Operand(external_elements, key, times_1, 0)); |
| 2222 } | 2222 } |
| 2223 | 2223 |
| 2224 | 2224 |
| 2225 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 2225 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
| 2226 ASSERT(ToRegister(instr->object()).is(rdx)); | 2226 ASSERT(ToRegister(instr->object()).is(rdx)); |
| 2227 ASSERT(ToRegister(instr->key()).is(rax)); | 2227 ASSERT(ToRegister(instr->key()).is(rax)); |
| 2228 | 2228 |
| 2229 Handle<Code> ic(isolate()->builtins()->builtin( | 2229 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
| 2230 Builtins::KeyedLoadIC_Initialize)); | |
| 2231 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2230 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2232 } | 2231 } |
| 2233 | 2232 |
| 2234 | 2233 |
| 2235 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 2234 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
| 2236 Register result = ToRegister(instr->result()); | 2235 Register result = ToRegister(instr->result()); |
| 2237 | 2236 |
| 2238 // Check for arguments adapter frame. | 2237 // Check for arguments adapter frame. |
| 2239 NearLabel done, adapted; | 2238 NearLabel done, adapted; |
| 2240 __ movq(result, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); | 2239 __ movq(result, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2774 ASSERT(ToRegister(instr->result()).is(rax)); | 2773 ASSERT(ToRegister(instr->result()).is(rax)); |
| 2775 __ Move(rdi, instr->target()); | 2774 __ Move(rdi, instr->target()); |
| 2776 CallKnownFunction(instr->target(), instr->arity(), instr); | 2775 CallKnownFunction(instr->target(), instr->arity(), instr); |
| 2777 } | 2776 } |
| 2778 | 2777 |
| 2779 | 2778 |
| 2780 void LCodeGen::DoCallNew(LCallNew* instr) { | 2779 void LCodeGen::DoCallNew(LCallNew* instr) { |
| 2781 ASSERT(ToRegister(instr->InputAt(0)).is(rdi)); | 2780 ASSERT(ToRegister(instr->InputAt(0)).is(rdi)); |
| 2782 ASSERT(ToRegister(instr->result()).is(rax)); | 2781 ASSERT(ToRegister(instr->result()).is(rax)); |
| 2783 | 2782 |
| 2784 Handle<Code> builtin(isolate()->builtins()->builtin( | 2783 Handle<Code> builtin = isolate()->builtins()->JSConstructCall(); |
| 2785 Builtins::JSConstructCall)); | |
| 2786 __ Set(rax, instr->arity()); | 2784 __ Set(rax, instr->arity()); |
| 2787 CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr); | 2785 CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr); |
| 2788 } | 2786 } |
| 2789 | 2787 |
| 2790 | 2788 |
| 2791 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 2789 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
| 2792 CallRuntime(instr->function(), instr->arity(), instr); | 2790 CallRuntime(instr->function(), instr->arity(), instr); |
| 2793 } | 2791 } |
| 2794 | 2792 |
| 2795 | 2793 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 2821 } | 2819 } |
| 2822 } | 2820 } |
| 2823 } | 2821 } |
| 2824 | 2822 |
| 2825 | 2823 |
| 2826 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 2824 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
| 2827 ASSERT(ToRegister(instr->object()).is(rdx)); | 2825 ASSERT(ToRegister(instr->object()).is(rdx)); |
| 2828 ASSERT(ToRegister(instr->value()).is(rax)); | 2826 ASSERT(ToRegister(instr->value()).is(rax)); |
| 2829 | 2827 |
| 2830 __ Move(rcx, instr->hydrogen()->name()); | 2828 __ Move(rcx, instr->hydrogen()->name()); |
| 2831 Handle<Code> ic(isolate()->builtins()->builtin( | 2829 Handle<Code> ic = info_->is_strict() |
| 2832 info_->is_strict() ? Builtins::StoreIC_Initialize_Strict | 2830 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
| 2833 : Builtins::StoreIC_Initialize)); | 2831 : isolate()->builtins()->StoreIC_Initialize(); |
| 2834 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2832 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2835 } | 2833 } |
| 2836 | 2834 |
| 2837 | 2835 |
| 2838 void LCodeGen::DoStorePixelArrayElement(LStorePixelArrayElement* instr) { | 2836 void LCodeGen::DoStorePixelArrayElement(LStorePixelArrayElement* instr) { |
| 2839 Register external_pointer = ToRegister(instr->external_pointer()); | 2837 Register external_pointer = ToRegister(instr->external_pointer()); |
| 2840 Register key = ToRegister(instr->key()); | 2838 Register key = ToRegister(instr->key()); |
| 2841 Register value = ToRegister(instr->value()); | 2839 Register value = ToRegister(instr->value()); |
| 2842 | 2840 |
| 2843 { // Clamp the value to [0..255]. | 2841 { // Clamp the value to [0..255]. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2892 __ RecordWrite(elements, key, value); | 2890 __ RecordWrite(elements, key, value); |
| 2893 } | 2891 } |
| 2894 } | 2892 } |
| 2895 | 2893 |
| 2896 | 2894 |
| 2897 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 2895 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
| 2898 ASSERT(ToRegister(instr->object()).is(rdx)); | 2896 ASSERT(ToRegister(instr->object()).is(rdx)); |
| 2899 ASSERT(ToRegister(instr->key()).is(rcx)); | 2897 ASSERT(ToRegister(instr->key()).is(rcx)); |
| 2900 ASSERT(ToRegister(instr->value()).is(rax)); | 2898 ASSERT(ToRegister(instr->value()).is(rax)); |
| 2901 | 2899 |
| 2902 Handle<Code> ic(isolate()->builtins()->builtin( | 2900 Handle<Code> ic = info_->is_strict() |
| 2903 info_->is_strict() ? Builtins::KeyedStoreIC_Initialize_Strict | 2901 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
| 2904 : Builtins::KeyedStoreIC_Initialize)); | 2902 : isolate()->builtins()->KeyedStoreIC_Initialize(); |
| 2905 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2903 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2906 } | 2904 } |
| 2907 | 2905 |
| 2908 | 2906 |
| 2909 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { | 2907 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { |
| 2910 class DeferredStringCharCodeAt: public LDeferredCode { | 2908 class DeferredStringCharCodeAt: public LDeferredCode { |
| 2911 public: | 2909 public: |
| 2912 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) | 2910 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) |
| 2913 : LDeferredCode(codegen), instr_(instr) { } | 2911 : LDeferredCode(codegen), instr_(instr) { } |
| 2914 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } | 2912 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3823 RegisterEnvironmentForDeoptimization(environment); | 3821 RegisterEnvironmentForDeoptimization(environment); |
| 3824 ASSERT(osr_pc_offset_ == -1); | 3822 ASSERT(osr_pc_offset_ == -1); |
| 3825 osr_pc_offset_ = masm()->pc_offset(); | 3823 osr_pc_offset_ = masm()->pc_offset(); |
| 3826 } | 3824 } |
| 3827 | 3825 |
| 3828 #undef __ | 3826 #undef __ |
| 3829 | 3827 |
| 3830 } } // namespace v8::internal | 3828 } } // namespace v8::internal |
| 3831 | 3829 |
| 3832 #endif // V8_TARGET_ARCH_X64 | 3830 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |