| 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/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 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2056 } | 2056 } |
| 2057 | 2057 |
| 2058 | 2058 |
| 2059 void CodeGenerator::AssembleJumpTable(Label** targets, size_t target_count) { | 2059 void CodeGenerator::AssembleJumpTable(Label** targets, size_t target_count) { |
| 2060 for (size_t index = 0; index < target_count; ++index) { | 2060 for (size_t index = 0; index < target_count; ++index) { |
| 2061 __ emit_label_addr(targets[index]); | 2061 __ emit_label_addr(targets[index]); |
| 2062 } | 2062 } |
| 2063 } | 2063 } |
| 2064 | 2064 |
| 2065 | 2065 |
| 2066 void CodeGenerator::AddNopForSmiCodeInlining() { | |
| 2067 // We do not insert nops for inlined Smi code. | |
| 2068 } | |
| 2069 | |
| 2070 | |
| 2071 void CodeGenerator::EnsureSpaceForLazyDeopt() { | 2066 void CodeGenerator::EnsureSpaceForLazyDeopt() { |
| 2072 if (!info()->ShouldEnsureSpaceForLazyDeopt()) { | 2067 if (!info()->ShouldEnsureSpaceForLazyDeopt()) { |
| 2073 return; | 2068 return; |
| 2074 } | 2069 } |
| 2075 | 2070 |
| 2076 int space_needed = Deoptimizer::patch_size(); | 2071 int space_needed = Deoptimizer::patch_size(); |
| 2077 // Ensure that we have enough space after the previous lazy-bailout | 2072 // Ensure that we have enough space after the previous lazy-bailout |
| 2078 // instruction for patching the code here. | 2073 // instruction for patching the code here. |
| 2079 int current_pc = masm()->pc_offset(); | 2074 int current_pc = masm()->pc_offset(); |
| 2080 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 2075 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
| 2081 // Block tramoline pool emission for duration of padding. | 2076 // Block tramoline pool emission for duration of padding. |
| 2082 v8::internal::Assembler::BlockTrampolinePoolScope block_trampoline_pool( | 2077 v8::internal::Assembler::BlockTrampolinePoolScope block_trampoline_pool( |
| 2083 masm()); | 2078 masm()); |
| 2084 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2079 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 2085 DCHECK_EQ(0, padding_size % v8::internal::Assembler::kInstrSize); | 2080 DCHECK_EQ(0, padding_size % v8::internal::Assembler::kInstrSize); |
| 2086 while (padding_size > 0) { | 2081 while (padding_size > 0) { |
| 2087 __ nop(); | 2082 __ nop(); |
| 2088 padding_size -= v8::internal::Assembler::kInstrSize; | 2083 padding_size -= v8::internal::Assembler::kInstrSize; |
| 2089 } | 2084 } |
| 2090 } | 2085 } |
| 2091 } | 2086 } |
| 2092 | 2087 |
| 2093 #undef __ | 2088 #undef __ |
| 2094 | 2089 |
| 2095 } // namespace compiler | 2090 } // namespace compiler |
| 2096 } // namespace internal | 2091 } // namespace internal |
| 2097 } // namespace v8 | 2092 } // namespace v8 |
| OLD | NEW |