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

Unified Diff: src/x64/full-codegen-x64.cc

Issue 9722043: Refactor code generation for global declarations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/full-codegen-x64.cc
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
index 1de01791114cd58d2ead5a8b0af2a4b57d3fc416..84779cf56dde756759512d73d6a1c668f7e4179a 100644
--- a/src/x64/full-codegen-x64.cc
+++ b/src/x64/full-codegen-x64.cc
@@ -729,7 +729,10 @@ void FullCodeGenerator::VisitVariableDeclaration(
bool hole_init = mode == CONST || mode == CONST_HARMONY || mode == LET;
switch (variable->location()) {
case Variable::UNALLOCATED:
- ++global_count_;
+ globals_.Add(variable->name());
+ globals_.Add(variable->binding_needs_init()
+ ? isolate()->factory()->the_hole_value()
+ : isolate()->factory()->undefined_value());
break;
case Variable::PARAMETER:
@@ -783,9 +786,15 @@ void FullCodeGenerator::VisitFunctionDeclaration(
VariableProxy* proxy = declaration->proxy();
Variable* variable = proxy->var();
switch (variable->location()) {
- case Variable::UNALLOCATED:
- ++global_count_;
+ case Variable::UNALLOCATED: {
+ globals_.Add(variable->name());
+ Handle<SharedFunctionInfo> function =
+ Compiler::BuildFunctionInfo(declaration->fun(), script());
+ // Check for stack-overflow exception.
+ if (function.is_null()) return SetStackOverflow();
+ globals_.Add(function);
break;
+ }
case Variable::PARAMETER:
case Variable::LOCAL: {
@@ -831,7 +840,7 @@ void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) {
Variable* variable = proxy->var();
switch (variable->location()) {
case Variable::UNALLOCATED:
- ++global_count_;
+ // TODO(rossberg): initialize module instance object
break;
case Variable::CONTEXT: {
@@ -854,7 +863,7 @@ void FullCodeGenerator::VisitImportDeclaration(ImportDeclaration* declaration) {
Variable* variable = proxy->var();
switch (variable->location()) {
case Variable::UNALLOCATED:
- ++global_count_;
+ // TODO(rossberg)
break;
case Variable::CONTEXT: {
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698