| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 void CodeGenerator::LoadTypeofExpression(Expression* expr) { | 566 void CodeGenerator::LoadTypeofExpression(Expression* expr) { |
| 567 // Special handling of identifiers as subexpressions of typeof. | 567 // Special handling of identifiers as subexpressions of typeof. |
| 568 VirtualFrame::SpilledScope spilled_scope; | 568 VirtualFrame::SpilledScope spilled_scope; |
| 569 Variable* variable = expr->AsVariableProxy()->AsVariable(); | 569 Variable* variable = expr->AsVariableProxy()->AsVariable(); |
| 570 if (variable != NULL && !variable->is_this() && variable->is_global()) { | 570 if (variable != NULL && !variable->is_this() && variable->is_global()) { |
| 571 // For a global variable we build the property reference | 571 // For a global variable we build the property reference |
| 572 // <global>.<variable> and perform a (regular non-contextual) property | 572 // <global>.<variable> and perform a (regular non-contextual) property |
| 573 // load to make sure we do not get reference errors. | 573 // load to make sure we do not get reference errors. |
| 574 Slot global(variable, Slot::CONTEXT, Context::GLOBAL_INDEX); | 574 Slot global(variable, Slot::CONTEXT, Context::GLOBAL_INDEX); |
| 575 Literal key(variable->name()); | 575 Literal key(variable->name()); |
| 576 // TODO(1241834): Fetch the position from the variable instead of using | |
| 577 // no position. | |
| 578 Property property(&global, &key, RelocInfo::kNoPosition); | 576 Property property(&global, &key, RelocInfo::kNoPosition); |
| 579 Reference ref(this, &property); | 577 Reference ref(this, &property); |
| 580 ref.GetValueAndSpill(); | 578 ref.GetValueAndSpill(); |
| 581 } else if (variable != NULL && variable->slot() != NULL) { | 579 } else if (variable != NULL && variable->slot() != NULL) { |
| 582 // For a variable that rewrites to a slot, we signal it is the immediate | 580 // For a variable that rewrites to a slot, we signal it is the immediate |
| 583 // subexpression of a typeof. | 581 // subexpression of a typeof. |
| 584 LoadFromSlot(variable->slot(), INSIDE_TYPEOF); | 582 LoadFromSlot(variable->slot(), INSIDE_TYPEOF); |
| 585 frame_->SpillAll(); | 583 frame_->SpillAll(); |
| 586 } else { | 584 } else { |
| 587 // Anything else can be handled normally. | 585 // Anything else can be handled normally. |
| (...skipping 5643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6231 int CompareStub::MinorKey() { | 6229 int CompareStub::MinorKey() { |
| 6232 // Encode the two parameters in a unique 16 bit value. | 6230 // Encode the two parameters in a unique 16 bit value. |
| 6233 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); | 6231 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); |
| 6234 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); | 6232 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); |
| 6235 } | 6233 } |
| 6236 | 6234 |
| 6237 | 6235 |
| 6238 #undef __ | 6236 #undef __ |
| 6239 | 6237 |
| 6240 } } // namespace v8::internal | 6238 } } // namespace v8::internal |
| OLD | NEW |