| 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 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 true_label_ = saved_true; | 1020 true_label_ = saved_true; |
| 1021 false_label_ = saved_false; | 1021 false_label_ = saved_false; |
| 1022 break; | 1022 break; |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 case Token::TYPEOF: { | 1025 case Token::TYPEOF: { |
| 1026 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); | 1026 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); |
| 1027 ASSERT_EQ(Expression::kValue, expr->expression()->context()); | 1027 ASSERT_EQ(Expression::kValue, expr->expression()->context()); |
| 1028 | 1028 |
| 1029 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 1029 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
| 1030 if (proxy != NULL && proxy->var()->is_global()) { | 1030 if (proxy != NULL && |
| 1031 !proxy->var()->is_this() && |
| 1032 proxy->var()->is_global()) { |
| 1031 Comment cmnt(masm_, "Global variable"); | 1033 Comment cmnt(masm_, "Global variable"); |
| 1032 __ push(CodeGenerator::GlobalObject()); | 1034 __ push(CodeGenerator::GlobalObject()); |
| 1033 __ mov(ecx, Immediate(proxy->name())); | 1035 __ mov(ecx, Immediate(proxy->name())); |
| 1034 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); | 1036 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); |
| 1035 // Use a regular load, not a contextual load, to avoid a reference | 1037 // Use a regular load, not a contextual load, to avoid a reference |
| 1036 // error. | 1038 // error. |
| 1037 __ call(ic, RelocInfo::CODE_TARGET); | 1039 __ call(ic, RelocInfo::CODE_TARGET); |
| 1038 __ mov(Operand(esp, 0), eax); | 1040 __ mov(Operand(esp, 0), eax); |
| 1039 } else if (proxy != NULL && | 1041 } else if (proxy != NULL && |
| 1040 proxy->var()->slot() != NULL && | 1042 proxy->var()->slot() != NULL && |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1333 true_label_ = saved_true; | 1335 true_label_ = saved_true; |
| 1334 false_label_ = saved_false; | 1336 false_label_ = saved_false; |
| 1335 // Convert current context to test context: End post-test code. | 1337 // Convert current context to test context: End post-test code. |
| 1336 } | 1338 } |
| 1337 | 1339 |
| 1338 | 1340 |
| 1339 #undef __ | 1341 #undef __ |
| 1340 | 1342 |
| 1341 | 1343 |
| 1342 } } // namespace v8::internal | 1344 } } // namespace v8::internal |
| OLD | NEW |