diff options
Diffstat (limited to 'deps/v8/src/code-factory.cc')
-rw-r--r-- | deps/v8/src/code-factory.cc | 75 |
1 files changed, 55 insertions, 20 deletions
diff --git a/deps/v8/src/code-factory.cc b/deps/v8/src/code-factory.cc index ad6890bf22..6d31a5f530 100644 --- a/deps/v8/src/code-factory.cc +++ b/deps/v8/src/code-factory.cc @@ -78,8 +78,7 @@ Callable CodeFactory::CallICInOptimizedCode(Isolate* isolate, int argc, Callable CodeFactory::StoreIC(Isolate* isolate, LanguageMode language_mode) { return Callable( StoreIC::initialize_stub(isolate, language_mode, UNINITIALIZED), - FLAG_vector_stores ? VectorStoreICTrampolineDescriptor(isolate) - : StoreDescriptor(isolate)); + VectorStoreICTrampolineDescriptor(isolate)); } @@ -87,10 +86,9 @@ Callable CodeFactory::StoreIC(Isolate* isolate, LanguageMode language_mode) { Callable CodeFactory::StoreICInOptimizedCode( Isolate* isolate, LanguageMode language_mode, InlineCacheState initialization_state) { - CallInterfaceDescriptor descriptor = - FLAG_vector_stores && initialization_state != MEGAMORPHIC - ? VectorStoreICDescriptor(isolate) - : StoreDescriptor(isolate); + CallInterfaceDescriptor descriptor = initialization_state != MEGAMORPHIC + ? VectorStoreICDescriptor(isolate) + : StoreDescriptor(isolate); return Callable(StoreIC::initialize_stub_in_optimized_code( isolate, language_mode, initialization_state), descriptor); @@ -102,8 +100,7 @@ Callable CodeFactory::KeyedStoreIC(Isolate* isolate, LanguageMode language_mode) { return Callable( KeyedStoreIC::initialize_stub(isolate, language_mode, UNINITIALIZED), - FLAG_vector_stores ? VectorStoreICTrampolineDescriptor(isolate) - : StoreDescriptor(isolate)); + VectorStoreICTrampolineDescriptor(isolate)); } @@ -111,10 +108,9 @@ Callable CodeFactory::KeyedStoreIC(Isolate* isolate, Callable CodeFactory::KeyedStoreICInOptimizedCode( Isolate* isolate, LanguageMode language_mode, InlineCacheState initialization_state) { - CallInterfaceDescriptor descriptor = - FLAG_vector_stores && initialization_state != MEGAMORPHIC - ? VectorStoreICDescriptor(isolate) - : StoreDescriptor(isolate); + CallInterfaceDescriptor descriptor = initialization_state != MEGAMORPHIC + ? VectorStoreICDescriptor(isolate) + : StoreDescriptor(isolate); return Callable(KeyedStoreIC::initialize_stub_in_optimized_code( isolate, language_mode, initialization_state), descriptor); @@ -152,11 +148,9 @@ Callable CodeFactory::InstanceOf(Isolate* isolate) { // static -Callable CodeFactory::ToBoolean(Isolate* isolate, - ToBooleanStub::ResultMode mode, - ToBooleanStub::Types types) { - ToBooleanStub stub(isolate, mode, types); - return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); +Callable CodeFactory::ToBoolean(Isolate* isolate) { + Handle<Code> code = ToBooleanStub::GetUninitialized(isolate); + return Callable(code, ToBooleanDescriptor(isolate)); } @@ -203,6 +197,13 @@ Callable CodeFactory::RegExpConstructResult(Isolate* isolate) { // static +Callable CodeFactory::RegExpExec(Isolate* isolate) { + RegExpExecStub stub(isolate); + return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); +} + + +// static Callable CodeFactory::StringAdd(Isolate* isolate, StringAddFlags flags, PretenureFlag pretenure_flag) { StringAddStub stub(isolate, flags, pretenure_flag); @@ -218,6 +219,13 @@ Callable CodeFactory::StringCompare(Isolate* isolate) { // static +Callable CodeFactory::SubString(Isolate* isolate) { + SubStringStub stub(isolate); + return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); +} + + +// static Callable CodeFactory::Typeof(Isolate* isolate) { TypeofStub stub(isolate); return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); @@ -225,6 +233,13 @@ Callable CodeFactory::Typeof(Isolate* isolate) { // static +Callable CodeFactory::FastCloneRegExp(Isolate* isolate) { + FastCloneRegExpStub stub(isolate); + return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); +} + + +// static Callable CodeFactory::FastCloneShallowArray(Isolate* isolate) { // TODO(mstarzinger): Thread through AllocationSiteMode at some point. FastCloneShallowArrayStub stub(isolate, DONT_TRACK_ALLOCATION_SITE); @@ -267,6 +282,13 @@ Callable CodeFactory::ArgumentsAccess(Isolate* isolate, // static +Callable CodeFactory::RestArgumentsAccess(Isolate* isolate) { + RestParamAccessStub stub(isolate); + return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); +} + + +// static Callable CodeFactory::AllocateHeapNumber(Isolate* isolate) { AllocateHeapNumberStub stub(isolate); return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); @@ -309,6 +331,20 @@ Callable CodeFactory::CallFunction(Isolate* isolate, ConvertReceiverMode mode) { // static +Callable CodeFactory::Construct(Isolate* isolate) { + return Callable(isolate->builtins()->Construct(), + ConstructTrampolineDescriptor(isolate)); +} + + +// static +Callable CodeFactory::ConstructFunction(Isolate* isolate) { + return Callable(isolate->builtins()->ConstructFunction(), + ConstructTrampolineDescriptor(isolate)); +} + + +// static Callable CodeFactory::InterpreterPushArgsAndCall(Isolate* isolate) { return Callable(isolate->builtins()->InterpreterPushArgsAndCall(), InterpreterPushArgsAndCallDescriptor(isolate)); @@ -323,11 +359,10 @@ Callable CodeFactory::InterpreterPushArgsAndConstruct(Isolate* isolate) { // static -Callable CodeFactory::InterpreterCEntry(Isolate* isolate) { - // TODO(rmcilroy): Deal with runtime functions that return two values. +Callable CodeFactory::InterpreterCEntry(Isolate* isolate, int result_size) { // Note: If we ever use fpregs in the interpreter then we will need to // save fpregs too. - CEntryStub stub(isolate, 1, kDontSaveFPRegs, kArgvInRegister); + CEntryStub stub(isolate, result_size, kDontSaveFPRegs, kArgvInRegister); return Callable(stub.GetCode(), InterpreterCEntryDescriptor(isolate)); } |