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

Unified Diff: src/fast-codegen.cc

Issue 491077: Fast codegen: Implement with. (Closed)
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 side-by-side diff with in-line comments
Download patch
Index: src/fast-codegen.cc
diff --git a/src/fast-codegen.cc b/src/fast-codegen.cc
index c63522455306c95566300f1d7f661b4c9d1861e7..7f75ef14abc9cfd64bc8377707788338482269d5 100644
--- a/src/fast-codegen.cc
+++ b/src/fast-codegen.cc
@@ -337,12 +337,34 @@ void FastCodeGenerator::VisitReturnStatement(ReturnStatement* stmt) {
void FastCodeGenerator::VisitWithEnterStatement(WithEnterStatement* stmt) {
- UNREACHABLE();
+ Comment cmnt(masm_, "[ WithEnterStatement");
+ if (FLAG_debug_info) {
Kevin Millikin (Chromium) 2009/12/14 16:35:47 SetStatementPosition(stmt)?
Lasse Reichstein 2009/12/16 13:40:31 Should have known it would be in the fast codegen
+ CodeGenerator::RecordPositions(masm(), stmt->statement_pos());
+ }
+
+ Visit(stmt->expression());
+ if (stmt->is_catch_block()) {
+ __ CallRuntime(Runtime::kPushCatchContext, 1);
+ } else {
+ __ CallRuntime(Runtime::kPushContext, 1);
+ }
+ // Both runtime calls return the new context in both the context and the
+ // result registers.
+
+ // Update local stack frame context field.
+ StoreFrameField(StandardFrameConstants::kContextOffset, context_register());
}
void FastCodeGenerator::VisitWithExitStatement(WithExitStatement* stmt) {
- UNREACHABLE();
+ Comment cmnt(masm_, "[ WithExitStatement");
+ if (FLAG_debug_info) {
Kevin Millikin (Chromium) 2009/12/14 16:35:47 Same.
Lasse Reichstein 2009/12/16 13:40:31 Fixed.
+ CodeGenerator::RecordPositions(masm(), stmt->statement_pos());
+ }
+ // Pop context.
+ LoadContextField(context_register(), Context::PREVIOUS_INDEX);
+ // Update local stack frame context field.
+ StoreFrameField(StandardFrameConstants::kContextOffset, context_register());
}
« src/fast-codegen.h ('K') | « src/fast-codegen.h ('k') | src/ia32/fast-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698