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

Side by Side Diff: src/parser.cc

Issue 507036: Use one runtime call for creating object/array literals in... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/fast-codegen-ia32.cc ('k') | src/x64/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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 3314 matching lines...) Expand 10 before | Expand all | Expand 10 after
3325 Handle<FixedArray> result = Factory::NewFixedArray(2, TENURED); 3325 Handle<FixedArray> result = Factory::NewFixedArray(2, TENURED);
3326 ObjectLiteral* object_literal = expression->AsObjectLiteral(); 3326 ObjectLiteral* object_literal = expression->AsObjectLiteral();
3327 if (object_literal != NULL) { 3327 if (object_literal != NULL) {
3328 ASSERT(object_literal->is_simple()); 3328 ASSERT(object_literal->is_simple());
3329 result->set(kTypeSlot, Smi::FromInt(OBJECT_LITERAL)); 3329 result->set(kTypeSlot, Smi::FromInt(OBJECT_LITERAL));
3330 result->set(kElementsSlot, *object_literal->constant_properties()); 3330 result->set(kElementsSlot, *object_literal->constant_properties());
3331 } else { 3331 } else {
3332 ArrayLiteral* array_literal = expression->AsArrayLiteral(); 3332 ArrayLiteral* array_literal = expression->AsArrayLiteral();
3333 ASSERT(array_literal != NULL && array_literal->is_simple()); 3333 ASSERT(array_literal != NULL && array_literal->is_simple());
3334 result->set(kTypeSlot, Smi::FromInt(ARRAY_LITERAL)); 3334 result->set(kTypeSlot, Smi::FromInt(ARRAY_LITERAL));
3335 result->set(kElementsSlot, *array_literal->literals()); 3335 result->set(kElementsSlot, *array_literal->constant_elements());
3336 } 3336 }
3337 return result; 3337 return result;
3338 } 3338 }
3339 3339
3340 3340
3341 CompileTimeValue::Type CompileTimeValue::GetType(Handle<FixedArray> value) { 3341 CompileTimeValue::Type CompileTimeValue::GetType(Handle<FixedArray> value) {
3342 Smi* type_value = Smi::cast(value->get(kTypeSlot)); 3342 Smi* type_value = Smi::cast(value->get(kTypeSlot));
3343 return static_cast<Type>(type_value->value()); 3343 return static_cast<Type>(type_value->value());
3344 } 3344 }
3345 3345
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after
4790 start_position, 4790 start_position,
4791 is_expression); 4791 is_expression);
4792 return result; 4792 return result;
4793 } 4793 }
4794 4794
4795 4795
4796 #undef NEW 4796 #undef NEW
4797 4797
4798 4798
4799 } } // namespace v8::internal 4799 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/fast-codegen-ia32.cc ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698