From: whesse@chromium.org Date: Mon, 18 Oct 2010 10:23:45 +0000 (+0000) Subject: Fix compilation error on ARM with gcc 4.4. Remove NULL check of pointer to member... X-Git-Tag: upstream/4.7.83~21082 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=056b1f3a860bdb2d077d2a17a7d1119f8c7d2e43;p=platform%2Fupstream%2Fv8.git 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 --- diff --git a/src/arm/codegen-arm.h b/src/arm/codegen-arm.h index 43f4d87..e6fd607 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 295d7b0..bda697a 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 2a4d9d4..8f923dd 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 ec6ad22..b072409 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 4ebf44a..7957324 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);