| 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 2191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2202 } | 2202 } |
| 2203 } | 2203 } |
| 2204 | 2204 |
| 2205 | 2205 |
| 2206 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2206 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
| 2207 ASSERT(ToRegister(instr->object()).is(r0)); | 2207 ASSERT(ToRegister(instr->object()).is(r0)); |
| 2208 ASSERT(ToRegister(instr->result()).is(r0)); | 2208 ASSERT(ToRegister(instr->result()).is(r0)); |
| 2209 | 2209 |
| 2210 // Name is always in r2. | 2210 // Name is always in r2. |
| 2211 __ mov(r2, Operand(instr->name())); | 2211 __ mov(r2, Operand(instr->name())); |
| 2212 Handle<Code> ic( | 2212 Handle<Code> ic = |
| 2213 isolate()->builtins()->builtin(Builtins::LoadIC_Initialize)); | 2213 Builtins::builtin(Builtins::LoadIC_Initialize, isolate()); |
| 2214 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2214 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2215 } | 2215 } |
| 2216 | 2216 |
| 2217 | 2217 |
| 2218 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 2218 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
| 2219 Register scratch = scratch0(); | 2219 Register scratch = scratch0(); |
| 2220 Register function = ToRegister(instr->function()); | 2220 Register function = ToRegister(instr->function()); |
| 2221 Register result = ToRegister(instr->result()); | 2221 Register result = ToRegister(instr->result()); |
| 2222 | 2222 |
| 2223 // Check that the function really is a function. Load map into the | 2223 // Check that the function really is a function. Load map into the |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2334 | 2334 |
| 2335 // Load the result. | 2335 // Load the result. |
| 2336 __ ldrb(result, MemOperand(external_pointer, key)); | 2336 __ ldrb(result, MemOperand(external_pointer, key)); |
| 2337 } | 2337 } |
| 2338 | 2338 |
| 2339 | 2339 |
| 2340 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 2340 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
| 2341 ASSERT(ToRegister(instr->object()).is(r1)); | 2341 ASSERT(ToRegister(instr->object()).is(r1)); |
| 2342 ASSERT(ToRegister(instr->key()).is(r0)); | 2342 ASSERT(ToRegister(instr->key()).is(r0)); |
| 2343 | 2343 |
| 2344 Handle<Code> ic(isolate()->builtins()->builtin( | 2344 Handle<Code> ic = |
| 2345 Builtins::KeyedLoadIC_Initialize)); | 2345 Builtins::builtin(Builtins::KeyedLoadIC_Initialize, isolate()); |
| 2346 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2346 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2347 } | 2347 } |
| 2348 | 2348 |
| 2349 | 2349 |
| 2350 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 2350 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
| 2351 Register scratch = scratch0(); | 2351 Register scratch = scratch0(); |
| 2352 Register result = ToRegister(instr->result()); | 2352 Register result = ToRegister(instr->result()); |
| 2353 | 2353 |
| 2354 // Check if the calling frame is an arguments adaptor frame. | 2354 // Check if the calling frame is an arguments adaptor frame. |
| 2355 Label done, adapted; | 2355 Label done, adapted; |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2901 ASSERT(ToRegister(instr->result()).is(r0)); | 2901 ASSERT(ToRegister(instr->result()).is(r0)); |
| 2902 __ mov(r1, Operand(instr->target())); | 2902 __ mov(r1, Operand(instr->target())); |
| 2903 CallKnownFunction(instr->target(), instr->arity(), instr); | 2903 CallKnownFunction(instr->target(), instr->arity(), instr); |
| 2904 } | 2904 } |
| 2905 | 2905 |
| 2906 | 2906 |
| 2907 void LCodeGen::DoCallNew(LCallNew* instr) { | 2907 void LCodeGen::DoCallNew(LCallNew* instr) { |
| 2908 ASSERT(ToRegister(instr->InputAt(0)).is(r1)); | 2908 ASSERT(ToRegister(instr->InputAt(0)).is(r1)); |
| 2909 ASSERT(ToRegister(instr->result()).is(r0)); | 2909 ASSERT(ToRegister(instr->result()).is(r0)); |
| 2910 | 2910 |
| 2911 Handle<Code> builtin(isolate()->builtins()->builtin( | 2911 Handle<Code> builtin = |
| 2912 Builtins::JSConstructCall)); | 2912 Builtins::builtin(Builtins::JSConstructCall, isolate()); |
| 2913 __ mov(r0, Operand(instr->arity())); | 2913 __ mov(r0, Operand(instr->arity())); |
| 2914 CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr); | 2914 CallCode(builtin, RelocInfo::CONSTRUCT_CALL, instr); |
| 2915 } | 2915 } |
| 2916 | 2916 |
| 2917 | 2917 |
| 2918 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 2918 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
| 2919 CallRuntime(instr->function(), instr->arity(), instr); | 2919 CallRuntime(instr->function(), instr->arity(), instr); |
| 2920 } | 2920 } |
| 2921 | 2921 |
| 2922 | 2922 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2951 } | 2951 } |
| 2952 } | 2952 } |
| 2953 | 2953 |
| 2954 | 2954 |
| 2955 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 2955 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
| 2956 ASSERT(ToRegister(instr->object()).is(r1)); | 2956 ASSERT(ToRegister(instr->object()).is(r1)); |
| 2957 ASSERT(ToRegister(instr->value()).is(r0)); | 2957 ASSERT(ToRegister(instr->value()).is(r0)); |
| 2958 | 2958 |
| 2959 // Name is always in r2. | 2959 // Name is always in r2. |
| 2960 __ mov(r2, Operand(instr->name())); | 2960 __ mov(r2, Operand(instr->name())); |
| 2961 Handle<Code> ic(isolate()->builtins()->builtin( | 2961 Builtins::Name builtin = info_->is_strict() |
| 2962 info_->is_strict() ? Builtins::StoreIC_Initialize_Strict | 2962 ? Builtins::StoreIC_Initialize_Strict |
| 2963 : Builtins::StoreIC_Initialize)); | 2963 : Builtins::StoreIC_Initialize; |
| 2964 Handle<Code> ic = Builtins::builtin(builtin, isolate()); |
| 2964 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2965 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2965 } | 2966 } |
| 2966 | 2967 |
| 2967 | 2968 |
| 2968 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 2969 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
| 2969 __ cmp(ToRegister(instr->index()), ToRegister(instr->length())); | 2970 __ cmp(ToRegister(instr->index()), ToRegister(instr->length())); |
| 2970 DeoptimizeIf(hs, instr->environment()); | 2971 DeoptimizeIf(hs, instr->environment()); |
| 2971 } | 2972 } |
| 2972 | 2973 |
| 2973 | 2974 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3006 __ Usat(value, 8, Operand(value)); | 3007 __ Usat(value, 8, Operand(value)); |
| 3007 __ strb(value, MemOperand(external_pointer, key, LSL, 0)); | 3008 __ strb(value, MemOperand(external_pointer, key, LSL, 0)); |
| 3008 } | 3009 } |
| 3009 | 3010 |
| 3010 | 3011 |
| 3011 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 3012 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
| 3012 ASSERT(ToRegister(instr->object()).is(r2)); | 3013 ASSERT(ToRegister(instr->object()).is(r2)); |
| 3013 ASSERT(ToRegister(instr->key()).is(r1)); | 3014 ASSERT(ToRegister(instr->key()).is(r1)); |
| 3014 ASSERT(ToRegister(instr->value()).is(r0)); | 3015 ASSERT(ToRegister(instr->value()).is(r0)); |
| 3015 | 3016 |
| 3016 Handle<Code> ic(isolate()->builtins()->builtin( | 3017 Builtins::Name builtin = info_->is_strict() |
| 3017 info_->is_strict() ? Builtins::KeyedStoreIC_Initialize_Strict | 3018 ? Builtins::KeyedStoreIC_Initialize_Strict |
| 3018 : Builtins::KeyedStoreIC_Initialize)); | 3019 : Builtins::KeyedStoreIC_Initialize; |
| 3020 Handle<Code> ic = Builtins::builtin(builtin, isolate()); |
| 3019 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3021 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3020 } | 3022 } |
| 3021 | 3023 |
| 3022 | 3024 |
| 3023 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { | 3025 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { |
| 3024 class DeferredStringCharCodeAt: public LDeferredCode { | 3026 class DeferredStringCharCodeAt: public LDeferredCode { |
| 3025 public: | 3027 public: |
| 3026 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) | 3028 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) |
| 3027 : LDeferredCode(codegen), instr_(instr) { } | 3029 : LDeferredCode(codegen), instr_(instr) { } |
| 3028 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } | 3030 virtual void Generate() { codegen()->DoDeferredStringCharCodeAt(instr_); } |
| (...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4007 ASSERT(!environment->HasBeenRegistered()); | 4009 ASSERT(!environment->HasBeenRegistered()); |
| 4008 RegisterEnvironmentForDeoptimization(environment); | 4010 RegisterEnvironmentForDeoptimization(environment); |
| 4009 ASSERT(osr_pc_offset_ == -1); | 4011 ASSERT(osr_pc_offset_ == -1); |
| 4010 osr_pc_offset_ = masm()->pc_offset(); | 4012 osr_pc_offset_ = masm()->pc_offset(); |
| 4011 } | 4013 } |
| 4012 | 4014 |
| 4013 | 4015 |
| 4014 #undef __ | 4016 #undef __ |
| 4015 | 4017 |
| 4016 } } // namespace v8::internal | 4018 } } // namespace v8::internal |
| OLD | NEW |