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

Side by Side Diff: src/fast-codegen.h

Issue 342073: Refactor the somewhat complicated code generation for assignments into... (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/compiler.cc ('k') | src/fast-codegen.cc » ('j') | 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // control flow to a pair of labels. 68 // control flow to a pair of labels.
69 void TestAndBranch(Register source, Label* true_label, Label* false_label); 69 void TestAndBranch(Register source, Label* true_label, Label* false_label);
70 70
71 void VisitDeclarations(ZoneList<Declaration*>* declarations); 71 void VisitDeclarations(ZoneList<Declaration*>* declarations);
72 Handle<JSFunction> BuildBoilerplate(FunctionLiteral* fun); 72 Handle<JSFunction> BuildBoilerplate(FunctionLiteral* fun);
73 void DeclareGlobals(Handle<FixedArray> pairs); 73 void DeclareGlobals(Handle<FixedArray> pairs);
74 74
75 void EmitCallWithStub(Call* expr); 75 void EmitCallWithStub(Call* expr);
76 void EmitCallWithIC(Call* expr, RelocInfo::Mode reloc_info); 76 void EmitCallWithIC(Call* expr, RelocInfo::Mode reloc_info);
77 77
78 // Platform-specific support for compiling assignments.
79
80 // Complete a variable assignment. The right-hand-side value are expected
81 // on top of the stack.
82 void EmitVariableAssignment(Expression::Context context, Variable* var);
83
84 // Complete a named property assignment. The receiver and right-hand-side
85 // value are expected on top of the stack.
86 void EmitNamedPropertyAssignment(Expression::Context context,
87 Handle<Object> name);
88
89 // Complete a keyed property assignment. The reciever, key, and
90 // right-hand-side value are expected on top of the stack.
91 void EmitKeyedPropertyAssignment(Expression::Context context);
92
78 void SetFunctionPosition(FunctionLiteral* fun); 93 void SetFunctionPosition(FunctionLiteral* fun);
79 void SetReturnPosition(FunctionLiteral* fun); 94 void SetReturnPosition(FunctionLiteral* fun);
80 void SetStatementPosition(Statement* stmt); 95 void SetStatementPosition(Statement* stmt);
81 void SetSourcePosition(int pos); 96 void SetSourcePosition(int pos);
82 97
83 // AST node visit functions. 98 // AST node visit functions.
84 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); 99 #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
85 AST_NODE_LIST(DECLARE_VISIT) 100 AST_NODE_LIST(DECLARE_VISIT)
86 #undef DECLARE_VISIT 101 #undef DECLARE_VISIT
87 102
88 // Handles the shortcutted logical binary operations in VisitBinaryOperation. 103 // Handles the shortcutted logical binary operations in VisitBinaryOperation.
89 void EmitLogicalOperation(BinaryOperation* expr); 104 void EmitLogicalOperation(BinaryOperation* expr);
90 105
91 MacroAssembler* masm_; 106 MacroAssembler* masm_;
92 FunctionLiteral* function_; 107 FunctionLiteral* function_;
93 Handle<Script> script_; 108 Handle<Script> script_;
94 bool is_eval_; 109 bool is_eval_;
95 Label return_label_; 110 Label return_label_;
96 111
97 Label* true_label_; 112 Label* true_label_;
98 Label* false_label_; 113 Label* false_label_;
99 114
100 DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator); 115 DISALLOW_COPY_AND_ASSIGN(FastCodeGenerator);
101 }; 116 };
102 117
103 118
104 } } // namespace v8::internal 119 } } // namespace v8::internal
105 120
106 #endif // V8_FAST_CODEGEN_H_ 121 #endif // V8_FAST_CODEGEN_H_
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/fast-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698