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 2743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2754 Label cache_miss; | 2754 Label cache_miss; |
2755 Register map = temp; | 2755 Register map = temp; |
2756 __ lw(map, FieldMemOperand(object, HeapObject::kMapOffset)); | 2756 __ lw(map, FieldMemOperand(object, HeapObject::kMapOffset)); |
2757 | 2757 |
2758 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 2758 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
2759 __ bind(deferred->map_check()); // Label for calculating code patching. | 2759 __ bind(deferred->map_check()); // Label for calculating code patching. |
2760 // We use Factory::the_hole_value() on purpose instead of loading from the | 2760 // We use Factory::the_hole_value() on purpose instead of loading from the |
2761 // root array to force relocation to be able to later patch with | 2761 // root array to force relocation to be able to later patch with |
2762 // the cached map. | 2762 // the cached map. |
2763 Handle<Cell> cell = factory()->NewCell(factory()->the_hole_value()); | 2763 Handle<Cell> cell = factory()->NewCell(factory()->the_hole_value()); |
2764 __ li(at, Operand(Handle<Object>(cell))); | 2764 __ li(at, Operand(cell)); |
2765 __ lw(at, FieldMemOperand(at, PropertyCell::kValueOffset)); | 2765 __ lw(at, FieldMemOperand(at, Cell::kValueOffset)); |
2766 __ BranchShort(&cache_miss, ne, map, Operand(at)); | 2766 __ BranchShort(&cache_miss, ne, map, Operand(at)); |
2767 // We use Factory::the_hole_value() on purpose instead of loading from the | 2767 // We use Factory::the_hole_value() on purpose instead of loading from the |
2768 // root array to force relocation to be able to later patch | 2768 // root array to force relocation to be able to later patch |
2769 // with true or false. The distance from map check has to be constant. | 2769 // with true or false. The distance from map check has to be constant. |
2770 __ li(result, Operand(factory()->the_hole_value()), CONSTANT_SIZE); | 2770 __ li(result, Operand(factory()->the_hole_value()), CONSTANT_SIZE); |
2771 __ Branch(&done); | 2771 __ Branch(&done); |
2772 | 2772 |
2773 // The inlined call site cache did not match. Check null and string before | 2773 // The inlined call site cache did not match. Check null and string before |
2774 // calling the deferred code. | 2774 // calling the deferred code. |
2775 __ bind(&cache_miss); | 2775 __ bind(&cache_miss); |
(...skipping 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5242 } | 5242 } |
5243 | 5243 |
5244 | 5244 |
5245 void LCodeGen::DoCheckValue(LCheckValue* instr) { | 5245 void LCodeGen::DoCheckValue(LCheckValue* instr) { |
5246 Register reg = ToRegister(instr->value()); | 5246 Register reg = ToRegister(instr->value()); |
5247 Handle<HeapObject> object = instr->hydrogen()->object().handle(); | 5247 Handle<HeapObject> object = instr->hydrogen()->object().handle(); |
5248 AllowDeferredHandleDereference smi_check; | 5248 AllowDeferredHandleDereference smi_check; |
5249 if (isolate()->heap()->InNewSpace(*object)) { | 5249 if (isolate()->heap()->InNewSpace(*object)) { |
5250 Register reg = ToRegister(instr->value()); | 5250 Register reg = ToRegister(instr->value()); |
5251 Handle<Cell> cell = isolate()->factory()->NewCell(object); | 5251 Handle<Cell> cell = isolate()->factory()->NewCell(object); |
5252 __ li(at, Operand(Handle<Object>(cell))); | 5252 __ li(at, Operand(cell)); |
5253 __ lw(at, FieldMemOperand(at, Cell::kValueOffset)); | 5253 __ lw(at, FieldMemOperand(at, Cell::kValueOffset)); |
5254 DeoptimizeIf(ne, instr, Deoptimizer::kValueMismatch, reg, Operand(at)); | 5254 DeoptimizeIf(ne, instr, Deoptimizer::kValueMismatch, reg, Operand(at)); |
5255 } else { | 5255 } else { |
5256 DeoptimizeIf(ne, instr, Deoptimizer::kValueMismatch, reg, Operand(object)); | 5256 DeoptimizeIf(ne, instr, Deoptimizer::kValueMismatch, reg, Operand(object)); |
5257 } | 5257 } |
5258 } | 5258 } |
5259 | 5259 |
5260 | 5260 |
5261 void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) { | 5261 void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) { |
5262 { | 5262 { |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6017 __ li(at, scope_info); | 6017 __ li(at, scope_info); |
6018 __ Push(at, ToRegister(instr->function())); | 6018 __ Push(at, ToRegister(instr->function())); |
6019 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6019 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6020 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6020 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6021 } | 6021 } |
6022 | 6022 |
6023 | 6023 |
6024 #undef __ | 6024 #undef __ |
6025 | 6025 |
6026 } } // namespace v8::internal | 6026 } } // namespace v8::internal |
OLD | NEW |