X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fv8%2Fsrc%2Fstub-cache.h;h=f55c440ea4e7c753f51bb55fe5d80dcd8630b977;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=9cdd77f757b3182c3345d3788010d5231ee11416;hpb=d1e23c6ec4202b125fc446349b2230d4cd978d86;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/v8/src/stub-cache.h b/src/v8/src/stub-cache.h index 9cdd77f..f55c440 100644 --- a/src/v8/src/stub-cache.h +++ b/src/v8/src/stub-cache.h @@ -104,62 +104,6 @@ class StubCache { StrictModeFlag strict_mode, KeyedAccessStoreMode store_mode); - Handle ComputeCallField(int argc, - Code::Kind, - ExtraICState extra_state, - Handle name, - Handle object, - Handle holder, - PropertyIndex index); - - Handle ComputeCallConstant(int argc, - Code::Kind, - ExtraICState extra_state, - Handle name, - Handle object, - Handle holder, - Handle function); - - Handle ComputeCallInterceptor(int argc, - Code::Kind, - ExtraICState extra_state, - Handle name, - Handle object, - Handle holder); - - Handle ComputeCallGlobal(int argc, - Code::Kind, - ExtraICState extra_state, - Handle name, - Handle object, - Handle holder, - Handle cell, - Handle function); - - // --- - - Handle ComputeCallInitialize(int argc); - - Handle ComputeKeyedCallInitialize(int argc); - - Handle ComputeCallPreMonomorphic(int argc, - Code::Kind kind, - ExtraICState extra_state); - - Handle ComputeCallNormal(int argc, - Code::Kind kind, - ExtraICState state); - - Handle ComputeCallArguments(int argc); - - Handle ComputeCallMegamorphic(int argc, - Code::Kind kind, - ExtraICState state); - - Handle ComputeCallMiss(int argc, - Code::Kind kind, - ExtraICState state); - // --- Handle ComputeLoad(InlineCacheState ic_state, ExtraICState extra_state); @@ -185,15 +129,8 @@ class StubCache { ExtraICState extra_ic_state); // Finds the Code object stored in the Heap::non_monomorphic_cache(). - Code* FindCallInitialize(int argc, Code::Kind kind); Code* FindPreMonomorphicIC(Code::Kind kind, ExtraICState extra_ic_state); -#ifdef ENABLE_DEBUGGER_SUPPORT - Handle ComputeCallDebugBreak(int argc, Code::Kind kind); - - Handle ComputeCallDebugPrepareStepIn(int argc, Code::Kind kind); -#endif - // Update cache for entry hash(name, map). Code* Set(Name* name, Map* map, Code* code); @@ -269,8 +206,6 @@ class StubCache { private: explicit StubCache(Isolate* isolate); - Handle ComputeCallInitialize(int argc, Code::Kind kind); - // The stub cache has a primary and secondary level. The two levels have // different hashing algorithms in order to avoid simultaneous collisions // in both caches. Unlike a probing strategy (quadratic or otherwise) the @@ -358,7 +293,6 @@ DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorOnly); DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorForLoad); DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorForCall); DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreInterceptorProperty); -DECLARE_RUNTIME_FUNCTION(MaybeObject*, CallInterceptorProperty); DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadPropertyWithInterceptor); @@ -374,15 +308,6 @@ class StubCompiler BASE_EMBEDDED { : isolate_(isolate), extra_ic_state_(extra_ic_state), masm_(isolate, NULL, 256), failure_(NULL) { } - // Functions to compile either CallIC or KeyedCallIC. The specific kind - // is extracted from the code flags. - Handle CompileCallInitialize(Code::Flags flags); - Handle CompileCallPreMonomorphic(Code::Flags flags); - Handle CompileCallNormal(Code::Flags flags); - Handle CompileCallMegamorphic(Code::Flags flags); - Handle CompileCallArguments(Code::Flags flags); - Handle CompileCallMiss(Code::Flags flags); - Handle CompileLoadInitialize(Code::Flags flags); Handle CompileLoadPreMonomorphic(Code::Flags flags); Handle CompileLoadMegamorphic(Code::Flags flags); @@ -392,11 +317,6 @@ class StubCompiler BASE_EMBEDDED { Handle CompileStoreGeneric(Code::Flags flags); Handle CompileStoreMegamorphic(Code::Flags flags); -#ifdef ENABLE_DEBUGGER_SUPPORT - Handle CompileCallDebugBreak(Code::Flags flags); - Handle CompileCallDebugPrepareStepIn(Code::Flags flags); -#endif - // Static functions for generating parts of stubs. static void GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, int index, @@ -647,6 +567,7 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler { Handle getter); static void GenerateLoadViaGetter(MacroAssembler* masm, + Handle type, Register receiver, Handle getter); @@ -691,7 +612,8 @@ class LoadStubCompiler: public BaseLoadStoreStubCompiler { void GenerateLoadConstant(Handle value); void GenerateLoadCallback(Register reg, Handle callback); - void GenerateLoadCallback(const CallOptimization& call_optimization); + void GenerateLoadCallback(const CallOptimization& call_optimization, + Handle receiver_map); void GenerateLoadInterceptor(Register holder_reg, Handle object, Handle holder, @@ -791,6 +713,7 @@ class StoreStubCompiler: public BaseLoadStoreStubCompiler { const CallOptimization& call_optimization); static void GenerateStoreViaSetter(MacroAssembler* masm, + Handle type, Handle setter); Handle CompileStoreViaSetter(Handle object, @@ -868,103 +791,6 @@ class KeyedStoreStubCompiler: public StoreStubCompiler { }; -class CallStubCompiler: public StubCompiler { - public: - CallStubCompiler(Isolate* isolate, - int argc, - Code::Kind kind, - ExtraICState extra_state, - InlineCacheHolderFlag cache_holder = OWN_MAP); - - Handle CompileCallField(Handle object, - Handle holder, - PropertyIndex index, - Handle name); - - // Patch the implicit receiver over the global object if the global object is - // the receiver. - void PatchImplicitReceiver(Handle object); - - // Returns the register containing the holder of |name|. - Register HandlerFrontendHeader(Handle object, - Handle holder, - Handle name, - CheckType check, - Label* miss); - void HandlerFrontendFooter(Label* miss); - - void GenerateJumpFunctionIgnoreReceiver(Handle function); - void GenerateJumpFunction(Handle object, - Handle function); - void GenerateJumpFunction(Handle object, - Register function, - Label* miss); - // Use to call |actual_closure|, a closure with the same shared function info - // as |function|. - void GenerateJumpFunction(Handle object, - Register actual_closure, - Handle function); - - Handle CompileCallConstant(Handle object, - Handle holder, - Handle name, - CheckType check, - Handle function); - - Handle CompileCallInterceptor(Handle object, - Handle holder, - Handle name); - - Handle CompileCallGlobal(Handle object, - Handle holder, - Handle cell, - Handle function, - Handle name); - - static bool HasCustomCallGenerator(Handle function); - - private: - // Compiles a custom call constant/global IC. For constant calls cell is - // NULL. Returns an empty handle if there is no custom call code for the - // given function. - Handle CompileCustomCall(Handle object, - Handle holder, - Handle cell, - Handle function, - Handle name, - Code::StubType type); - - Handle CompileFastApiCall(const CallOptimization& optimization, - Handle object, - Handle holder, - Handle cell, - Handle function, - Handle name); - - Handle GetCode(Code::StubType type, Handle name); - Handle GetCode(Handle function); - - const ParameterCount& arguments() { return arguments_; } - - void GenerateNameCheck(Handle name, Label* miss); - - // Generates code to load the function from the cell checking that - // it still contains the same function. - void GenerateLoadFunctionFromCell(Handle cell, - Handle function, - Label* miss); - - void GenerateFunctionCheck(Register function, Register scratch, Label* miss); - - // Generates a jump to CallIC miss stub. - void GenerateMissBranch(); - - const ParameterCount arguments_; - const Code::Kind kind_; - const InlineCacheHolderFlag cache_holder_; -}; - - // Holds information about possible function call optimizations. class CallOptimization BASE_EMBEDDED { public: @@ -998,22 +824,15 @@ class CallOptimization BASE_EMBEDDED { enum HolderLookup { kHolderNotFound, kHolderIsReceiver, - kHolderIsPrototypeOfMap + kHolderFound }; - // Returns a map whose prototype has the expected type in the - // prototype chain between the two arguments - // null will be returned if the first argument has that property - // lookup will be set accordingly - Handle LookupHolderOfExpectedType(Handle receiver, - Handle object, - Handle holder, - HolderLookup* holder_lookup) const; + Handle LookupHolderOfExpectedType( + Handle receiver_map, + HolderLookup* holder_lookup) const; - bool IsCompatibleReceiver(Object* receiver) { - ASSERT(is_simple_api_call()); - if (expected_receiver_type_.is_null()) return true; - return expected_receiver_type_->IsTemplateFor(receiver); - } + // Check if the api holder is between the receiver and the holder. + bool IsCompatibleReceiver(Handle receiver, + Handle holder) const; private: void Initialize(Handle function);