From ec7034e65ba94f598bfb7eeafa5d4251f2c6b8c9 Mon Sep 17 00:00:00 2001 From: "whesse@chromium.org" Date: Thu, 5 Nov 2009 12:45:53 +0000 Subject: [PATCH] Make "typeof this" return object in fast compiler. Review URL: http://codereview.chromium.org/366028 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3227 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/fast-codegen-arm.cc | 4 +++- src/ia32/fast-codegen-ia32.cc | 4 +++- src/x64/fast-codegen-x64.cc | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/arm/fast-codegen-arm.cc b/src/arm/fast-codegen-arm.cc index 249495a66..65f21b12e 100644 --- a/src/arm/fast-codegen-arm.cc +++ b/src/arm/fast-codegen-arm.cc @@ -1031,7 +1031,9 @@ void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { ASSERT_EQ(Expression::kValue, expr->expression()->context()); VariableProxy* proxy = expr->expression()->AsVariableProxy(); - if (proxy != NULL && proxy->var()->is_global()) { + if (proxy != NULL && + !proxy->var()->is_this() && + proxy->var()->is_global()) { Comment cmnt(masm_, "Global variable"); __ ldr(r0, CodeGenerator::GlobalObject()); __ push(r0); diff --git a/src/ia32/fast-codegen-ia32.cc b/src/ia32/fast-codegen-ia32.cc index 6437fdfe3..57b5646ba 100644 --- a/src/ia32/fast-codegen-ia32.cc +++ b/src/ia32/fast-codegen-ia32.cc @@ -1027,7 +1027,9 @@ void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { ASSERT_EQ(Expression::kValue, expr->expression()->context()); VariableProxy* proxy = expr->expression()->AsVariableProxy(); - if (proxy != NULL && proxy->var()->is_global()) { + if (proxy != NULL && + !proxy->var()->is_this() && + proxy->var()->is_global()) { Comment cmnt(masm_, "Global variable"); __ push(CodeGenerator::GlobalObject()); __ mov(ecx, Immediate(proxy->name())); diff --git a/src/x64/fast-codegen-x64.cc b/src/x64/fast-codegen-x64.cc index 2be08710f..6ec17cae0 100644 --- a/src/x64/fast-codegen-x64.cc +++ b/src/x64/fast-codegen-x64.cc @@ -1102,7 +1102,9 @@ void FastCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { ASSERT_EQ(Expression::kValue, expr->expression()->context()); VariableProxy* proxy = expr->expression()->AsVariableProxy(); - if (proxy != NULL && proxy->var()->is_global()) { + if (proxy != NULL && + !proxy->var()->is_this() && + proxy->var()->is_global()) { Comment cmnt(masm_, "Global variable"); __ push(CodeGenerator::GlobalObject()); __ Move(rcx, proxy->name()); -- 2.34.1