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

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

Issue 1983005: Optimize loading the global object for a named load on x64.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 7 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 5233 matching lines...) Expand 10 before | Expand all | Expand 10 after
5244 if (property->key()->IsPropertyName()) { 5244 if (property->key()->IsPropertyName()) {
5245 ref->set_type(Reference::NAMED); 5245 ref->set_type(Reference::NAMED);
5246 } else { 5246 } else {
5247 Load(property->key()); 5247 Load(property->key());
5248 ref->set_type(Reference::KEYED); 5248 ref->set_type(Reference::KEYED);
5249 } 5249 }
5250 } else if (var != NULL) { 5250 } else if (var != NULL) {
5251 // The expression is a variable proxy that does not rewrite to a 5251 // The expression is a variable proxy that does not rewrite to a
5252 // property. Global variables are treated as named property references. 5252 // property. Global variables are treated as named property references.
5253 if (var->is_global()) { 5253 if (var->is_global()) {
5254 // If rax is free, the register allocator prefers it. Thus the code
5255 // generator will load the global object into rax, which is where
5256 // LoadIC wants it. Most uses of Reference call LoadIC directly
5257 // after the reference is created.
5258 frame_->Spill(rax);
5254 LoadGlobal(); 5259 LoadGlobal();
5255 ref->set_type(Reference::NAMED); 5260 ref->set_type(Reference::NAMED);
5256 } else { 5261 } else {
5257 ASSERT(var->slot() != NULL); 5262 ASSERT(var->slot() != NULL);
5258 ref->set_type(Reference::SLOT); 5263 ref->set_type(Reference::SLOT);
5259 } 5264 }
5260 } else { 5265 } else {
5261 // Anything else is a runtime error. 5266 // Anything else is a runtime error.
5262 Load(e); 5267 Load(e);
5263 frame_->CallRuntime(Runtime::kThrowReferenceError, 1); 5268 frame_->CallRuntime(Runtime::kThrowReferenceError, 1);
(...skipping 6308 matching lines...) Expand 10 before | Expand all | Expand 10 after
11572 // Call the function from C++. 11577 // Call the function from C++.
11573 return FUNCTION_CAST<ModuloFunction>(buffer); 11578 return FUNCTION_CAST<ModuloFunction>(buffer);
11574 } 11579 }
11575 11580
11576 #endif 11581 #endif
11577 11582
11578 11583
11579 #undef __ 11584 #undef __
11580 11585
11581 } } // namespace v8::internal 11586 } } // 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