Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: src/ic/access-compiler.cc

Issue 2389313002: Avoid static initializers in PropertyAccessCompiler (Closed)
Patch Set: Ports Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ic/access-compiler.h ('k') | src/ic/access-compiler-data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/ic/access-compiler.h ('k') | src/ic/access-compiler-data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698