Fix ARM performance regression on constructing array
and object literals by using the same logic as we use on IA-32. Review URL: http://codereview.chromium.org/53001 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1587 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
4e74725681
commit
70aa1fde83
@ -30,6 +30,7 @@
|
||||
#include "bootstrapper.h"
|
||||
#include "codegen-inl.h"
|
||||
#include "debug.h"
|
||||
#include "parser.h"
|
||||
#include "register-allocator-inl.h"
|
||||
#include "runtime.h"
|
||||
#include "scopes.h"
|
||||
@ -2755,7 +2756,7 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) {
|
||||
case ObjectLiteral::Property::CONSTANT:
|
||||
break;
|
||||
case ObjectLiteral::Property::MATERIALIZED_LITERAL:
|
||||
if (property->value()->AsMaterializedLiteral()->is_simple()) break;
|
||||
if (CompileTimeValue::IsCompileTimeValue(property->value())) break;
|
||||
// else fall through
|
||||
case ObjectLiteral::Property::COMPUTED: // fall through
|
||||
case ObjectLiteral::Property::PROTOTYPE: {
|
||||
@ -2881,14 +2882,18 @@ void CodeGenerator::VisitArrayLiteral(ArrayLiteral* node) {
|
||||
for (int i = 0; i < node->values()->length(); i++) {
|
||||
Expression* value = node->values()->at(i);
|
||||
|
||||
// If value is literal the property value is already
|
||||
// set in the boilerplate object.
|
||||
if (value->AsLiteral() == NULL) {
|
||||
// If value is a literal the property value is already set in the
|
||||
// boilerplate object.
|
||||
if (value->AsLiteral() != NULL) continue;
|
||||
// If value is a materialized literal the property value is already set
|
||||
// in the boilerplate object if it is simple.
|
||||
if (CompileTimeValue::IsCompileTimeValue(value)) continue;
|
||||
|
||||
// The property must be set by generated code.
|
||||
LoadAndSpill(value);
|
||||
frame_->EmitPop(r0);
|
||||
|
||||
// Fetch the object literal
|
||||
// Fetch the object literal.
|
||||
__ ldr(r1, frame_->Top());
|
||||
// Get the elements array.
|
||||
__ ldr(r1, FieldMemOperand(r1, JSObject::kElementsOffset));
|
||||
@ -2901,7 +2906,6 @@ void CodeGenerator::VisitArrayLiteral(ArrayLiteral* node) {
|
||||
__ mov(r3, Operand(offset));
|
||||
__ RecordWrite(r1, r3, r2);
|
||||
}
|
||||
}
|
||||
ASSERT(frame_->height() == original_height + 1);
|
||||
}
|
||||
|
||||
|
@ -30,10 +30,10 @@
|
||||
#include "bootstrapper.h"
|
||||
#include "codegen-inl.h"
|
||||
#include "debug.h"
|
||||
#include "parser.h"
|
||||
#include "register-allocator-inl.h"
|
||||
#include "runtime.h"
|
||||
#include "scopes.h"
|
||||
#include "parser.h"
|
||||
|
||||
namespace v8 { namespace internal {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user