OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 | 6 |
| 7 #include <memory> |
| 8 |
7 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
8 #include "src/crankshaft/hydrogen.h" | 10 #include "src/crankshaft/hydrogen.h" |
9 #include "src/crankshaft/lithium.h" | 11 #include "src/crankshaft/lithium.h" |
10 #include "src/field-index.h" | 12 #include "src/field-index.h" |
11 #include "src/ic/ic.h" | 13 #include "src/ic/ic.h" |
12 | 14 |
13 namespace v8 { | 15 namespace v8 { |
14 namespace internal { | 16 namespace internal { |
15 | 17 |
16 | 18 |
(...skipping 18 matching lines...) Expand all Loading... |
35 class CodeStubGraphBuilderBase : public HGraphBuilder { | 37 class CodeStubGraphBuilderBase : public HGraphBuilder { |
36 public: | 38 public: |
37 explicit CodeStubGraphBuilderBase(CompilationInfo* info, CodeStub* code_stub) | 39 explicit CodeStubGraphBuilderBase(CompilationInfo* info, CodeStub* code_stub) |
38 : HGraphBuilder(info, code_stub->GetCallInterfaceDescriptor()), | 40 : HGraphBuilder(info, code_stub->GetCallInterfaceDescriptor()), |
39 arguments_length_(NULL), | 41 arguments_length_(NULL), |
40 info_(info), | 42 info_(info), |
41 code_stub_(code_stub), | 43 code_stub_(code_stub), |
42 descriptor_(code_stub), | 44 descriptor_(code_stub), |
43 context_(NULL) { | 45 context_(NULL) { |
44 int parameter_count = GetParameterCount(); | 46 int parameter_count = GetParameterCount(); |
45 parameters_.Reset(new HParameter*[parameter_count]); | 47 parameters_.reset(new HParameter*[parameter_count]); |
46 } | 48 } |
47 virtual bool BuildGraph(); | 49 virtual bool BuildGraph(); |
48 | 50 |
49 protected: | 51 protected: |
50 virtual HValue* BuildCodeStub() = 0; | 52 virtual HValue* BuildCodeStub() = 0; |
51 int GetParameterCount() const { return descriptor_.GetParameterCount(); } | 53 int GetParameterCount() const { return descriptor_.GetParameterCount(); } |
52 int GetRegisterParameterCount() const { | 54 int GetRegisterParameterCount() const { |
53 return descriptor_.GetRegisterParameterCount(); | 55 return descriptor_.GetRegisterParameterCount(); |
54 } | 56 } |
55 HParameter* GetParameter(int parameter) { | 57 HParameter* GetParameter(int parameter) { |
(...skipping 26 matching lines...) Expand all Loading... |
82 HValue* argument_elements, ElementsKind kind); | 84 HValue* argument_elements, ElementsKind kind); |
83 | 85 |
84 HValue* UnmappedCase(HValue* elements, HValue* key, HValue* value); | 86 HValue* UnmappedCase(HValue* elements, HValue* key, HValue* value); |
85 HValue* EmitKeyedSloppyArguments(HValue* receiver, HValue* key, | 87 HValue* EmitKeyedSloppyArguments(HValue* receiver, HValue* key, |
86 HValue* value); | 88 HValue* value); |
87 | 89 |
88 HValue* BuildToString(HValue* input, bool convert); | 90 HValue* BuildToString(HValue* input, bool convert); |
89 HValue* BuildToPrimitive(HValue* input, HValue* input_map); | 91 HValue* BuildToPrimitive(HValue* input, HValue* input_map); |
90 | 92 |
91 private: | 93 private: |
92 base::SmartArrayPointer<HParameter*> parameters_; | 94 std::unique_ptr<HParameter* []> parameters_; |
93 HValue* arguments_length_; | 95 HValue* arguments_length_; |
94 CompilationInfo* info_; | 96 CompilationInfo* info_; |
95 CodeStub* code_stub_; | 97 CodeStub* code_stub_; |
96 CodeStubDescriptor descriptor_; | 98 CodeStubDescriptor descriptor_; |
97 HContext* context_; | 99 HContext* context_; |
98 }; | 100 }; |
99 | 101 |
100 | 102 |
101 bool CodeStubGraphBuilderBase::BuildGraph() { | 103 bool CodeStubGraphBuilderBase::BuildGraph() { |
102 // Update the static counter each time a new code stub is generated. | 104 // Update the static counter each time a new code stub is generated. |
(...skipping 2105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2208 return Pop(); | 2210 return Pop(); |
2209 } | 2211 } |
2210 | 2212 |
2211 | 2213 |
2212 Handle<Code> KeyedLoadGenericStub::GenerateCode() { | 2214 Handle<Code> KeyedLoadGenericStub::GenerateCode() { |
2213 return DoGenerateCode(this); | 2215 return DoGenerateCode(this); |
2214 } | 2216 } |
2215 | 2217 |
2216 } // namespace internal | 2218 } // namespace internal |
2217 } // namespace v8 | 2219 } // namespace v8 |
OLD | NEW |