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
This commit is contained in:
whesse@chromium.org 2009-11-05 12:45:53 +00:00
parent f39fbb206e
commit ec7034e65b
3 changed files with 9 additions and 3 deletions

View File

@ -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);

View File

@ -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()));

View File

@ -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());