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

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

Issue 369003: In the toplevel code generator, suppor local context allocation... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 1 month 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/ia32/fast-codegen-ia32.cc ('k') | 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 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 __ push(rsi); // Callee's context. 60 __ push(rsi); // Callee's context.
61 __ push(rdi); // Callee's JS Function. 61 __ push(rdi); // Callee's JS Function.
62 62
63 { Comment cmnt(masm_, "[ Allocate locals"); 63 { Comment cmnt(masm_, "[ Allocate locals");
64 int locals_count = fun->scope()->num_stack_slots(); 64 int locals_count = fun->scope()->num_stack_slots();
65 for (int i = 0; i < locals_count; i++) { 65 for (int i = 0; i < locals_count; i++) {
66 __ PushRoot(Heap::kUndefinedValueRootIndex); 66 __ PushRoot(Heap::kUndefinedValueRootIndex);
67 } 67 }
68 } 68 }
69 69
70 // Possibly allocate a local context.
71 if (fun->scope()->num_heap_slots() > 0) {
72 Comment cmnt(masm_, "[ Allocate local context");
73 // Argument to NewContext is the function, still in rdi.
74 __ push(rdi);
75 __ CallRuntime(Runtime::kNewContext, 1);
76 // Context is returned in both rax and rsi. It replaces the context
77 // passed to us. It's saved in the stack and kept live in rsi.
78 __ movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi);
79 #ifdef DEBUG
80 // Assert we do not have to copy any parameters into the context.
81 for (int i = 0, len = fun->scope()->num_parameters(); i < len; i++) {
82 Slot* slot = fun->scope()->parameter(i)->slot();
83 ASSERT(slot != NULL && slot->type() != Slot::CONTEXT);
84 }
85 #endif
86 }
87
70 { Comment cmnt(masm_, "[ Stack check"); 88 { Comment cmnt(masm_, "[ Stack check");
71 Label ok; 89 Label ok;
72 __ CompareRoot(rsp, Heap::kStackLimitRootIndex); 90 __ CompareRoot(rsp, Heap::kStackLimitRootIndex);
73 __ j(above_equal, &ok); 91 __ j(above_equal, &ok);
74 StackCheckStub stub; 92 StackCheckStub stub;
75 __ CallStub(&stub); 93 __ CallStub(&stub);
76 __ bind(&ok); 94 __ bind(&ok);
77 } 95 }
78 96
79 { Comment cmnt(masm_, "[ Declarations"); 97 { Comment cmnt(masm_, "[ Declarations");
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 true_label_ = saved_true; 1299 true_label_ = saved_true;
1282 false_label_ = saved_false; 1300 false_label_ = saved_false;
1283 // Convert current context to test context: End post-test code. 1301 // Convert current context to test context: End post-test code.
1284 } 1302 }
1285 1303
1286 1304
1287 #undef __ 1305 #undef __
1288 1306
1289 1307
1290 } } // namespace v8::internal 1308 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/fast-codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698