OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 protected: | 178 protected: |
179 virtual HValue* BuildCodeStub(); | 179 virtual HValue* BuildCodeStub(); |
180 Stub* casted_stub() { return static_cast<Stub*>(stub()); } | 180 Stub* casted_stub() { return static_cast<Stub*>(stub()); } |
181 }; | 181 }; |
182 | 182 |
183 | 183 |
184 template <class Stub> | 184 template <class Stub> |
185 static Handle<Code> DoGenerateCode(Stub* stub) { | 185 static Handle<Code> DoGenerateCode(Stub* stub) { |
186 CodeStubGraphBuilder<Stub> builder(stub); | 186 CodeStubGraphBuilder<Stub> builder(stub); |
187 LChunk* chunk = OptimizeGraph(builder.CreateGraph()); | 187 LChunk* chunk = OptimizeGraph(builder.CreateGraph()); |
188 return chunk->Codegen(Code::COMPILED_STUB); | 188 return chunk->Codegen(); |
189 } | 189 } |
190 | 190 |
191 | 191 |
192 template <> | 192 template <> |
193 HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() { | 193 HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() { |
194 Zone* zone = this->zone(); | 194 Zone* zone = this->zone(); |
195 Factory* factory = isolate()->factory(); | 195 Factory* factory = isolate()->factory(); |
196 AllocationSiteMode alloc_site_mode = casted_stub()->allocation_site_mode(); | 196 AllocationSiteMode alloc_site_mode = casted_stub()->allocation_site_mode(); |
197 FastCloneShallowArrayStub::Mode mode = casted_stub()->mode(); | 197 FastCloneShallowArrayStub::Mode mode = casted_stub()->mode(); |
198 int length = casted_stub()->length(); | 198 int length = casted_stub()->length(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 length)); | 242 length)); |
243 } | 243 } |
244 | 244 |
245 return environment()->Pop(); | 245 return environment()->Pop(); |
246 } | 246 } |
247 | 247 |
248 | 248 |
249 Handle<Code> FastCloneShallowArrayStub::GenerateCode() { | 249 Handle<Code> FastCloneShallowArrayStub::GenerateCode() { |
250 CodeStubGraphBuilder<FastCloneShallowArrayStub> builder(this); | 250 CodeStubGraphBuilder<FastCloneShallowArrayStub> builder(this); |
251 LChunk* chunk = OptimizeGraph(builder.CreateGraph()); | 251 LChunk* chunk = OptimizeGraph(builder.CreateGraph()); |
252 return chunk->Codegen(Code::COMPILED_STUB); | 252 return chunk->Codegen(); |
253 } | 253 } |
254 | 254 |
255 | 255 |
256 template <> | 256 template <> |
257 HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() { | 257 HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() { |
258 Zone* zone = this->zone(); | 258 Zone* zone = this->zone(); |
259 Factory* factory = isolate()->factory(); | 259 Factory* factory = isolate()->factory(); |
260 | 260 |
261 HInstruction* boilerplate = | 261 HInstruction* boilerplate = |
262 AddInstruction(new(zone) HLoadKeyed(GetParameter(0), | 262 AddInstruction(new(zone) HLoadKeyed(GetParameter(0), |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 current_block()->MarkAsDeoptimizing(); | 434 current_block()->MarkAsDeoptimizing(); |
435 return GetParameter(0); | 435 return GetParameter(0); |
436 } | 436 } |
437 | 437 |
438 | 438 |
439 Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode() { | 439 Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode() { |
440 return DoGenerateCode(this); | 440 return DoGenerateCode(this); |
441 } | 441 } |
442 | 442 |
443 } } // namespace v8::internal | 443 } } // namespace v8::internal |
OLD | NEW |