LGTM. If you want to save even more space you could have a specialized
version of V8_Fatal -- called V8_Unimplemented or something -- that
doesn't take any parameters. We should also fix the naming of V8_Fatal
-- why is there an underscore in it? Weird...

On Sat, Sep 20, 2008 at 7:24 PM,  <[EMAIL PROTECTED]> wrote:
> Reviewers: Kasper Lund, bak,
>
> Message:
> I am up for debate on this.  UNIMPLEMENTED and FATAL aren't used that
> much, so I'm fine leaving them as is.
>
> UNREACHABLE on the other hand is inlined in a bunch of code.  I get 15%
> on a benchmark I was testing, but I thinks that more of a weird P4 issue
> than anything.  Maybe we should change UNREACHABLE in release, and leave
> the others?  It will be interesting to see some benchmarks with this...
>
> Description:
> In release, disable UNREACHABLE and make UNIMPLEMENTED and FATAL
> simpler, removing the file name and line numbers, so we carry around
> less data and can share more code.
>
> Please review this at http://codereview.chromium.org/4008
>
> Affected files:
>  M src/checks.h
>
>
> Index: src/checks.h
> diff --git a/src/checks.h b/src/checks.h
> index
> 3908ab4c3ed69c622510e93f9c8f8c4c42aab24a..020f1294ea711e92cd4e3b86717971343bacfbbd
> 100644
> --- a/src/checks.h
> +++ b/src/checks.h
> @@ -37,14 +37,20 @@ void API_Fatal(const char* location, const char* format,
> ...);
>
>  // The FATAL, UNREACHABLE and UNIMPLEMENTED macros are useful during
>  // development, but they should not be relied on in the final product.
> +#ifdef DEBUG
>  #define FATAL(msg)                              \
>   V8_Fatal(__FILE__, __LINE__, "%s", (msg))
> -
> +#define UNIMPLEMENTED()                         \
> +  V8_Fatal(__FILE__, __LINE__, "unimplemented code")
>  #define UNREACHABLE()                           \
>   V8_Fatal(__FILE__, __LINE__, "unreachable code")
> -
> +#else
> +#define FATAL(msg)                              \
> +  V8_Fatal("", 0, "%s", (msg))
>  #define UNIMPLEMENTED()                         \
> -  V8_Fatal(__FILE__, __LINE__, "unimplemented code")
> +  V8_Fatal("", 0, "unimplemented code")
> +#define UNREACHABLE() ((void) 0)
> +#endif
>
>
>  // Used by the CHECK macro -- should not be called directly.
>
>
>

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to