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 2112 matching lines...) Loading... |
2123 } | 2123 } |
2124 } | 2124 } |
2125 | 2125 |
2126 | 2126 |
2127 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2127 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
2128 ASSERT(ToRegister(instr->context()).is(esi)); | 2128 ASSERT(ToRegister(instr->context()).is(esi)); |
2129 ASSERT(ToRegister(instr->object()).is(eax)); | 2129 ASSERT(ToRegister(instr->object()).is(eax)); |
2130 ASSERT(ToRegister(instr->result()).is(eax)); | 2130 ASSERT(ToRegister(instr->result()).is(eax)); |
2131 | 2131 |
2132 __ mov(ecx, instr->name()); | 2132 __ mov(ecx, instr->name()); |
2133 Handle<Code> ic(isolate()->builtins()->builtin(Builtins::LoadIC_Initialize)); | 2133 Handle<Code> ic = Builtins::builtin(Builtins::LoadIC_Initialize, isolate()); |
2134 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2134 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2135 } | 2135 } |
2136 | 2136 |
2137 | 2137 |
2138 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 2138 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
2139 Register function = ToRegister(instr->function()); | 2139 Register function = ToRegister(instr->function()); |
2140 Register temp = ToRegister(instr->TempAt(0)); | 2140 Register temp = ToRegister(instr->TempAt(0)); |
2141 Register result = ToRegister(instr->result()); | 2141 Register result = ToRegister(instr->result()); |
2142 | 2142 |
2143 // Check that the function really is a function. | 2143 // Check that the function really is a function. |
(...skipping 104 matching lines...) Loading... |
2248 // Load the result. | 2248 // Load the result. |
2249 __ movzx_b(result, Operand(external_pointer, key, times_1, 0)); | 2249 __ movzx_b(result, Operand(external_pointer, key, times_1, 0)); |
2250 } | 2250 } |
2251 | 2251 |
2252 | 2252 |
2253 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 2253 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
2254 ASSERT(ToRegister(instr->context()).is(esi)); | 2254 ASSERT(ToRegister(instr->context()).is(esi)); |
2255 ASSERT(ToRegister(instr->object()).is(edx)); | 2255 ASSERT(ToRegister(instr->object()).is(edx)); |
2256 ASSERT(ToRegister(instr->key()).is(eax)); | 2256 ASSERT(ToRegister(instr->key()).is(eax)); |
2257 | 2257 |
2258 Handle<Code> ic(isolate()->builtins()->builtin( | 2258 Handle<Code> ic = Builtins::builtin(Builtins::KeyedLoadIC_Initialize, |
2259 Builtins::KeyedLoadIC_Initialize)); | 2259 isolate()); |
2260 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2260 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2261 } | 2261 } |
2262 | 2262 |
2263 | 2263 |
2264 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 2264 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
2265 Register result = ToRegister(instr->result()); | 2265 Register result = ToRegister(instr->result()); |
2266 | 2266 |
2267 // Check for arguments adapter frame. | 2267 // Check for arguments adapter frame. |
2268 NearLabel done, adapted; | 2268 NearLabel done, adapted; |
2269 __ mov(result, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | 2269 __ mov(result, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
(...skipping 536 matching lines...) Loading... |
2806 __ mov(edi, instr->target()); | 2806 __ mov(edi, instr->target()); |
2807 CallKnownFunction(instr->target(), instr->arity(), instr); | 2807 CallKnownFunction(instr->target(), instr->arity(), instr); |
2808 } | 2808 } |
2809 | 2809 |
2810 | 2810 |
2811 void LCodeGen::DoCallNew(LCallNew* instr) { | 2811 void LCodeGen::DoCallNew(LCallNew* instr) { |
2812 ASSERT(ToRegister(instr->context()).is(esi)); | 2812 ASSERT(ToRegister(instr->context()).is(esi)); |
2813 ASSERT(ToRegister(instr->constructor()).is(edi)); | 2813 ASSERT(ToRegister(instr->constructor()).is(edi)); |
2814 ASSERT(ToRegister(instr->result()).is(eax)); | 2814 ASSERT(ToRegister(instr->result()).is(eax)); |
2815 | 2815 |
2816 Handle<Code> builtin(isolate()->builtins()->builtin( | 2816 Handle<Code> builtin =Builtins::builtin(Builtins::JSConstructCall, isolate()); |
2817 Builtins::JSConstructCall)); | |
2818 __ Set(eax, Immediate(instr->arity())); | 2817 __ Set(eax, Immediate(instr->arity())); |
2819 CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr); | 2818 CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr); |
2820 } | 2819 } |
2821 | 2820 |
2822 | 2821 |
2823 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 2822 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
2824 CallRuntime(instr->function(), instr->arity(), instr, false); | 2823 CallRuntime(instr->function(), instr->arity(), instr, false); |
2825 } | 2824 } |
2826 | 2825 |
2827 | 2826 |
(...skipping 26 matching lines...) Loading... |
2854 } | 2853 } |
2855 } | 2854 } |
2856 | 2855 |
2857 | 2856 |
2858 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 2857 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
2859 ASSERT(ToRegister(instr->context()).is(esi)); | 2858 ASSERT(ToRegister(instr->context()).is(esi)); |
2860 ASSERT(ToRegister(instr->object()).is(edx)); | 2859 ASSERT(ToRegister(instr->object()).is(edx)); |
2861 ASSERT(ToRegister(instr->value()).is(eax)); | 2860 ASSERT(ToRegister(instr->value()).is(eax)); |
2862 | 2861 |
2863 __ mov(ecx, instr->name()); | 2862 __ mov(ecx, instr->name()); |
2864 Handle<Code> ic(isolate()->builtins()->builtin( | 2863 Builtins::Name builtin = info_->is_strict() |
2865 info_->is_strict() ? Builtins::StoreIC_Initialize_Strict | 2864 ? Builtins::StoreIC_Initialize_Strict |
2866 : Builtins::StoreIC_Initialize)); | 2865 : Builtins::StoreIC_Initialize; |
| 2866 Handle<Code> ic = Builtins::builtin(builtin, isolate()); |
2867 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2867 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2868 } | 2868 } |
2869 | 2869 |
2870 | 2870 |
2871 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 2871 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
2872 __ cmp(ToRegister(instr->index()), ToOperand(instr->length())); | 2872 __ cmp(ToRegister(instr->index()), ToOperand(instr->length())); |
2873 DeoptimizeIf(above_equal, instr->environment()); | 2873 DeoptimizeIf(above_equal, instr->environment()); |
2874 } | 2874 } |
2875 | 2875 |
2876 | 2876 |
(...skipping 47 matching lines...) Loading... |
2924 } | 2924 } |
2925 } | 2925 } |
2926 | 2926 |
2927 | 2927 |
2928 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 2928 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
2929 ASSERT(ToRegister(instr->context()).is(esi)); | 2929 ASSERT(ToRegister(instr->context()).is(esi)); |
2930 ASSERT(ToRegister(instr->object()).is(edx)); | 2930 ASSERT(ToRegister(instr->object()).is(edx)); |
2931 ASSERT(ToRegister(instr->key()).is(ecx)); | 2931 ASSERT(ToRegister(instr->key()).is(ecx)); |
2932 ASSERT(ToRegister(instr->value()).is(eax)); | 2932 ASSERT(ToRegister(instr->value()).is(eax)); |
2933 | 2933 |
2934 Handle<Code> ic(isolate()->builtins()->builtin( | 2934 Builtins::Name builtin = info_->is_strict() |
2935 info_->is_strict() ? Builtins::KeyedStoreIC_Initialize_Strict | 2935 ? Builtins::KeyedStoreIC_Initialize_Strict |
2936 : Builtins::KeyedStoreIC_Initialize)); | 2936 : Builtins::KeyedStoreIC_Initialize; |
| 2937 Handle<Code> ic = Builtins::builtin(builtin, isolate()); |
2937 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2938 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2938 } | 2939 } |
2939 | 2940 |
2940 | 2941 |
2941 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { | 2942 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { |
2942 class DeferredStringCharCodeAt: public LDeferredCode { | 2943 class DeferredStringCharCodeAt: public LDeferredCode { |
2943 public: | 2944 public: |
2944 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) | 2945 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) |
2945 : LDeferredCode(codegen), instr_(instr) { } | 2946 : LDeferredCode(codegen), instr_(instr) { } |
2946 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } | 2947 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } |
(...skipping 1063 matching lines...) Loading... |
4010 ASSERT(osr_pc_offset_ == -1); | 4011 ASSERT(osr_pc_offset_ == -1); |
4011 osr_pc_offset_ = masm()->pc_offset(); | 4012 osr_pc_offset_ = masm()->pc_offset(); |
4012 } | 4013 } |
4013 | 4014 |
4014 | 4015 |
4015 #undef __ | 4016 #undef __ |
4016 | 4017 |
4017 } } // namespace v8::internal | 4018 } } // namespace v8::internal |
4018 | 4019 |
4019 #endif // V8_TARGET_ARCH_IA32 | 4020 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |