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

Unified Diff: src/full-codegen.cc

Issue 631433002: Classes runtime (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove kConstructorFunction 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/compiler/pipeline.cc ('k') | src/messages.js » ('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 35d51d982ed44f9edffc77ff8f249338fe42cca2..8177a35ed8efbfb0b061c5bc95c68a5cffc8102d 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -1542,12 +1542,30 @@ void FullCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
void FullCodeGenerator::VisitClassLiteral(ClassLiteral* expr) {
- // TODO(arv): Implement
Comment cmnt(masm_, "[ ClassLiteral");
+
+ if (expr->raw_name() != NULL) {
+ __ Push(expr->name());
+ } else {
+ __ Push(isolate()->factory()->undefined_value());
+ }
+
if (expr->extends() != NULL) {
- VisitForEffect(expr->extends());
+ VisitForStackValue(expr->extends());
+ } else {
+ __ Push(isolate()->factory()->the_hole_value());
}
- context()->Plug(isolate()->factory()->undefined_value());
+
+ if (expr->constructor() != NULL) {
+ VisitForStackValue(expr->constructor());
+ } else {
+ __ Push(isolate()->factory()->undefined_value());
+ }
+
+ // TODO(arv): Process methods
+
+ __ CallRuntime(Runtime::kDefineClass, 3);
+ context()->Plug(result_register());
}
« no previous file with comments | « src/compiler/pipeline.cc ('k') | src/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698