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

Side by Side Diff: src/parser.cc

Issue 17580018: Removed some useless/dead code regarding CompileTimeValues. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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/parser.h ('k') | src/x64/full-codegen-x64.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 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 3716 matching lines...) Expand 10 before | Expand all | Expand 10 after
3727 } 3727 }
3728 3728
3729 3729
3730 bool CompileTimeValue::IsCompileTimeValue(Expression* expression) { 3730 bool CompileTimeValue::IsCompileTimeValue(Expression* expression) {
3731 if (expression->AsLiteral() != NULL) return true; 3731 if (expression->AsLiteral() != NULL) return true;
3732 MaterializedLiteral* lit = expression->AsMaterializedLiteral(); 3732 MaterializedLiteral* lit = expression->AsMaterializedLiteral();
3733 return lit != NULL && lit->is_simple(); 3733 return lit != NULL && lit->is_simple();
3734 } 3734 }
3735 3735
3736 3736
3737 bool CompileTimeValue::ArrayLiteralElementNeedsInitialization(
3738 Expression* value) {
3739 // If value is a literal the property value is already set in the
3740 // boilerplate object.
3741 if (value->AsLiteral() != NULL) return false;
3742 // If value is a materialized literal the property value is already set
3743 // in the boilerplate object if it is simple.
3744 if (CompileTimeValue::IsCompileTimeValue(value)) return false;
3745 return true;
3746 }
3747
3748
3749 Handle<FixedArray> CompileTimeValue::GetValue(Expression* expression) { 3737 Handle<FixedArray> CompileTimeValue::GetValue(Expression* expression) {
3750 Factory* factory = Isolate::Current()->factory(); 3738 Factory* factory = Isolate::Current()->factory();
3751 ASSERT(IsCompileTimeValue(expression)); 3739 ASSERT(IsCompileTimeValue(expression));
3752 Handle<FixedArray> result = factory->NewFixedArray(2, TENURED); 3740 Handle<FixedArray> result = factory->NewFixedArray(2, TENURED);
3753 ObjectLiteral* object_literal = expression->AsObjectLiteral(); 3741 ObjectLiteral* object_literal = expression->AsObjectLiteral();
3754 if (object_literal != NULL) { 3742 if (object_literal != NULL) {
3755 ASSERT(object_literal->is_simple()); 3743 ASSERT(object_literal->is_simple());
3756 if (object_literal->fast_elements()) { 3744 if (object_literal->fast_elements()) {
3757 result->set(kLiteralTypeSlot, Smi::FromInt(OBJECT_LITERAL_FAST_ELEMENTS)); 3745 result->set(kLiteralTypeSlot, Smi::FromInt(OBJECT_LITERAL_FAST_ELEMENTS));
3758 } else { 3746 } else {
(...skipping 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after
5937 ASSERT(info()->isolate()->has_pending_exception()); 5925 ASSERT(info()->isolate()->has_pending_exception());
5938 } else { 5926 } else {
5939 result = ParseProgram(); 5927 result = ParseProgram();
5940 } 5928 }
5941 } 5929 }
5942 info()->SetFunction(result); 5930 info()->SetFunction(result);
5943 return (result != NULL); 5931 return (result != NULL);
5944 } 5932 }
5945 5933
5946 } } // namespace v8::internal 5934 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/parser.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698