Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Side by Side Diff: src/ia32/codegen-ia32.cc

Issue 651019: Improve load of global variables. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 if (property->key()->IsPropertyName()) { 682 if (property->key()->IsPropertyName()) {
683 ref->set_type(Reference::NAMED); 683 ref->set_type(Reference::NAMED);
684 } else { 684 } else {
685 Load(property->key()); 685 Load(property->key());
686 ref->set_type(Reference::KEYED); 686 ref->set_type(Reference::KEYED);
687 } 687 }
688 } else if (var != NULL) { 688 } else if (var != NULL) {
689 // The expression is a variable proxy that does not rewrite to a 689 // The expression is a variable proxy that does not rewrite to a
690 // property. Global variables are treated as named property references. 690 // property. Global variables are treated as named property references.
691 if (var->is_global()) { 691 if (var->is_global()) {
692 // Named loads require object in eax. Named stores don't use references.
693 // Spilling eax makes it free, so LoadGlobal loads directly into eax.
Kevin Millikin (Chromium) 2010/02/19 10:23:04 The comment is still not quite right. LoadIC want
694 frame_->Spill(eax);
692 LoadGlobal(); 695 LoadGlobal();
693 ref->set_type(Reference::NAMED); 696 ref->set_type(Reference::NAMED);
694 } else { 697 } else {
695 ASSERT(var->slot() != NULL); 698 ASSERT(var->slot() != NULL);
696 ref->set_type(Reference::SLOT); 699 ref->set_type(Reference::SLOT);
697 } 700 }
698 } else { 701 } else {
699 // Anything else is a runtime error. 702 // Anything else is a runtime error.
700 Load(e); 703 Load(e);
701 frame_->CallRuntime(Runtime::kThrowReferenceError, 1); 704 frame_->CallRuntime(Runtime::kThrowReferenceError, 1);
(...skipping 10054 matching lines...) Expand 10 before | Expand all | Expand 10 after
10756 10759
10757 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) 10760 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
10758 // tagged as a small integer. 10761 // tagged as a small integer.
10759 __ bind(&runtime); 10762 __ bind(&runtime);
10760 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); 10763 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1);
10761 } 10764 }
10762 10765
10763 #undef __ 10766 #undef __
10764 10767
10765 } } // namespace v8::internal 10768 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698