OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 2076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2087 UNREACHABLE(); | 2087 UNREACHABLE(); |
2088 } | 2088 } |
2089 } | 2089 } |
2090 | 2090 |
2091 void CodeGenerator::AssembleJumpTable(Label** targets, size_t target_count) { | 2091 void CodeGenerator::AssembleJumpTable(Label** targets, size_t target_count) { |
2092 for (size_t index = 0; index < target_count; ++index) { | 2092 for (size_t index = 0; index < target_count; ++index) { |
2093 __ emit_label_addr(targets[index]); | 2093 __ emit_label_addr(targets[index]); |
2094 } | 2094 } |
2095 } | 2095 } |
2096 | 2096 |
2097 void CodeGenerator::AddNopForSmiCodeInlining() { | |
2098 // We do not insert nops for inlined Smi code. | |
2099 } | |
2100 | |
2101 void CodeGenerator::EnsureSpaceForLazyDeopt() { | 2097 void CodeGenerator::EnsureSpaceForLazyDeopt() { |
2102 if (!info()->ShouldEnsureSpaceForLazyDeopt()) { | 2098 if (!info()->ShouldEnsureSpaceForLazyDeopt()) { |
2103 return; | 2099 return; |
2104 } | 2100 } |
2105 | 2101 |
2106 int space_needed = Deoptimizer::patch_size(); | 2102 int space_needed = Deoptimizer::patch_size(); |
2107 // Ensure that we have enough space after the previous lazy-bailout | 2103 // Ensure that we have enough space after the previous lazy-bailout |
2108 // instruction for patching the code here. | 2104 // instruction for patching the code here. |
2109 int current_pc = masm()->pc_offset(); | 2105 int current_pc = masm()->pc_offset(); |
2110 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 2106 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
2111 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2107 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
2112 DCHECK_EQ(0, padding_size % 2); | 2108 DCHECK_EQ(0, padding_size % 2); |
2113 while (padding_size > 0) { | 2109 while (padding_size > 0) { |
2114 __ nop(); | 2110 __ nop(); |
2115 padding_size -= 2; | 2111 padding_size -= 2; |
2116 } | 2112 } |
2117 } | 2113 } |
2118 } | 2114 } |
2119 | 2115 |
2120 #undef __ | 2116 #undef __ |
2121 | 2117 |
2122 } // namespace compiler | 2118 } // namespace compiler |
2123 } // namespace internal | 2119 } // namespace internal |
2124 } // namespace v8 | 2120 } // namespace v8 |
OLD | NEW |