OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins/builtins.h" | 5 #include "src/builtins/builtins.h" |
6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
7 #include "src/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 typedef LoadGlobalWithVectorDescriptor Descriptor; | 42 typedef LoadGlobalWithVectorDescriptor Descriptor; |
43 | 43 |
44 Node* slot = assembler->Parameter(Descriptor::kSlot); | 44 Node* slot = assembler->Parameter(Descriptor::kSlot); |
45 Node* vector = assembler->Parameter(Descriptor::kVector); | 45 Node* vector = assembler->Parameter(Descriptor::kVector); |
46 Node* context = assembler->Parameter(Descriptor::kContext); | 46 Node* context = assembler->Parameter(Descriptor::kContext); |
47 | 47 |
48 assembler->TailCallRuntime(Runtime::kLoadGlobalIC_Miss, context, slot, | 48 assembler->TailCallRuntime(Runtime::kLoadGlobalIC_Miss, context, slot, |
49 vector); | 49 vector); |
50 } | 50 } |
51 | 51 |
52 namespace { | 52 void Builtins::Generate_LoadGlobalIC_Slow(CodeStubAssembler* assembler) { |
53 void Generate_LoadGlobalIC_Slow(CodeStubAssembler* assembler, TypeofMode mode) { | |
54 typedef compiler::Node Node; | 53 typedef compiler::Node Node; |
55 typedef LoadGlobalWithVectorDescriptor Descriptor; | 54 typedef LoadGlobalWithVectorDescriptor Descriptor; |
56 | 55 |
57 Node* slot = assembler->Parameter(Descriptor::kSlot); | 56 Node* slot = assembler->Parameter(Descriptor::kSlot); |
58 Node* vector = assembler->Parameter(Descriptor::kVector); | 57 Node* vector = assembler->Parameter(Descriptor::kVector); |
59 Node* context = assembler->Parameter(Descriptor::kContext); | 58 Node* context = assembler->Parameter(Descriptor::kContext); |
60 Node* typeof_mode = assembler->SmiConstant(Smi::FromInt(mode)); | |
61 | 59 |
62 assembler->TailCallRuntime(Runtime::kGetGlobal, context, slot, vector, | 60 assembler->TailCallRuntime(Runtime::kLoadGlobalIC_Slow, context, slot, |
63 typeof_mode); | 61 vector); |
64 } | |
65 } // anonymous namespace | |
66 | |
67 void Builtins::Generate_LoadGlobalIC_SlowInsideTypeof( | |
68 CodeStubAssembler* assembler) { | |
69 Generate_LoadGlobalIC_Slow(assembler, INSIDE_TYPEOF); | |
70 } | |
71 | |
72 void Builtins::Generate_LoadGlobalIC_SlowNotInsideTypeof( | |
73 CodeStubAssembler* assembler) { | |
74 Generate_LoadGlobalIC_Slow(assembler, NOT_INSIDE_TYPEOF); | |
75 } | 62 } |
76 | 63 |
77 void Builtins::Generate_LoadIC_Getter_ForDeopt(MacroAssembler* masm) { | 64 void Builtins::Generate_LoadIC_Getter_ForDeopt(MacroAssembler* masm) { |
78 NamedLoadHandlerCompiler::GenerateLoadViaGetterForDeopt(masm); | 65 NamedLoadHandlerCompiler::GenerateLoadViaGetterForDeopt(masm); |
79 } | 66 } |
80 | 67 |
81 void Builtins::Generate_LoadIC_Miss(CodeStubAssembler* assembler) { | 68 void Builtins::Generate_LoadIC_Miss(CodeStubAssembler* assembler) { |
82 typedef compiler::Node Node; | 69 typedef compiler::Node Node; |
83 typedef LoadWithVectorDescriptor Descriptor; | 70 typedef LoadWithVectorDescriptor Descriptor; |
84 | 71 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 void Builtins::Generate_StoreIC_SlowSloppy(CodeStubAssembler* assembler) { | 139 void Builtins::Generate_StoreIC_SlowSloppy(CodeStubAssembler* assembler) { |
153 Generate_StoreIC_Slow(assembler, SLOPPY); | 140 Generate_StoreIC_Slow(assembler, SLOPPY); |
154 } | 141 } |
155 | 142 |
156 void Builtins::Generate_StoreIC_SlowStrict(CodeStubAssembler* assembler) { | 143 void Builtins::Generate_StoreIC_SlowStrict(CodeStubAssembler* assembler) { |
157 Generate_StoreIC_Slow(assembler, STRICT); | 144 Generate_StoreIC_Slow(assembler, STRICT); |
158 } | 145 } |
159 | 146 |
160 } // namespace internal | 147 } // namespace internal |
161 } // namespace v8 | 148 } // namespace v8 |
OLD | NEW |