OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2823 __ ldr(map, FieldMemOperand(object, HeapObject::kMapOffset)); | 2823 __ ldr(map, FieldMemOperand(object, HeapObject::kMapOffset)); |
2824 { | 2824 { |
2825 // Block constant pool emission to ensure the positions of instructions are | 2825 // Block constant pool emission to ensure the positions of instructions are |
2826 // as expected by the patcher. See InstanceofStub::Generate(). | 2826 // as expected by the patcher. See InstanceofStub::Generate(). |
2827 Assembler::BlockConstPoolScope block_const_pool(masm()); | 2827 Assembler::BlockConstPoolScope block_const_pool(masm()); |
2828 __ bind(deferred->map_check()); // Label for calculating code patching. | 2828 __ bind(deferred->map_check()); // Label for calculating code patching. |
2829 // We use Factory::the_hole_value() on purpose instead of loading from the | 2829 // We use Factory::the_hole_value() on purpose instead of loading from the |
2830 // root array to force relocation to be able to later patch with | 2830 // root array to force relocation to be able to later patch with |
2831 // the cached map. | 2831 // the cached map. |
2832 PredictableCodeSizeScope predictable(masm_, 5 * Assembler::kInstrSize); | 2832 PredictableCodeSizeScope predictable(masm_, 5 * Assembler::kInstrSize); |
2833 Handle<JSGlobalPropertyCell> cell = | 2833 Handle<Cell> cell = factory()->NewCell(factory()->the_hole_value()); |
2834 factory()->NewJSGlobalPropertyCell(factory()->the_hole_value()); | |
2835 __ mov(ip, Operand(Handle<Object>(cell))); | 2834 __ mov(ip, Operand(Handle<Object>(cell))); |
2836 __ ldr(ip, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); | 2835 __ ldr(ip, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); |
2837 __ cmp(map, Operand(ip)); | 2836 __ cmp(map, Operand(ip)); |
2838 __ b(ne, &cache_miss); | 2837 __ b(ne, &cache_miss); |
2839 // We use Factory::the_hole_value() on purpose instead of loading from the | 2838 // We use Factory::the_hole_value() on purpose instead of loading from the |
2840 // root array to force relocation to be able to later patch | 2839 // root array to force relocation to be able to later patch |
2841 // with true or false. | 2840 // with true or false. |
2842 __ mov(result, Operand(factory()->the_hole_value())); | 2841 __ mov(result, Operand(factory()->the_hole_value())); |
2843 } | 2842 } |
2844 __ b(&done); | 2843 __ b(&done); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2986 | 2985 |
2987 if (no_frame_start != -1) { | 2986 if (no_frame_start != -1) { |
2988 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | 2987 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
2989 } | 2988 } |
2990 } | 2989 } |
2991 | 2990 |
2992 | 2991 |
2993 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { | 2992 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { |
2994 Register result = ToRegister(instr->result()); | 2993 Register result = ToRegister(instr->result()); |
2995 __ mov(ip, Operand(Handle<Object>(instr->hydrogen()->cell()))); | 2994 __ mov(ip, Operand(Handle<Object>(instr->hydrogen()->cell()))); |
2996 __ ldr(result, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); | 2995 __ ldr(result, FieldMemOperand(ip, Cell::kValueOffset)); |
2997 if (instr->hydrogen()->RequiresHoleCheck()) { | 2996 if (instr->hydrogen()->RequiresHoleCheck()) { |
2998 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 2997 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
2999 __ cmp(result, ip); | 2998 __ cmp(result, ip); |
3000 DeoptimizeIf(eq, instr->environment()); | 2999 DeoptimizeIf(eq, instr->environment()); |
3001 } | 3000 } |
3002 } | 3001 } |
3003 | 3002 |
3004 | 3003 |
3005 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 3004 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
3006 ASSERT(ToRegister(instr->global_object()).is(r0)); | 3005 ASSERT(ToRegister(instr->global_object()).is(r0)); |
(...skipping 14 matching lines...) Expand all Loading... |
3021 // Load the cell. | 3020 // Load the cell. |
3022 __ mov(cell, Operand(instr->hydrogen()->cell())); | 3021 __ mov(cell, Operand(instr->hydrogen()->cell())); |
3023 | 3022 |
3024 // If the cell we are storing to contains the hole it could have | 3023 // If the cell we are storing to contains the hole it could have |
3025 // been deleted from the property dictionary. In that case, we need | 3024 // been deleted from the property dictionary. In that case, we need |
3026 // to update the property details in the property dictionary to mark | 3025 // to update the property details in the property dictionary to mark |
3027 // it as no longer deleted. | 3026 // it as no longer deleted. |
3028 if (instr->hydrogen()->RequiresHoleCheck()) { | 3027 if (instr->hydrogen()->RequiresHoleCheck()) { |
3029 // We use a temp to check the payload (CompareRoot might clobber ip). | 3028 // We use a temp to check the payload (CompareRoot might clobber ip). |
3030 Register payload = ToRegister(instr->temp()); | 3029 Register payload = ToRegister(instr->temp()); |
3031 __ ldr(payload, FieldMemOperand(cell, JSGlobalPropertyCell::kValueOffset)); | 3030 __ ldr(payload, FieldMemOperand(cell, Cell::kValueOffset)); |
3032 __ CompareRoot(payload, Heap::kTheHoleValueRootIndex); | 3031 __ CompareRoot(payload, Heap::kTheHoleValueRootIndex); |
3033 DeoptimizeIf(eq, instr->environment()); | 3032 DeoptimizeIf(eq, instr->environment()); |
3034 } | 3033 } |
3035 | 3034 |
3036 // Store the value. | 3035 // Store the value. |
3037 __ str(value, FieldMemOperand(cell, JSGlobalPropertyCell::kValueOffset)); | 3036 __ str(value, FieldMemOperand(cell, Cell::kValueOffset)); |
3038 // Cells are always rescanned, so no write barrier here. | 3037 // Cells are always rescanned, so no write barrier here. |
3039 } | 3038 } |
3040 | 3039 |
3041 | 3040 |
3042 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { | 3041 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { |
3043 ASSERT(ToRegister(instr->global_object()).is(r1)); | 3042 ASSERT(ToRegister(instr->global_object()).is(r1)); |
3044 ASSERT(ToRegister(instr->value()).is(r0)); | 3043 ASSERT(ToRegister(instr->value()).is(r0)); |
3045 | 3044 |
3046 __ mov(r2, Operand(instr->name())); | 3045 __ mov(r2, Operand(instr->name())); |
3047 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) | 3046 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) |
(...skipping 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5297 } | 5296 } |
5298 } | 5297 } |
5299 | 5298 |
5300 | 5299 |
5301 void LCodeGen::DoCheckFunction(LCheckFunction* instr) { | 5300 void LCodeGen::DoCheckFunction(LCheckFunction* instr) { |
5302 Register reg = ToRegister(instr->value()); | 5301 Register reg = ToRegister(instr->value()); |
5303 Handle<JSFunction> target = instr->hydrogen()->target(); | 5302 Handle<JSFunction> target = instr->hydrogen()->target(); |
5304 AllowDeferredHandleDereference smi_check; | 5303 AllowDeferredHandleDereference smi_check; |
5305 if (isolate()->heap()->InNewSpace(*target)) { | 5304 if (isolate()->heap()->InNewSpace(*target)) { |
5306 Register reg = ToRegister(instr->value()); | 5305 Register reg = ToRegister(instr->value()); |
5307 Handle<JSGlobalPropertyCell> cell = | 5306 Handle<Cell> cell = isolate()->factory()->NewJSGlobalPropertyCell(target); |
5308 isolate()->factory()->NewJSGlobalPropertyCell(target); | |
5309 __ mov(ip, Operand(Handle<Object>(cell))); | 5307 __ mov(ip, Operand(Handle<Object>(cell))); |
5310 __ ldr(ip, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); | 5308 __ ldr(ip, FieldMemOperand(ip, Cell::kValueOffset)); |
5311 __ cmp(reg, ip); | 5309 __ cmp(reg, ip); |
5312 } else { | 5310 } else { |
5313 __ cmp(reg, Operand(target)); | 5311 __ cmp(reg, Operand(target)); |
5314 } | 5312 } |
5315 DeoptimizeIf(ne, instr->environment()); | 5313 DeoptimizeIf(ne, instr->environment()); |
5316 } | 5314 } |
5317 | 5315 |
5318 | 5316 |
5319 void LCodeGen::DoCheckMapCommon(Register map_reg, | 5317 void LCodeGen::DoCheckMapCommon(Register map_reg, |
5320 Handle<Map> map, | 5318 Handle<Map> map, |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5932 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5930 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5933 __ ldr(result, FieldMemOperand(scratch, | 5931 __ ldr(result, FieldMemOperand(scratch, |
5934 FixedArray::kHeaderSize - kPointerSize)); | 5932 FixedArray::kHeaderSize - kPointerSize)); |
5935 __ bind(&done); | 5933 __ bind(&done); |
5936 } | 5934 } |
5937 | 5935 |
5938 | 5936 |
5939 #undef __ | 5937 #undef __ |
5940 | 5938 |
5941 } } // namespace v8::internal | 5939 } } // namespace v8::internal |
OLD | NEW |