OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 2862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2873 __ lw(result, FieldMemOperand(at, Cell::kValueOffset)); | 2873 __ lw(result, FieldMemOperand(at, Cell::kValueOffset)); |
2874 if (instr->hydrogen()->RequiresHoleCheck()) { | 2874 if (instr->hydrogen()->RequiresHoleCheck()) { |
2875 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 2875 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
2876 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); | 2876 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); |
2877 } | 2877 } |
2878 } | 2878 } |
2879 | 2879 |
2880 | 2880 |
2881 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2881 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2882 ASSERT(ToRegister(instr->context()).is(cp)); | 2882 ASSERT(ToRegister(instr->context()).is(cp)); |
2883 ASSERT(ToRegister(instr->global_object()).is(a0)); | 2883 ASSERT(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); |
2884 ASSERT(ToRegister(instr->result()).is(v0)); | 2884 ASSERT(ToRegister(instr->result()).is(v0)); |
2885 | 2885 |
2886 __ li(a2, Operand(instr->name())); | 2886 __ li(LoadIC::NameRegister(), Operand(instr->name())); |
2887 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2887 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2888 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); | 2888 Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); |
2889 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2889 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2890 } | 2890 } |
2891 | 2891 |
2892 | 2892 |
2893 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 2893 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
2894 Register value = ToRegister(instr->value()); | 2894 Register value = ToRegister(instr->value()); |
2895 Register cell = scratch0(); | 2895 Register cell = scratch0(); |
2896 | 2896 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2997 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 2997 __ lw(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
2998 object = result; | 2998 object = result; |
2999 } | 2999 } |
3000 MemOperand operand = FieldMemOperand(object, offset); | 3000 MemOperand operand = FieldMemOperand(object, offset); |
3001 __ Load(result, operand, access.representation()); | 3001 __ Load(result, operand, access.representation()); |
3002 } | 3002 } |
3003 | 3003 |
3004 | 3004 |
3005 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3005 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
3006 ASSERT(ToRegister(instr->context()).is(cp)); | 3006 ASSERT(ToRegister(instr->context()).is(cp)); |
3007 ASSERT(ToRegister(instr->object()).is(a0)); | 3007 ASSERT(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); |
3008 ASSERT(ToRegister(instr->result()).is(v0)); | 3008 ASSERT(ToRegister(instr->result()).is(v0)); |
3009 | 3009 |
3010 // Name is always in a2. | 3010 // Name is always in a2. |
3011 __ li(a2, Operand(instr->name())); | 3011 __ li(LoadIC::NameRegister(), Operand(instr->name())); |
3012 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); | 3012 Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); |
3013 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3013 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3014 } | 3014 } |
3015 | 3015 |
3016 | 3016 |
3017 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3017 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
3018 Register scratch = scratch0(); | 3018 Register scratch = scratch0(); |
3019 Register function = ToRegister(instr->function()); | 3019 Register function = ToRegister(instr->function()); |
3020 Register result = ToRegister(instr->result()); | 3020 Register result = ToRegister(instr->result()); |
3021 | 3021 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3320 ASSERT_EQ(-1, shift_size); | 3320 ASSERT_EQ(-1, shift_size); |
3321 __ sra(scratch0(), key, 1); | 3321 __ sra(scratch0(), key, 1); |
3322 __ Addu(scratch0(), base, scratch0()); | 3322 __ Addu(scratch0(), base, scratch0()); |
3323 return MemOperand(scratch0(), base_offset); | 3323 return MemOperand(scratch0(), base_offset); |
3324 } | 3324 } |
3325 } | 3325 } |
3326 | 3326 |
3327 | 3327 |
3328 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3328 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3329 ASSERT(ToRegister(instr->context()).is(cp)); | 3329 ASSERT(ToRegister(instr->context()).is(cp)); |
3330 ASSERT(ToRegister(instr->object()).is(a1)); | 3330 ASSERT(ToRegister(instr->object()).is(KeyedLoadIC::ReceiverRegister())); |
3331 ASSERT(ToRegister(instr->key()).is(a0)); | 3331 ASSERT(ToRegister(instr->key()).is(KeyedLoadIC::NameRegister())); |
3332 | 3332 |
3333 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 3333 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
3334 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3334 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3335 } | 3335 } |
3336 | 3336 |
3337 | 3337 |
3338 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3338 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3339 Register scratch = scratch0(); | 3339 Register scratch = scratch0(); |
3340 Register temp = scratch1(); | 3340 Register temp = scratch1(); |
3341 Register result = ToRegister(instr->result()); | 3341 Register result = ToRegister(instr->result()); |
(...skipping 2542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5884 __ li(at, scope_info); | 5884 __ li(at, scope_info); |
5885 __ Push(at, ToRegister(instr->function())); | 5885 __ Push(at, ToRegister(instr->function())); |
5886 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5886 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5887 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5887 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5888 } | 5888 } |
5889 | 5889 |
5890 | 5890 |
5891 #undef __ | 5891 #undef __ |
5892 | 5892 |
5893 } } // namespace v8::internal | 5893 } } // namespace v8::internal |
OLD | NEW |