| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) { |
| 224 return isolate()->heap()->GetRootListIndex(object, index_return); | 224 // Check if {object} is one of the non-smi roots that cannot be written |
| 225 // after initialization. |
| 226 for (int i = 0; i < Heap::kSmiRootsStart; ++i) { |
| 227 Heap::RootListIndex const index = static_cast<Heap::RootListIndex>(i); |
| 228 if (!Heap::RootCanBeWrittenAfterInitialization(index) && |
| 229 *object == isolate()->heap()->root(index)) { |
| 230 *index_return = index; |
| 231 return true; |
| 232 } |
| 233 } |
| 225 } | 234 } |
| 226 return false; | 235 return false; |
| 227 } | 236 } |
| 228 | 237 |
| 229 | 238 |
| 230 void CodeGenerator::AssembleInstruction(Instruction* instr) { | 239 void CodeGenerator::AssembleInstruction(Instruction* instr) { |
| 231 AssembleGaps(instr); | 240 AssembleGaps(instr); |
| 232 AssembleSourcePosition(instr); | 241 AssembleSourcePosition(instr); |
| 233 // Assemble architecture-specific code for the instruction. | 242 // Assemble architecture-specific code for the instruction. |
| 234 AssembleArchInstruction(instr); | 243 AssembleArchInstruction(instr); |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 : masm_(gen->masm()), next_(gen->ools_) { | 691 : masm_(gen->masm()), next_(gen->ools_) { |
| 683 gen->ools_ = this; | 692 gen->ools_ = this; |
| 684 } | 693 } |
| 685 | 694 |
| 686 | 695 |
| 687 OutOfLineCode::~OutOfLineCode() {} | 696 OutOfLineCode::~OutOfLineCode() {} |
| 688 | 697 |
| 689 } // namespace compiler | 698 } // namespace compiler |
| 690 } // namespace internal | 699 } // namespace internal |
| 691 } // namespace v8 | 700 } // namespace v8 |
| OLD | NEW |