X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/2d39b0e377c0896910ee49ae70082ba665faf986..refs/heads/master:/ftl/FTLInlineCacheSize.cpp diff --git a/ftl/FTLInlineCacheSize.cpp b/ftl/FTLInlineCacheSize.cpp index 6d44414..5cd6376 100644 --- a/ftl/FTLInlineCacheSize.cpp +++ b/ftl/FTLInlineCacheSize.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. + * Copyright (C) 2013-2015 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,11 +28,14 @@ #if ENABLE(FTL_JIT) +#include "DFGNode.h" #include "JITInlineCacheGenerator.h" #include "MacroAssembler.h" namespace JSC { namespace FTL { +using namespace DFG; + // The default sizes are x86-64-specific, and were found empirically. They have to cover the worst // possible combination of registers leading to the largest possible encoding of each instruction in // the IC. @@ -70,6 +73,68 @@ size_t sizeOfCall() #endif } +size_t sizeOfCallVarargs() +{ +#if CPU(ARM64) + return 332; +#else + return 275; +#endif +} + +size_t sizeOfCallForwardVarargs() +{ +#if CPU(ARM64) + return 312; +#else + return 262; +#endif +} + +size_t sizeOfConstructVarargs() +{ + return sizeOfCallVarargs(); // Should be the same size. +} + +size_t sizeOfConstructForwardVarargs() +{ + return sizeOfCallForwardVarargs(); // Should be the same size. +} + +size_t sizeOfIn() +{ +#if CPU(ARM64) + return 4; +#else + return 5; +#endif +} + +size_t sizeOfICFor(Node* node) +{ + switch (node->op()) { + case GetById: + return sizeOfGetById(); + case PutById: + return sizeOfPutById(); + case Call: + case Construct: + return sizeOfCall(); + case CallVarargs: + return sizeOfCallVarargs(); + case CallForwardVarargs: + return sizeOfCallForwardVarargs(); + case ConstructVarargs: + return sizeOfConstructVarargs(); + case ConstructForwardVarargs: + return sizeOfConstructForwardVarargs(); + case In: + return sizeOfIn(); + default: + return 0; + } +} + } } // namespace JSC::FTL #endif // ENABLE(FTL_JIT)