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

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

Issue 2033423002: [builtins] Turn LoadIC_Miss and LoadIC_Slow builtins to TurboFan code stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@load-ic-stub-tf
Patch Set: Created 4 years, 6 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
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 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 10
(...skipping 17 matching lines...) Expand all
28 28
29 29
30 Handle<Code> PropertyAccessCompiler::GetCodeWithFlags(Code::Flags flags, 30 Handle<Code> PropertyAccessCompiler::GetCodeWithFlags(Code::Flags flags,
31 Handle<Name> name) { 31 Handle<Name> name) {
32 return (FLAG_print_code_stubs && !name.is_null() && name->IsString()) 32 return (FLAG_print_code_stubs && !name.is_null() && name->IsString())
33 ? GetCodeWithFlags(flags, 33 ? GetCodeWithFlags(flags,
34 Handle<String>::cast(name)->ToCString().get()) 34 Handle<String>::cast(name)->ToCString().get())
35 : GetCodeWithFlags(flags, NULL); 35 : GetCodeWithFlags(flags, NULL);
36 } 36 }
37 37
38 namespace {
38 39
39 void PropertyAccessCompiler::TailCallBuiltin(MacroAssembler* masm, 40 Handle<Code> MissHandler(Isolate* isolate, Code::Kind kind) {
40 Builtins::Name name) { 41 switch (kind) {
41 Handle<Code> code(masm->isolate()->builtins()->builtin(name)); 42 case Code::LOAD_IC: {
43 LoadICMissStub stub(isolate);
44 return stub.GetCode();
45 }
46 case Code::STORE_IC:
47 return isolate->builtins()->StoreIC_Miss();
48 case Code::KEYED_LOAD_IC:
49 return isolate->builtins()->KeyedLoadIC_Miss();
50 case Code::KEYED_STORE_IC:
51 return isolate->builtins()->KeyedStoreIC_Miss();
52 default:
53 UNREACHABLE();
54 }
55 LoadICMissStub stub(isolate);
56 return stub.GetCode();
57 }
58
59 } // namespace
60
61 void PropertyAccessCompiler::TailCallMissHandler(MacroAssembler* masm,
62 Code::Kind kind) {
63 Handle<Code> code = MissHandler(masm->isolate(), kind);
42 GenerateTailCall(masm, code); 64 GenerateTailCall(masm, code);
43 } 65 }
44 66
45
46 Register* PropertyAccessCompiler::GetCallingConvention(Code::Kind kind) { 67 Register* PropertyAccessCompiler::GetCallingConvention(Code::Kind kind) {
47 if (kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC) { 68 if (kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC) {
48 return load_calling_convention(); 69 return load_calling_convention();
49 } 70 }
50 DCHECK(kind == Code::STORE_IC || kind == Code::KEYED_STORE_IC); 71 DCHECK(kind == Code::STORE_IC || kind == Code::KEYED_STORE_IC);
51 return store_calling_convention(); 72 return store_calling_convention();
52 } 73 }
53 74
54 75
55 Register PropertyAccessCompiler::slot() const { 76 Register PropertyAccessCompiler::slot() const {
56 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) { 77 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) {
57 return LoadDescriptor::SlotRegister(); 78 return LoadDescriptor::SlotRegister();
58 } 79 }
59 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC); 80 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC);
60 return VectorStoreICDescriptor::SlotRegister(); 81 return VectorStoreICDescriptor::SlotRegister();
61 } 82 }
62 83
63 84
64 Register PropertyAccessCompiler::vector() const { 85 Register PropertyAccessCompiler::vector() const {
65 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) { 86 if (kind() == Code::LOAD_IC || kind() == Code::KEYED_LOAD_IC) {
66 return LoadWithVectorDescriptor::VectorRegister(); 87 return LoadWithVectorDescriptor::VectorRegister();
67 } 88 }
68 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC); 89 DCHECK(kind() == Code::STORE_IC || kind() == Code::KEYED_STORE_IC);
69 return VectorStoreICDescriptor::VectorRegister(); 90 return VectorStoreICDescriptor::VectorRegister();
70 } 91 }
71 } // namespace internal 92 } // namespace internal
72 } // namespace v8 93 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698