OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/pipeline.h" | 9 #include "src/compiler/pipeline.h" |
10 | 10 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 *offset_return = JavaScriptFrameConstants::kFunctionOffset; | 213 *offset_return = JavaScriptFrameConstants::kFunctionOffset; |
214 return true; | 214 return true; |
215 } | 215 } |
216 } | 216 } |
217 return false; | 217 return false; |
218 } | 218 } |
219 | 219 |
220 | 220 |
221 bool CodeGenerator::IsMaterializableFromRoot( | 221 bool CodeGenerator::IsMaterializableFromRoot( |
222 Handle<HeapObject> object, Heap::RootListIndex* index_return) { | 222 Handle<HeapObject> object, Heap::RootListIndex* index_return) { |
223 if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) { | 223 Heap::RootListIndex index; |
224 return isolate()->heap()->GetRootListIndex(object, index_return); | 224 if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall() && |
| 225 isolate()->heap()->GetRootListIndex(*object, &index) && |
| 226 !Heap::RootCanBeWrittenAfterInitialization(index)) { |
| 227 *index_return = index; |
| 228 return true; |
225 } | 229 } |
226 return false; | 230 return false; |
227 } | 231 } |
228 | 232 |
229 | 233 |
230 void CodeGenerator::AssembleInstruction(Instruction* instr) { | 234 void CodeGenerator::AssembleInstruction(Instruction* instr) { |
231 AssembleGaps(instr); | 235 AssembleGaps(instr); |
232 AssembleSourcePosition(instr); | 236 AssembleSourcePosition(instr); |
233 // Assemble architecture-specific code for the instruction. | 237 // Assemble architecture-specific code for the instruction. |
234 AssembleArchInstruction(instr); | 238 AssembleArchInstruction(instr); |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 : masm_(gen->masm()), next_(gen->ools_) { | 686 : masm_(gen->masm()), next_(gen->ools_) { |
683 gen->ools_ = this; | 687 gen->ools_ = this; |
684 } | 688 } |
685 | 689 |
686 | 690 |
687 OutOfLineCode::~OutOfLineCode() {} | 691 OutOfLineCode::~OutOfLineCode() {} |
688 | 692 |
689 } // namespace compiler | 693 } // namespace compiler |
690 } // namespace internal | 694 } // namespace internal |
691 } // namespace v8 | 695 } // namespace v8 |
OLD | NEW |