OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 void CodeGenerator::LoadGlobalReceiver(Register scratch) { | 522 void CodeGenerator::LoadGlobalReceiver(Register scratch) { |
523 __ mov(scratch, ContextOperand(esi, Context::GLOBAL_INDEX)); | 523 __ mov(scratch, ContextOperand(esi, Context::GLOBAL_INDEX)); |
524 __ push(FieldOperand(scratch, GlobalObject::kGlobalReceiverOffset)); | 524 __ push(FieldOperand(scratch, GlobalObject::kGlobalReceiverOffset)); |
525 } | 525 } |
526 | 526 |
527 | 527 |
528 // TODO(1241834): Get rid of this function in favor of just using Load, now | 528 // TODO(1241834): Get rid of this function in favor of just using Load, now |
529 // that we have the INSIDE_TYPEOF typeof state. => Need to handle global | 529 // that we have the INSIDE_TYPEOF typeof state. => Need to handle global |
530 // variables w/o reference errors elsewhere. | 530 // variables w/o reference errors elsewhere. |
531 void CodeGenerator::LoadTypeofExpression(Expression* x) { | 531 void CodeGenerator::LoadTypeofExpression(Expression* x) { |
532 | |
533 Variable* variable = x->AsVariableProxy()->AsVariable(); | 532 Variable* variable = x->AsVariableProxy()->AsVariable(); |
534 if (variable != NULL && !variable->is_this() && variable->is_global()) { | 533 if (variable != NULL && !variable->is_this() && variable->is_global()) { |
535 // NOTE: This is somewhat nasty. We force the compiler to load | 534 // NOTE: This is somewhat nasty. We force the compiler to load |
536 // the variable as if through '<global>.<variable>' to make sure we | 535 // the variable as if through '<global>.<variable>' to make sure we |
537 // do not get reference errors. | 536 // do not get reference errors. |
538 Slot global(variable, Slot::CONTEXT, Context::GLOBAL_INDEX); | 537 Slot global(variable, Slot::CONTEXT, Context::GLOBAL_INDEX); |
539 Literal key(variable->name()); | 538 Literal key(variable->name()); |
540 // TODO(1241834): Fetch the position from the variable instead of using | 539 // TODO(1241834): Fetch the position from the variable instead of using |
541 // no position. | 540 // no position. |
542 Property property(&global, &key, RelocInfo::kNoPosition); | 541 Property property(&global, &key, RelocInfo::kNoPosition); |
(...skipping 4579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5122 | 5121 |
5123 // Slow-case: Go through the JavaScript implementation. | 5122 // Slow-case: Go through the JavaScript implementation. |
5124 __ bind(&slow); | 5123 __ bind(&slow); |
5125 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 5124 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
5126 } | 5125 } |
5127 | 5126 |
5128 | 5127 |
5129 #undef __ | 5128 #undef __ |
5130 | 5129 |
5131 } } // namespace v8::internal | 5130 } } // namespace v8::internal |
OLD | NEW |