From 056b1f3a860bdb2d077d2a17a7d1119f8c7d2e43 Mon Sep 17 00:00:00 2001 From: "whesse@chromium.org" Date: Mon, 18 Oct 2010 10:23:45 +0000 Subject: [PATCH] Fix compilation error on ARM with gcc 4.4. Remove NULL check of pointer to member, which was dead code (never failed). Review URL: http://codereview.chromium.org/3793011 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5636 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/codegen-arm.h | 3 --- src/codegen.cc | 21 ++++++++------------- src/codegen.h | 1 - src/ia32/codegen-ia32.h | 3 --- src/x64/codegen-x64.h | 3 --- 5 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/arm/codegen-arm.h b/src/arm/codegen-arm.h index 43f4d8771..e6fd6071e 100644 --- a/src/arm/codegen-arm.h +++ b/src/arm/codegen-arm.h @@ -447,9 +447,6 @@ class CodeGenerator: public AstVisitor { void Branch(bool if_true, JumpTarget* target); void CheckStack(); - static InlineFunctionGenerator FindInlineFunctionGenerator( - Runtime::FunctionId function_id); - bool CheckForInlineRuntimeCall(CallRuntime* node); static Handle ComputeLazyCompile(int argc); diff --git a/src/codegen.cc b/src/codegen.cc index 295d7b032..bda697aba 100644 --- a/src/codegen.cc +++ b/src/codegen.cc @@ -361,24 +361,19 @@ const CodeGenerator::InlineFunctionGenerator #undef INLINE_FUNCTION_GENERATOR_ADDRESS -CodeGenerator::InlineFunctionGenerator - CodeGenerator::FindInlineFunctionGenerator(Runtime::FunctionId id) { - return kInlineFunctionGenerators[ - static_cast(id) - static_cast(Runtime::kFirstInlineFunction)]; -} - - bool CodeGenerator::CheckForInlineRuntimeCall(CallRuntime* node) { ZoneList* args = node->arguments(); Handle name = node->name(); Runtime::Function* function = node->function(); if (function != NULL && function->intrinsic_type == Runtime::INLINE) { - InlineFunctionGenerator generator = - FindInlineFunctionGenerator(function->function_id); - if (generator != NULL) { - ((*this).*(generator))(args); - return true; - } + int lookup_index = static_cast(function->function_id) - + static_cast(Runtime::kFirstInlineFunction); + ASSERT(lookup_index >= 0); + ASSERT(static_cast(lookup_index) < + ARRAY_SIZE(kInlineFunctionGenerators)); + InlineFunctionGenerator generator = kInlineFunctionGenerators[lookup_index]; + (this->*generator)(args); + return true; } return false; } diff --git a/src/codegen.h b/src/codegen.h index 2a4d9d4cc..8f923dd34 100644 --- a/src/codegen.h +++ b/src/codegen.h @@ -62,7 +62,6 @@ // ComputeCallInitializeInLoop // ProcessDeclarations // DeclareGlobals -// FindInlineRuntimeLUT // CheckForInlineRuntimeCall // AnalyzeCondition // CodeForFunctionPosition diff --git a/src/ia32/codegen-ia32.h b/src/ia32/codegen-ia32.h index ec6ad2265..b0724092f 100644 --- a/src/ia32/codegen-ia32.h +++ b/src/ia32/codegen-ia32.h @@ -624,9 +624,6 @@ class CodeGenerator: public AstVisitor { void CheckStack(); - static InlineFunctionGenerator FindInlineFunctionGenerator( - Runtime::FunctionId function_id); - bool CheckForInlineRuntimeCall(CallRuntime* node); void ProcessDeclarations(ZoneList* declarations); diff --git a/src/x64/codegen-x64.h b/src/x64/codegen-x64.h index 4ebf44a34..795732451 100644 --- a/src/x64/codegen-x64.h +++ b/src/x64/codegen-x64.h @@ -584,9 +584,6 @@ class CodeGenerator: public AstVisitor { void CheckStack(); - static InlineFunctionGenerator FindInlineFunctionGenerator( - Runtime::FunctionId function_id); - bool CheckForInlineRuntimeCall(CallRuntime* node); void ProcessDeclarations(ZoneList* declarations); -- 2.34.1