| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
| 10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
| (...skipping 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2731 Label cache_miss; | 2731 Label cache_miss; |
| 2732 Register map = temp; | 2732 Register map = temp; |
| 2733 __ ld(map, FieldMemOperand(object, HeapObject::kMapOffset)); | 2733 __ ld(map, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 2734 | 2734 |
| 2735 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 2735 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
| 2736 __ bind(deferred->map_check()); // Label for calculating code patching. | 2736 __ bind(deferred->map_check()); // Label for calculating code patching. |
| 2737 // We use Factory::the_hole_value() on purpose instead of loading from the | 2737 // We use Factory::the_hole_value() on purpose instead of loading from the |
| 2738 // root array to force relocation to be able to later patch with | 2738 // root array to force relocation to be able to later patch with |
| 2739 // the cached map. | 2739 // the cached map. |
| 2740 Handle<Cell> cell = factory()->NewCell(factory()->the_hole_value()); | 2740 Handle<Cell> cell = factory()->NewCell(factory()->the_hole_value()); |
| 2741 __ li(at, Operand(Handle<Object>(cell))); | 2741 __ li(at, Operand(cell)); |
| 2742 __ ld(at, FieldMemOperand(at, PropertyCell::kValueOffset)); | 2742 __ ld(at, FieldMemOperand(at, Cell::kValueOffset)); |
| 2743 __ BranchShort(&cache_miss, ne, map, Operand(at)); | 2743 __ BranchShort(&cache_miss, ne, map, Operand(at)); |
| 2744 // We use Factory::the_hole_value() on purpose instead of loading from the | 2744 // We use Factory::the_hole_value() on purpose instead of loading from the |
| 2745 // root array to force relocation to be able to later patch | 2745 // root array to force relocation to be able to later patch |
| 2746 // with true or false. The distance from map check has to be constant. | 2746 // with true or false. The distance from map check has to be constant. |
| 2747 __ li(result, Operand(factory()->the_hole_value())); | 2747 __ li(result, Operand(factory()->the_hole_value())); |
| 2748 __ Branch(&done); | 2748 __ Branch(&done); |
| 2749 | 2749 |
| 2750 // The inlined call site cache did not match. Check null and string before | 2750 // The inlined call site cache did not match. Check null and string before |
| 2751 // calling the deferred code. | 2751 // calling the deferred code. |
| 2752 __ bind(&cache_miss); | 2752 __ bind(&cache_miss); |
| (...skipping 2525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5278 } | 5278 } |
| 5279 | 5279 |
| 5280 | 5280 |
| 5281 void LCodeGen::DoCheckValue(LCheckValue* instr) { | 5281 void LCodeGen::DoCheckValue(LCheckValue* instr) { |
| 5282 Register reg = ToRegister(instr->value()); | 5282 Register reg = ToRegister(instr->value()); |
| 5283 Handle<HeapObject> object = instr->hydrogen()->object().handle(); | 5283 Handle<HeapObject> object = instr->hydrogen()->object().handle(); |
| 5284 AllowDeferredHandleDereference smi_check; | 5284 AllowDeferredHandleDereference smi_check; |
| 5285 if (isolate()->heap()->InNewSpace(*object)) { | 5285 if (isolate()->heap()->InNewSpace(*object)) { |
| 5286 Register reg = ToRegister(instr->value()); | 5286 Register reg = ToRegister(instr->value()); |
| 5287 Handle<Cell> cell = isolate()->factory()->NewCell(object); | 5287 Handle<Cell> cell = isolate()->factory()->NewCell(object); |
| 5288 __ li(at, Operand(Handle<Object>(cell))); | 5288 __ li(at, Operand(cell)); |
| 5289 __ ld(at, FieldMemOperand(at, Cell::kValueOffset)); | 5289 __ ld(at, FieldMemOperand(at, Cell::kValueOffset)); |
| 5290 DeoptimizeIf(ne, instr, Deoptimizer::kValueMismatch, reg, Operand(at)); | 5290 DeoptimizeIf(ne, instr, Deoptimizer::kValueMismatch, reg, Operand(at)); |
| 5291 } else { | 5291 } else { |
| 5292 DeoptimizeIf(ne, instr, Deoptimizer::kValueMismatch, reg, Operand(object)); | 5292 DeoptimizeIf(ne, instr, Deoptimizer::kValueMismatch, reg, Operand(object)); |
| 5293 } | 5293 } |
| 5294 } | 5294 } |
| 5295 | 5295 |
| 5296 | 5296 |
| 5297 void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) { | 5297 void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) { |
| 5298 { | 5298 { |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6053 __ li(at, scope_info); | 6053 __ li(at, scope_info); |
| 6054 __ Push(at, ToRegister(instr->function())); | 6054 __ Push(at, ToRegister(instr->function())); |
| 6055 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6055 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6056 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6056 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6057 } | 6057 } |
| 6058 | 6058 |
| 6059 | 6059 |
| 6060 #undef __ | 6060 #undef __ |
| 6061 | 6061 |
| 6062 } } // namespace v8::internal | 6062 } } // namespace v8::internal |
| OLD | NEW |