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

Unified Diff: src/full-codegen.cc

Issue 624013005: Classes: Add support for toString (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add type checks Created 6 years, 2 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/ast.h ('k') | src/heap/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index 8177a35ed8efbfb0b061c5bc95c68a5cffc8102d..a5814c51f2e90638f538db2b2c0460f30d52818b 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -1541,30 +1541,34 @@ void FullCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
}
-void FullCodeGenerator::VisitClassLiteral(ClassLiteral* expr) {
+void FullCodeGenerator::VisitClassLiteral(ClassLiteral* lit) {
Comment cmnt(masm_, "[ ClassLiteral");
- if (expr->raw_name() != NULL) {
- __ Push(expr->name());
+ if (lit->raw_name() != NULL) {
+ __ Push(lit->name());
} else {
__ Push(isolate()->factory()->undefined_value());
}
- if (expr->extends() != NULL) {
- VisitForStackValue(expr->extends());
+ if (lit->extends() != NULL) {
+ VisitForStackValue(lit->extends());
} else {
__ Push(isolate()->factory()->the_hole_value());
}
- if (expr->constructor() != NULL) {
- VisitForStackValue(expr->constructor());
+ if (lit->constructor() != NULL) {
+ VisitForStackValue(lit->constructor());
} else {
__ Push(isolate()->factory()->undefined_value());
}
+ __ Push(script());
+ __ Push(Smi::FromInt(lit->start_position()));
+ __ Push(Smi::FromInt(lit->end_position()));
+
// TODO(arv): Process methods
- __ CallRuntime(Runtime::kDefineClass, 3);
+ __ CallRuntime(Runtime::kDefineClass, 6);
context()->Plug(result_register());
}
« no previous file with comments | « src/ast.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698