Make "typeof this" return object in fast compiler.
authorwhesse@chromium.org <whesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 5 Nov 2009 12:45:53 +0000 (12:45 +0000)
committerwhesse@chromium.org <whesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 5 Nov 2009 12:45:53 +0000 (12:45 +0000)
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
src/ia32/fast-codegen-ia32.cc
src/x64/fast-codegen-x64.cc

index 249495a6650970026af87227dc1cc8d30a6c112a..65f21b12ef73bef338278994a062254d6f6af448 100644 (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);
index 6437fdfe3bf221bde84bd336a09e7e644c7a4deb..57b5646ba92a85286771a0bc829fc6700de7c9d7 100644 (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()));
index 2be08710f0500407f4eda878a391dbc6fcb81f81..6ec17cae05b8ae80b2da39f7380ff642d62ff62e 100644 (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());