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

Side by Side Diff: src/x64/register-allocator-x64.cc

Issue 126198: X64 Implementation: Make codegen load literals and assign to local variables. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 6 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 | « src/x64/macro-assembler-x64.cc ('k') | src/x64/virtual-frame-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 void Result::ToRegister(Register target) { 60 void Result::ToRegister(Register target) {
61 ASSERT(is_valid()); 61 ASSERT(is_valid());
62 if (!is_register() || !reg().is(target)) { 62 if (!is_register() || !reg().is(target)) {
63 Result fresh = CodeGeneratorScope::Current()->allocator()->Allocate(target); 63 Result fresh = CodeGeneratorScope::Current()->allocator()->Allocate(target);
64 ASSERT(fresh.is_valid()); 64 ASSERT(fresh.is_valid());
65 if (is_register()) { 65 if (is_register()) {
66 CodeGeneratorScope::Current()->masm()->movq(fresh.reg(), reg()); 66 CodeGeneratorScope::Current()->masm()->movq(fresh.reg(), reg());
67 } else { 67 } else {
68 ASSERT(is_constant()); 68 ASSERT(is_constant());
69 /* 69 if (handle()->IsSmi()) {
70 TODO(X64): Handle constant results. 70 if (CodeGeneratorScope::Current()->IsUnsafeSmi(handle())) {
71 if (CodeGeneratorScope::Current()->IsUnsafeSmi(handle())) { 71 CodeGeneratorScope::Current()->LoadUnsafeSmi(fresh.reg(), handle());
72 CodeGeneratorScope::Current()->LoadUnsafeSmi(fresh.reg(), handle()); 72 } else {
73 CodeGeneratorScope::Current()->masm()->
74 movq(fresh.reg(), handle(), RelocInfo::NONE);
75 }
73 } else { 76 } else {
74 CodeGeneratorScope::Current()->masm()->Set(fresh.reg(), 77 CodeGeneratorScope::Current()->masm()->
75 Immediate(handle())); 78 movq(fresh.reg(), handle(), RelocInfo::EMBEDDED_OBJECT);
76 } 79 }
77 */
78 } 80 }
79 *this = fresh; 81 *this = fresh;
80 } else if (is_register() && reg().is(target)) { 82 } else if (is_register() && reg().is(target)) {
81 ASSERT(CodeGeneratorScope::Current()->has_valid_frame()); 83 ASSERT(CodeGeneratorScope::Current()->has_valid_frame());
82 CodeGeneratorScope::Current()->frame()->Spill(target); 84 CodeGeneratorScope::Current()->frame()->Spill(target);
83 ASSERT(CodeGeneratorScope::Current()->allocator()->count(target) == 1); 85 ASSERT(CodeGeneratorScope::Current()->allocator()->count(target) == 1);
84 } 86 }
85 ASSERT(is_register()); 87 ASSERT(is_register());
86 ASSERT(reg().is(target)); 88 ASSERT(reg().is(target));
87 } 89 }
88 90
89 91
90 } } // namespace v8::internal 92 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | src/x64/virtual-frame-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698