OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 2867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2878 // A Smi is not instance of anything. | 2878 // A Smi is not instance of anything. |
2879 __ JumpIfSmi(object, &false_result); | 2879 __ JumpIfSmi(object, &false_result); |
2880 | 2880 |
2881 // This is the inlined call site instanceof cache. The two occurences of the | 2881 // This is the inlined call site instanceof cache. The two occurences of the |
2882 // hole value will be patched to the last map/result pair generated by the | 2882 // hole value will be patched to the last map/result pair generated by the |
2883 // instanceof stub. | 2883 // instanceof stub. |
2884 Label cache_miss; | 2884 Label cache_miss; |
2885 Register map = temp; | 2885 Register map = temp; |
2886 __ LoadP(map, FieldMemOperand(object, HeapObject::kMapOffset)); | 2886 __ LoadP(map, FieldMemOperand(object, HeapObject::kMapOffset)); |
2887 { | 2887 { |
2888 // Block constant pool emission to ensure the positions of instructions are | 2888 // Block trampoline emission to ensure the positions of instructions are |
2889 // as expected by the patcher. See InstanceofStub::Generate(). | 2889 // as expected by the patcher. See InstanceofStub::Generate(). |
2890 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 2890 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
2891 __ bind(deferred->map_check()); // Label for calculating code patching. | 2891 __ bind(deferred->map_check()); // Label for calculating code patching. |
2892 // We use Factory::the_hole_value() on purpose instead of loading from the | 2892 // We use Factory::the_hole_value() on purpose instead of loading from the |
2893 // root array to force relocation to be able to later patch with | 2893 // root array to force relocation to be able to later patch with |
2894 // the cached map. | 2894 // the cached map. |
2895 Handle<Cell> cell = factory()->NewCell(factory()->the_hole_value()); | 2895 Handle<Cell> cell = factory()->NewCell(factory()->the_hole_value()); |
2896 __ mov(ip, Operand(cell)); | 2896 __ mov(ip, Operand(cell)); |
2897 __ LoadP(ip, FieldMemOperand(ip, Cell::kValueOffset)); | 2897 __ LoadP(ip, FieldMemOperand(ip, Cell::kValueOffset)); |
2898 __ cmp(map, ip); | 2898 __ cmp(map, ip); |
2899 __ bne(&cache_miss); | 2899 __ bc_short(ne, &cache_miss); |
2900 // We use Factory::the_hole_value() on purpose instead of loading from the | 2900 // We use Factory::the_hole_value() on purpose instead of loading from the |
2901 // root array to force relocation to be able to later patch | 2901 // root array to force relocation to be able to later patch |
2902 // with true or false. | 2902 // with true or false. |
2903 __ mov(result, Operand(factory()->the_hole_value())); | 2903 __ mov(result, Operand(factory()->the_hole_value())); |
2904 } | 2904 } |
2905 __ b(&done); | 2905 __ b(&done); |
2906 | 2906 |
2907 // The inlined call site cache did not match. Check null and string before | 2907 // The inlined call site cache did not match. Check null and string before |
2908 // calling the deferred code. | 2908 // calling the deferred code. |
2909 __ bind(&cache_miss); | 2909 __ bind(&cache_miss); |
(...skipping 3291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6201 __ Push(scope_info); | 6201 __ Push(scope_info); |
6202 __ push(ToRegister(instr->function())); | 6202 __ push(ToRegister(instr->function())); |
6203 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6203 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6204 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6204 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6205 } | 6205 } |
6206 | 6206 |
6207 | 6207 |
6208 #undef __ | 6208 #undef __ |
6209 } | 6209 } |
6210 } // namespace v8::internal | 6210 } // namespace v8::internal |
OLD | NEW |