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

Side by Side Diff: src/ast.cc

Issue 9348057: Split AST Declaration class, in preparation for new module declaration forms. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Jakob's comments. Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/ast.h ('k') | src/full-codegen.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 bool CompareOperation::IsLiteralCompareNull(Expression** expr) { 412 bool CompareOperation::IsLiteralCompareNull(Expression** expr) {
413 return MatchLiteralCompareNull(left_, op_, right_, expr) || 413 return MatchLiteralCompareNull(left_, op_, right_, expr) ||
414 MatchLiteralCompareNull(right_, op_, left_, expr); 414 MatchLiteralCompareNull(right_, op_, left_, expr);
415 } 415 }
416 416
417 417
418 // ---------------------------------------------------------------------------- 418 // ----------------------------------------------------------------------------
419 // Inlining support 419 // Inlining support
420 420
421 bool Declaration::IsInlineable() const { 421 bool Declaration::IsInlineable() const {
422 return proxy()->var()->IsStackAllocated() && fun() == NULL; 422 return proxy()->var()->IsStackAllocated();
423 }
424
425 bool VariableDeclaration::IsInlineable() const {
426 return Declaration::IsInlineable() && fun() == NULL;
423 } 427 }
424 428
425 429
426 // ---------------------------------------------------------------------------- 430 // ----------------------------------------------------------------------------
427 // Recording of type feedback 431 // Recording of type feedback
428 432
429 void Property::RecordTypeFeedback(TypeFeedbackOracle* oracle) { 433 void Property::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
430 // Record type feedback from the oracle in the AST. 434 // Record type feedback from the oracle in the AST.
431 is_monomorphic_ = oracle->LoadIsMonomorphicNormal(this); 435 is_monomorphic_ = oracle->LoadIsMonomorphicNormal(this);
432 receiver_types_.Clear(); 436 receiver_types_.Clear();
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 compare_id_(AstNode::GetNextId(isolate)), 992 compare_id_(AstNode::GetNextId(isolate)),
989 entry_id_(AstNode::GetNextId(isolate)) { 993 entry_id_(AstNode::GetNextId(isolate)) {
990 } 994 }
991 995
992 996
993 #define INCREASE_NODE_COUNT(NodeType) \ 997 #define INCREASE_NODE_COUNT(NodeType) \
994 void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \ 998 void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \
995 increase_node_count(); \ 999 increase_node_count(); \
996 } 1000 }
997 1001
998 INCREASE_NODE_COUNT(Declaration) 1002 INCREASE_NODE_COUNT(VariableDeclaration)
999 INCREASE_NODE_COUNT(Block) 1003 INCREASE_NODE_COUNT(Block)
1000 INCREASE_NODE_COUNT(ExpressionStatement) 1004 INCREASE_NODE_COUNT(ExpressionStatement)
1001 INCREASE_NODE_COUNT(EmptyStatement) 1005 INCREASE_NODE_COUNT(EmptyStatement)
1002 INCREASE_NODE_COUNT(IfStatement) 1006 INCREASE_NODE_COUNT(IfStatement)
1003 INCREASE_NODE_COUNT(ContinueStatement) 1007 INCREASE_NODE_COUNT(ContinueStatement)
1004 INCREASE_NODE_COUNT(BreakStatement) 1008 INCREASE_NODE_COUNT(BreakStatement)
1005 INCREASE_NODE_COUNT(ReturnStatement) 1009 INCREASE_NODE_COUNT(ReturnStatement)
1006 INCREASE_NODE_COUNT(Conditional) 1010 INCREASE_NODE_COUNT(Conditional)
1007 INCREASE_NODE_COUNT(Literal) 1011 INCREASE_NODE_COUNT(Literal)
1008 INCREASE_NODE_COUNT(Assignment) 1012 INCREASE_NODE_COUNT(Assignment)
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 (node->name()->IsEqualTo(CStrVector("_ArgumentsLength")) || 1147 (node->name()->IsEqualTo(CStrVector("_ArgumentsLength")) ||
1144 node->name()->IsEqualTo(CStrVector("_Arguments")))) { 1148 node->name()->IsEqualTo(CStrVector("_Arguments")))) {
1145 // Don't inline the %_ArgumentsLength or %_Arguments because their 1149 // Don't inline the %_ArgumentsLength or %_Arguments because their
1146 // implementation will not work. There is no stack frame to get them 1150 // implementation will not work. There is no stack frame to get them
1147 // from. 1151 // from.
1148 add_flag(kDontInline); 1152 add_flag(kDontInline);
1149 } 1153 }
1150 } 1154 }
1151 1155
1152 } } // namespace v8::internal 1156 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698