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

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

Issue 435003: Patch for allowing several V8 instances in process:... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years 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/regexp-stack.cc ('k') | src/rewriter.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 27 matching lines...) Expand all
38 38
39 39
40 Result::Result(Register reg) { 40 Result::Result(Register reg) {
41 ASSERT(reg.is_valid() && !RegisterAllocator::IsReserved(reg)); 41 ASSERT(reg.is_valid() && !RegisterAllocator::IsReserved(reg));
42 CodeGeneratorScope::Current()->allocator()->Use(reg); 42 CodeGeneratorScope::Current()->allocator()->Use(reg);
43 value_ = TypeField::encode(REGISTER) | DataField::encode(reg.code_); 43 value_ = TypeField::encode(REGISTER) | DataField::encode(reg.code_);
44 } 44 }
45 45
46 46
47 Result::ZoneObjectList* Result::ConstantList() { 47 Result::ZoneObjectList* Result::ConstantList() {
48 static ZoneObjectList list(10); 48 return v8_context()->code_generator_data_.result_constants_list();
49 return &list;
50 } 49 }
51 50
52 51
53 // ------------------------------------------------------------------------- 52 // -------------------------------------------------------------------------
54 // RegisterAllocator implementation. 53 // RegisterAllocator implementation.
55 54
56 55
57 Result RegisterAllocator::AllocateWithoutSpilling() { 56 Result RegisterAllocator::AllocateWithoutSpilling() {
58 // Return the first free register, if any. 57 // Return the first free register, if any.
59 int num = registers_.ScanForFreeRegister(); 58 int num = registers_.ScanForFreeRegister();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 cgen_->frame()->Spill(target); 90 cgen_->frame()->Spill(target);
92 ASSERT(!is_used(target)); 91 ASSERT(!is_used(target));
93 return Result(target); 92 return Result(target);
94 } 93 }
95 // Otherwise (if it's referenced outside the frame) we cannot allocate it. 94 // Otherwise (if it's referenced outside the frame) we cannot allocate it.
96 return Result(); 95 return Result();
97 } 96 }
98 97
99 98
100 } } // namespace v8::internal 99 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/regexp-stack.cc ('k') | src/rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698