Chromium Code Reviews| Index: src/code-stubs.cc |
| diff --git a/src/code-stubs.cc b/src/code-stubs.cc |
| index ad418d69cd33e0f061db20ac2347a6cf82e70467..c6873ebcb31908e44f7181f3e38131bb3a8d77ee 100644 |
| --- a/src/code-stubs.cc |
| +++ b/src/code-stubs.cc |
| @@ -647,4 +647,45 @@ bool ProfileEntryHookStub::SetFunctionEntryHook(FunctionEntryHook entry_hook) { |
| } |
| +static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) { |
| + int major_key = stub->MajorKey(); |
| + CodeStubInterfaceDescriptor* descriptor = |
| + isolate->code_stub_interface_descriptor(major_key); |
| + if (descriptor->register_param_count_ < 0) { |
|
Hannes Payer (out of office)
2013/04/18 11:14:39
could you add a comment explaining what is going o
mvstanton
2013/04/18 13:39:26
It's checking if the descriptor has been initializ
|
| + stub->InitializeInterfaceDescriptor(isolate, descriptor); |
| + } |
| +} |
| + |
| + |
| +void ArrayConstructorStubBase::InstallDescriptors(Isolate* isolate) { |
| + ArrayNoArgumentConstructorStub stub1(GetInitialFastElementsKind()); |
| + InstallDescriptor(isolate, &stub1); |
| + ArraySingleArgumentConstructorStub stub2(GetInitialFastElementsKind()); |
| + InstallDescriptor(isolate, &stub2); |
| + ArrayNArgumentsConstructorStub stub3(GetInitialFastElementsKind()); |
| + InstallDescriptor(isolate, &stub3); |
| +} |
| + |
| + |
| +ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) |
| + : argument_count_(ANY) { |
| + ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
| +} |
| + |
| + |
| +ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate, |
| + int argument_count) { |
| + if (argument_count == 0) { |
| + argument_count_ = NONE; |
| + } else if (argument_count == 1) { |
| + argument_count_ = ONE; |
| + } else if (argument_count >= 2) { |
| + argument_count_ = MORE_THAN_ONE; |
| + } else { |
| + UNREACHABLE(); |
| + } |
| + ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
| +} |
| + |
| + |
| } } // namespace v8::internal |