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

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

Issue 551189: Propagate receiver from initial call site to code generator. (Closed)
Patch Set: Created 10 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 19 matching lines...) Expand all
30 30
31 #include "v8.h" 31 #include "v8.h"
32 32
33 #include "ast.h" 33 #include "ast.h"
34 34
35 namespace v8 { 35 namespace v8 {
36 namespace internal { 36 namespace internal {
37 37
38 class FastCodeGenSyntaxChecker: public AstVisitor { 38 class FastCodeGenSyntaxChecker: public AstVisitor {
39 public: 39 public:
40 FastCodeGenSyntaxChecker() : has_supported_syntax_(true) {} 40 explicit FastCodeGenSyntaxChecker(Handle<Object> receiver)
41 : receiver_(receiver), has_supported_syntax_(true) {
42 }
41 43
42 void Check(FunctionLiteral* fun); 44 void Check(FunctionLiteral* fun);
43 45
46 Handle<Object> receiver() { return receiver_; }
44 bool has_supported_syntax() { return has_supported_syntax_; } 47 bool has_supported_syntax() { return has_supported_syntax_; }
45 48
46 private: 49 private:
47 void VisitDeclarations(ZoneList<Declaration*>* decls); 50 void VisitDeclarations(ZoneList<Declaration*>* decls);
48 void VisitStatements(ZoneList<Statement*>* stmts); 51 void VisitStatements(ZoneList<Statement*>* stmts);
49 52
50 // AST node visit functions. 53 // AST node visit functions.
51 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); 54 #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
52 AST_NODE_LIST(DECLARE_VISIT) 55 AST_NODE_LIST(DECLARE_VISIT)
53 #undef DECLARE_VISIT 56 #undef DECLARE_VISIT
54 57
58 Handle<Object> receiver_;
55 bool has_supported_syntax_; 59 bool has_supported_syntax_;
56 60
57 DISALLOW_COPY_AND_ASSIGN(FastCodeGenSyntaxChecker); 61 DISALLOW_COPY_AND_ASSIGN(FastCodeGenSyntaxChecker);
58 }; 62 };
59 63
60 64
61 } } // namespace v8::internal 65 } } // namespace v8::internal
62 66
63 #endif // V8_FAST_CODEGEN_H_ 67 #endif // V8_FAST_CODEGEN_H_
OLDNEW
« src/compiler.h ('K') | « src/debug.cc ('k') | src/fast-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698