Chromium Code Reviews| Index: src/code-stubs-hydrogen.cc |
| diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc |
| index ab2fb08a44c12e85491f7b67fd527b802fc2a0f7..64e6e0a912a4cc2e95416266230cb2acfd356e4e 100644 |
| --- a/src/code-stubs-hydrogen.cc |
| +++ b/src/code-stubs-hydrogen.cc |
| @@ -30,6 +30,7 @@ |
| #include "code-stubs.h" |
| #include "hydrogen.h" |
| #include "lithium.h" |
| +#include "stub-cache.h" |
| namespace v8 { |
| namespace internal { |
| @@ -237,6 +238,33 @@ Handle<Code> KeyedLoadFastElementStub::GenerateCode() { |
| template <> |
| +HValue* CodeStubGraphBuilder<FastArrayLengthStub>::BuildCodeStub() { |
| + HInstruction* load = BuildFastArrayLengthLoad(GetParameter(0)); |
| + AddInstruction(load); |
| + return load; |
| +} |
| + |
| + |
| +Handle<Code> FastArrayLengthStub::GenerateCode() { |
| + CodeStubGraphBuilder<FastArrayLengthStub> builder(this); |
| + LChunk* chunk = OptimizeGraph(builder.CreateGraph()); |
| + return chunk->Codegen(Code::COMPILED_STUB); |
| +} |
| + |
| +void FastArrayLengthStub::InitializeInterfaceDescriptor( |
| + Isolate* isolate, |
| + CodeStubInterfaceDescriptor* descriptor) { |
| + descriptor->register_param_count_ = 2; |
|
danno
2013/03/12 11:16:16
Descriptors are persistent, but the lifetime of re
|
| + // See LoadStubCompiler::registers(). |
| + registers_[0] = receiver_; |
| + registers_[1] = LoadStubCompiler::name(); |
| + descriptor->register_params_ = registers_; |
| + descriptor->deoptimization_handler_ = |
| + Runtime::FunctionForId(Runtime::kUnexpectedDeopt)->entry; |
| +} |
| + |
| + |
| +template <> |
| HValue* CodeStubGraphBuilder<TransitionElementsKindStub>::BuildCodeStub() { |
| Zone* zone = this->zone(); |