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

Side by Side Diff: src/x64/codegen-x64.cc

Issue 805004: Do not waste space for the fast-case elements backing storage for ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 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
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 2406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2417 2417
2418 // Load the literals array of the function. 2418 // Load the literals array of the function.
2419 __ movq(literals.reg(), 2419 __ movq(literals.reg(),
2420 FieldOperand(literals.reg(), JSFunction::kLiteralsOffset)); 2420 FieldOperand(literals.reg(), JSFunction::kLiteralsOffset));
2421 // Literal array. 2421 // Literal array.
2422 frame_->Push(&literals); 2422 frame_->Push(&literals);
2423 // Literal index. 2423 // Literal index.
2424 frame_->Push(Smi::FromInt(node->literal_index())); 2424 frame_->Push(Smi::FromInt(node->literal_index()));
2425 // Constant properties. 2425 // Constant properties.
2426 frame_->Push(node->constant_properties()); 2426 frame_->Push(node->constant_properties());
2427 // Should the object literal have fast elements?
2428 frame_->Push(Smi::FromInt(node->fast_elements() ? 1 : 0));
2427 Result clone; 2429 Result clone;
2428 if (node->depth() > 1) { 2430 if (node->depth() > 1) {
2429 clone = frame_->CallRuntime(Runtime::kCreateObjectLiteral, 3); 2431 clone = frame_->CallRuntime(Runtime::kCreateObjectLiteral, 4);
2430 } else { 2432 } else {
2431 clone = frame_->CallRuntime(Runtime::kCreateObjectLiteralShallow, 3); 2433 clone = frame_->CallRuntime(Runtime::kCreateObjectLiteralShallow, 4);
2432 } 2434 }
2433 frame_->Push(&clone); 2435 frame_->Push(&clone);
2434 2436
2435 for (int i = 0; i < node->properties()->length(); i++) { 2437 for (int i = 0; i < node->properties()->length(); i++) {
2436 ObjectLiteral::Property* property = node->properties()->at(i); 2438 ObjectLiteral::Property* property = node->properties()->at(i);
2437 switch (property->kind()) { 2439 switch (property->kind()) {
2438 case ObjectLiteral::Property::CONSTANT: 2440 case ObjectLiteral::Property::CONSTANT:
2439 break; 2441 break;
2440 case ObjectLiteral::Property::MATERIALIZED_LITERAL: 2442 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
2441 if (CompileTimeValue::IsCompileTimeValue(property->value())) break; 2443 if (CompileTimeValue::IsCompileTimeValue(property->value())) break;
(...skipping 7354 matching lines...) Expand 10 before | Expand all | Expand 10 after
9796 // Call the function from C++. 9798 // Call the function from C++.
9797 return FUNCTION_CAST<ModuloFunction>(buffer); 9799 return FUNCTION_CAST<ModuloFunction>(buffer);
9798 } 9800 }
9799 9801
9800 #endif 9802 #endif
9801 9803
9802 9804
9803 #undef __ 9805 #undef __
9804 9806
9805 } } // namespace v8::internal 9807 } } // namespace v8::internal
OLDNEW
« src/runtime.cc ('K') | « src/runtime.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698