OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 true_label_ = saved_true; | 1095 true_label_ = saved_true; |
1096 false_label_ = saved_false; | 1096 false_label_ = saved_false; |
1097 break; | 1097 break; |
1098 } | 1098 } |
1099 | 1099 |
1100 case Token::TYPEOF: { | 1100 case Token::TYPEOF: { |
1101 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); | 1101 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); |
1102 ASSERT_EQ(Expression::kValue, expr->expression()->context()); | 1102 ASSERT_EQ(Expression::kValue, expr->expression()->context()); |
1103 | 1103 |
1104 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 1104 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
1105 if (proxy != NULL && proxy->var()->is_global()) { | 1105 if (proxy != NULL && |
| 1106 !proxy->var()->is_this() && |
| 1107 proxy->var()->is_global()) { |
1106 Comment cmnt(masm_, "Global variable"); | 1108 Comment cmnt(masm_, "Global variable"); |
1107 __ push(CodeGenerator::GlobalObject()); | 1109 __ push(CodeGenerator::GlobalObject()); |
1108 __ Move(rcx, proxy->name()); | 1110 __ Move(rcx, proxy->name()); |
1109 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); | 1111 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); |
1110 // Use a regular load, not a contextual load, to avoid a reference | 1112 // Use a regular load, not a contextual load, to avoid a reference |
1111 // error. | 1113 // error. |
1112 __ Call(ic, RelocInfo::CODE_TARGET); | 1114 __ Call(ic, RelocInfo::CODE_TARGET); |
1113 __ movq(Operand(rsp, 0), rax); | 1115 __ movq(Operand(rsp, 0), rax); |
1114 } else if (proxy != NULL && | 1116 } else if (proxy != NULL && |
1115 proxy->var()->slot() != NULL && | 1117 proxy->var()->slot() != NULL && |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 true_label_ = saved_true; | 1334 true_label_ = saved_true; |
1333 false_label_ = saved_false; | 1335 false_label_ = saved_false; |
1334 // Convert current context to test context: End post-test code. | 1336 // Convert current context to test context: End post-test code. |
1335 } | 1337 } |
1336 | 1338 |
1337 | 1339 |
1338 #undef __ | 1340 #undef __ |
1339 | 1341 |
1340 | 1342 |
1341 } } // namespace v8::internal | 1343 } } // namespace v8::internal |
OLD | NEW |