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