| 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/ic/access-compiler.h" | 5 #include "src/ic/access-compiler.h" |
| 6 | 6 |
| 7 | 7 |
| 8 namespace v8 { | 8 namespace v8 { |
| 9 namespace internal { | 9 namespace internal { |
| 10 | 10 |
| 11 | 11 |
| 12 Handle<Code> PropertyAccessCompiler::GetCodeWithFlags(Code::Flags flags, | 12 Handle<Code> PropertyAccessCompiler::GetCodeWithFlags(Code::Flags flags, |
| 13 const char* name) { | 13 const char* name) { |
| 14 // Create code object in the heap. | 14 // Create code object in the heap. |
| 15 CodeDesc desc; | 15 CodeDesc desc; |
| 16 masm()->GetCode(&desc); | 16 masm()->GetCode(&desc); |
| 17 Handle<Code> code = factory()->NewCode(desc, flags, masm()->CodeObject()); | 17 Handle<Code> code = factory()->NewCode(desc, flags, masm()->CodeObject()); |
| 18 if (code->IsCodeStubOrIC()) code->set_stub_key(CodeStub::NoCacheKey()); | 18 if (code->IsCodeStubOrIC()) code->set_stub_key(CodeStub::NoCacheKey()); |
| 19 #ifdef ENABLE_DISASSEMBLER | 19 #ifdef ENABLE_DISASSEMBLER |
| 20 if (FLAG_print_code_stubs) { | 20 if (FLAG_print_code_stubs) { |
| 21 OFStream os(stdout); | 21 CodeTracer::Scope trace_scope(isolate()->GetCodeTracer()); |
| 22 OFStream os(trace_scope.file()); |
| 22 code->Disassemble(name, os); | 23 code->Disassemble(name, os); |
| 23 } | 24 } |
| 24 #endif | 25 #endif |
| 25 return code; | 26 return code; |
| 26 } | 27 } |
| 27 | 28 |
| 28 | 29 |
| 29 Handle<Code> PropertyAccessCompiler::GetCodeWithFlags(Code::Flags flags, | 30 Handle<Code> PropertyAccessCompiler::GetCodeWithFlags(Code::Flags flags, |
| 30 Handle<Name> name) { | 31 Handle<Name> name) { |
| 31 return (FLAG_print_code_stubs && !name.is_null() && name->IsString()) | 32 return (FLAG_print_code_stubs && !name.is_null() && name->IsString()) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 62 | 63 |
| 63 Register PropertyAccessCompiler::vector() const { | 64 Register PropertyAccessCompiler::vector() const { |
| 64 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) { | 65 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) { |
| 65 return LoadWithVectorDescriptor::VectorRegister(); | 66 return LoadWithVectorDescriptor::VectorRegister(); |
| 66 } | 67 } |
| 67 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC); | 68 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC); |
| 68 return VectorStoreICDescriptor::VectorRegister(); | 69 return VectorStoreICDescriptor::VectorRegister(); |
| 69 } | 70 } |
| 70 } // namespace internal | 71 } // namespace internal |
| 71 } // namespace v8 | 72 } // namespace v8 |
| OLD | NEW |