From: bmeurer@chromium.org Date: Tue, 20 Aug 2013 06:39:04 +0000 (+0000) Subject: Revert "Add FINAL and OVERRIDE macros for C++11 final/override." X-Git-Tag: upstream/4.7.83~12917 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c44ccc2d79358c24fb97c7b9a2db6e24bc3872a8;p=platform%2Fupstream%2Fv8.git Revert "Add FINAL and OVERRIDE macros for C++11 final/override." This reverts commit r16222 for not using V8_ prefix. TBR=svenpanne@chromium.org Review URL: https://codereview.chromium.org/23301006 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16230 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index f62e8b0..b73006a 100644 --- a/src/arm/full-codegen-arm.cc +++ b/src/arm/full-codegen-arm.cc @@ -1986,12 +1986,12 @@ void FullCodeGenerator::VisitYield(Yield* expr) { VisitForStackValue(expr->expression()); switch (expr->yield_kind()) { - case Yield::kSuspend: + case Yield::SUSPEND: // Pop value from top-of-stack slot; box result into result register. EmitCreateIteratorResult(false); __ push(result_register()); // Fall through. - case Yield::kInitial: { + case Yield::INITIAL: { Label suspend, continuation, post_runtime, resume; __ jmp(&suspend); @@ -2023,7 +2023,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { break; } - case Yield::kFinal: { + case Yield::FINAL: { VisitForAccumulatorValue(expr->generator_object()); __ mov(r1, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorClosed))); __ str(r1, FieldMemOperand(result_register(), @@ -2035,7 +2035,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { break; } - case Yield::kDelegating: { + case Yield::DELEGATING: { VisitForStackValue(expr->generator_object()); // Initial stack layout is as follows: diff --git a/src/ast.h b/src/ast.h index 8557ac2..a8b7421 100644 --- a/src/ast.h +++ b/src/ast.h @@ -2144,10 +2144,10 @@ class Yield: public Expression { DECLARE_NODE_TYPE(Yield) enum Kind { - kInitial, // The initial yield that returns the unboxed generator object - kSuspend, // A normal yield: { value: EXPRESSION, done: false } - kDelegating, // A yield*. - kFinal // A return: { value: EXPRESSION, done: true } + INITIAL, // The initial yield that returns the unboxed generator object. + SUSPEND, // A normal yield: { value: EXPRESSION, done: false } + DELEGATING, // A yield*. + FINAL // A return: { value: EXPRESSION, done: true } }; Expression* generator_object() const { return generator_object_; } @@ -2159,11 +2159,11 @@ class Yield: public Expression { // locates the catch handler in the handler table, and is equivalent to // TryCatchStatement::index(). int index() const { - ASSERT(yield_kind() == kDelegating); + ASSERT(yield_kind() == DELEGATING); return index_; } void set_index(int index) { - ASSERT(yield_kind() == kDelegating); + ASSERT(yield_kind() == DELEGATING); index_ = index; } diff --git a/src/globals.h b/src/globals.h index 415b32b..26fd531 100644 --- a/src/globals.h +++ b/src/globals.h @@ -330,50 +330,6 @@ F FUNCTION_CAST(Address addr) { } -// Compiler feature detection. -#if defined(__clang__) - -// Compatibility with older clang versions. -# ifndef __has_extension -# define __has_extension __has_feature -# endif - -# if __has_extension(cxx_override_control) -# define V8_HAVE_CXX11_FINAL -# define V8_HAVE_CXX11_OVERRIDE -# endif - -#elif defined(__GNUC__) - -// g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality -// without warnings (functionality used by the macros below). These modes -// are detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, -// more standardly, by checking whether __cplusplus has a C++11 or greater -// value. Current versions of g++ do not correctly set __cplusplus, so we check -// both for forward compatibility. -# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L -# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) -# define V8_HAVE_CXX11_OVERRIDE -# define V8_HAVE_CXX11_FINAL -# endif -# else -// '__final' is a non-C++11 GCC synonym for 'final', per GCC r176655. -# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) -# define V8_HAVE_GXX_FINAL -# endif -# endif - -#elif defined(_MSC_VER) - -# if _MSC_VER >= 1400 -# define V8_HAVE_CXX11_OVERRIDE -// MSVC currently spells "final" as "sealed". -# define V8_HAVE_MSVC_SEALED -# endif - -#endif - - #if __cplusplus >= 201103L #define DISALLOW_BY_DELETE = delete #else @@ -419,33 +375,6 @@ F FUNCTION_CAST(Address addr) { #endif -// Annotate a virtual method indicating it must be overriding a virtual -// method in the parent class. -// Use like: -// virtual void bar() OVERRIDE; -#if defined(V8_HAVE_CXX11_OVERRIDE) -#define OVERRIDE override -#else -#define OVERRIDE -#endif - - -// Annotate a virtual method indicating that subclasses must not override it, -// or annotate a class to indicate that it cannot be subclassed. -// Use like: -// class B FINAL : public A {}; -// virtual void bar() FINAL; -#if defined(V8_HAVE_CXX11_FINAL) -#define FINAL final -#elif defined(V8_HAVE_GXX_FINAL) -#define FINAL __final -#elif defined(V8_HAVE_MSVC_SEALED) -#define FINAL sealed -#else -#define FINAL -#endif - - #if defined(__GNUC__) && __GNUC__ >= 4 #define MUST_USE_RESULT __attribute__ ((warn_unused_result)) #else diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc index ec8b2c9..f08a269 100644 --- a/src/ia32/full-codegen-ia32.cc +++ b/src/ia32/full-codegen-ia32.cc @@ -1945,12 +1945,12 @@ void FullCodeGenerator::VisitYield(Yield* expr) { VisitForStackValue(expr->expression()); switch (expr->yield_kind()) { - case Yield::kSuspend: + case Yield::SUSPEND: // Pop value from top-of-stack slot; box result into result register. EmitCreateIteratorResult(false); __ push(result_register()); // Fall through. - case Yield::kInitial: { + case Yield::INITIAL: { Label suspend, continuation, post_runtime, resume; __ jmp(&suspend); @@ -1983,7 +1983,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { break; } - case Yield::kFinal: { + case Yield::FINAL: { VisitForAccumulatorValue(expr->generator_object()); __ mov(FieldOperand(result_register(), JSGeneratorObject::kContinuationOffset), @@ -1995,7 +1995,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { break; } - case Yield::kDelegating: { + case Yield::DELEGATING: { VisitForStackValue(expr->generator_object()); // Initial stack layout is as follows: diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index 895af8f..b60502c 100644 --- a/src/mips/full-codegen-mips.cc +++ b/src/mips/full-codegen-mips.cc @@ -1993,12 +1993,12 @@ void FullCodeGenerator::VisitYield(Yield* expr) { VisitForStackValue(expr->expression()); switch (expr->yield_kind()) { - case Yield::kSuspend: + case Yield::SUSPEND: // Pop value from top-of-stack slot; box result into result register. EmitCreateIteratorResult(false); __ push(result_register()); // Fall through. - case Yield::kInitial: { + case Yield::INITIAL: { Label suspend, continuation, post_runtime, resume; __ jmp(&suspend); @@ -2029,7 +2029,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { break; } - case Yield::kFinal: { + case Yield::FINAL: { VisitForAccumulatorValue(expr->generator_object()); __ li(a1, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorClosed))); __ sw(a1, FieldMemOperand(result_register(), @@ -2041,7 +2041,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { break; } - case Yield::kDelegating: { + case Yield::DELEGATING: { VisitForStackValue(expr->generator_object()); // Initial stack layout is as follows: diff --git a/src/parser.cc b/src/parser.cc index 7be6443..4947790 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -2319,7 +2319,7 @@ Statement* Parser::ParseReturnStatement(bool* ok) { Expression* generator = factory()->NewVariableProxy( current_function_state_->generator_object_variable()); Expression* yield = factory()->NewYield( - generator, return_value, Yield::kFinal, RelocInfo::kNoPosition); + generator, return_value, Yield::FINAL, RelocInfo::kNoPosition); result = factory()->NewExpressionStatement(yield); } else { result = factory()->NewReturnStatement(return_value); @@ -2997,13 +2997,13 @@ Expression* Parser::ParseYieldExpression(bool* ok) { int position = scanner().peek_location().beg_pos; Expect(Token::YIELD, CHECK_OK); Yield::Kind kind = - Check(Token::MUL) ? Yield::kDelegating : Yield::kSuspend; + Check(Token::MUL) ? Yield::DELEGATING : Yield::SUSPEND; Expression* generator_object = factory()->NewVariableProxy( current_function_state_->generator_object_variable()); Expression* expression = ParseAssignmentExpression(false, CHECK_OK); Yield* yield = factory()->NewYield(generator_object, expression, kind, position); - if (kind == Yield::kDelegating) { + if (kind == Yield::DELEGATING) { yield->set_index(current_function_state_->NextHandlerIndex()); } return yield; @@ -4484,7 +4484,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral( VariableProxy* get_proxy = factory()->NewVariableProxy( current_function_state_->generator_object_variable()); Yield* yield = factory()->NewYield( - get_proxy, assignment, Yield::kInitial, RelocInfo::kNoPosition); + get_proxy, assignment, Yield::INITIAL, RelocInfo::kNoPosition); body->Add(factory()->NewExpressionStatement(yield), zone()); } @@ -4496,7 +4496,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral( Expression *undefined = factory()->NewLiteral( isolate()->factory()->undefined_value()); Yield* yield = factory()->NewYield( - get_proxy, undefined, Yield::kFinal, RelocInfo::kNoPosition); + get_proxy, undefined, Yield::FINAL, RelocInfo::kNoPosition); body->Add(factory()->NewExpressionStatement(yield), zone()); } diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc index 7c78adc..6333e87 100644 --- a/src/x64/full-codegen-x64.cc +++ b/src/x64/full-codegen-x64.cc @@ -1967,12 +1967,12 @@ void FullCodeGenerator::VisitYield(Yield* expr) { VisitForStackValue(expr->expression()); switch (expr->yield_kind()) { - case Yield::kSuspend: + case Yield::SUSPEND: // Pop value from top-of-stack slot; box result into result register. EmitCreateIteratorResult(false); __ push(result_register()); // Fall through. - case Yield::kInitial: { + case Yield::INITIAL: { Label suspend, continuation, post_runtime, resume; __ jmp(&suspend); @@ -2006,7 +2006,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { break; } - case Yield::kFinal: { + case Yield::FINAL: { VisitForAccumulatorValue(expr->generator_object()); __ Move(FieldOperand(result_register(), JSGeneratorObject::kContinuationOffset), @@ -2018,7 +2018,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { break; } - case Yield::kDelegating: { + case Yield::DELEGATING: { VisitForStackValue(expr->generator_object()); // Initial stack layout is as follows: