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 | |
8 namespace v8 { | 7 namespace v8 { |
9 namespace internal { | 8 namespace internal { |
10 | 9 |
11 | 10 |
12 Handle<Code> PropertyAccessCompiler::GetCodeWithFlags(Code::Flags flags, | 11 Handle<Code> PropertyAccessCompiler::GetCodeWithFlags(Code::Flags flags, |
13 const char* name) { | 12 const char* name) { |
14 // Create code object in the heap. | 13 // Create code object in the heap. |
15 CodeDesc desc; | 14 CodeDesc desc; |
16 masm()->GetCode(&desc); | 15 masm()->GetCode(&desc); |
17 Handle<Code> code = factory()->NewCode(desc, flags, masm()->CodeObject()); | 16 Handle<Code> code = factory()->NewCode(desc, flags, masm()->CodeObject()); |
(...skipping 17 matching lines...) Expand all Loading... |
35 : GetCodeWithFlags(flags, NULL); | 34 : GetCodeWithFlags(flags, NULL); |
36 } | 35 } |
37 | 36 |
38 | 37 |
39 void PropertyAccessCompiler::TailCallBuiltin(MacroAssembler* masm, | 38 void PropertyAccessCompiler::TailCallBuiltin(MacroAssembler* masm, |
40 Builtins::Name name) { | 39 Builtins::Name name) { |
41 Handle<Code> code(masm->isolate()->builtins()->builtin(name)); | 40 Handle<Code> code(masm->isolate()->builtins()->builtin(name)); |
42 GenerateTailCall(masm, code); | 41 GenerateTailCall(masm, code); |
43 } | 42 } |
44 | 43 |
45 | 44 Register* PropertyAccessCompiler::GetCallingConvention(Isolate* isolate, |
46 Register* PropertyAccessCompiler::GetCallingConvention(Code::Kind kind) { | 45 Code::Kind kind) { |
| 46 AccessCompilerData* data = isolate->access_compiler_data(); |
| 47 if (!data->IsInitialized()) { |
| 48 InitializePlatformSpecific(data); |
| 49 } |
47 if (kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC) { | 50 if (kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC) { |
48 return load_calling_convention(); | 51 return data->load_calling_convention(); |
49 } | 52 } |
50 DCHECK(kind == Code::STORE_IC || kind == Code::KEYED_STORE_IC); | 53 DCHECK(kind == Code::STORE_IC || kind == Code::KEYED_STORE_IC); |
51 return store_calling_convention(); | 54 return data->store_calling_convention(); |
52 } | 55 } |
53 | 56 |
54 | 57 |
55 Register PropertyAccessCompiler::slot() const { | 58 Register PropertyAccessCompiler::slot() const { |
56 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) { | 59 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) { |
57 return LoadDescriptor::SlotRegister(); | 60 return LoadDescriptor::SlotRegister(); |
58 } | 61 } |
59 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC); | 62 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC); |
60 return StoreWithVectorDescriptor::SlotRegister(); | 63 return StoreWithVectorDescriptor::SlotRegister(); |
61 } | 64 } |
62 | 65 |
63 | 66 |
64 Register PropertyAccessCompiler::vector() const { | 67 Register PropertyAccessCompiler::vector() const { |
65 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) { | 68 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) { |
66 return LoadWithVectorDescriptor::VectorRegister(); | 69 return LoadWithVectorDescriptor::VectorRegister(); |
67 } | 70 } |
68 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC); | 71 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC); |
69 return StoreWithVectorDescriptor::VectorRegister(); | 72 return StoreWithVectorDescriptor::VectorRegister(); |
70 } | 73 } |
71 } // namespace internal | 74 } // namespace internal |
72 } // namespace v8 | 75 } // namespace v8 |
OLD | NEW |