| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index e1b89a41a9c9751d79e9a4736c5befa5c399c4f5..23c373fa0b461e7a911ec9ac90a9575ea7f36feb 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -1831,19 +1831,6 @@ HValue* HGraphBuilder::BuildCreateAllocationMemento(HValue* previous_object,
|
| Handle<Map> alloc_memento_map(
|
| isolate()->heap()->allocation_memento_map());
|
| AddStoreMapConstant(alloc_memento, alloc_memento_map);
|
| -
|
| - {
|
| - // TODO(mvstanton): the code below is turned on to diagnose chromium bug
|
| - // 284577.
|
| - Handle<Map> alloc_site_map(isolate()->heap()->allocation_site_map());
|
| - IfBuilder builder(this);
|
| - builder.If<HCompareMap>(alloc_site, alloc_site_map);
|
| - builder.Then();
|
| - builder.Else();
|
| - Add<HDebugBreak>();
|
| - builder.End();
|
| - }
|
| -
|
| HObjectAccess access = HObjectAccess::ForAllocationMementoSite();
|
| Add<HStoreNamedField>(alloc_memento, access, alloc_site);
|
| return alloc_memento;
|
| @@ -4185,7 +4172,8 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) {
|
| IsFastLiteral(Handle<JSObject>::cast(boilerplate),
|
| kMaxFastLiteralDepth,
|
| &max_properties)) {
|
| - Handle<JSObject> boilerplate_object = Handle<JSObject>::cast(boilerplate);
|
| + Handle<JSObject> boilerplate_object =
|
| + Handle<JSObject>::cast(boilerplate);
|
|
|
| literal = BuildFastLiteral(boilerplate_object,
|
| Handle<Object>::null(),
|
| @@ -5148,7 +5136,9 @@ void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) {
|
| CHECK_ALIVE(VisitForValue(prop->obj()));
|
| HValue* object = Top();
|
| HValue* key = NULL;
|
| - if ((!prop->IsFunctionPrototype() && !prop->key()->IsPropertyName()) ||
|
| + if ((!prop->IsStringLength() &&
|
| + !prop->IsFunctionPrototype() &&
|
| + !prop->key()->IsPropertyName()) ||
|
| prop->IsStringAccess()) {
|
| CHECK_ALIVE(VisitForValue(prop->key()));
|
| key = Top();
|
| @@ -5838,20 +5828,17 @@ void HOptimizedGraphBuilder::PushLoad(Property* expr,
|
| }
|
|
|
|
|
| -static bool AreStringTypes(SmallMapList* types) {
|
| - if (types == NULL || types->length() == 0) return false;
|
| - for (int i = 0; i < types->length(); i++) {
|
| - if (types->at(i)->instance_type() >= FIRST_NONSTRING_TYPE) return false;
|
| - }
|
| - return true;
|
| -}
|
| -
|
| -
|
| void HOptimizedGraphBuilder::BuildLoad(Property* expr,
|
| int position,
|
| BailoutId ast_id) {
|
| HInstruction* instr = NULL;
|
| - if (expr->IsStringAccess()) {
|
| + if (expr->IsStringLength()) {
|
| + HValue* string = Pop();
|
| + BuildCheckHeapObject(string);
|
| + HInstruction* checkstring =
|
| + AddInstruction(HCheckInstanceType::NewIsString(string, zone()));
|
| + instr = BuildLoadStringLength(string, checkstring);
|
| + } else if (expr->IsStringAccess()) {
|
| HValue* index = Pop();
|
| HValue* string = Pop();
|
| HValue* context = environment()->context();
|
| @@ -5887,12 +5874,6 @@ void HOptimizedGraphBuilder::BuildLoad(Property* expr,
|
| } else {
|
| instr = BuildLoadNamedMonomorphic(Pop(), name, map);
|
| }
|
| - } else if (AreStringTypes(types) &&
|
| - name->Equals(isolate()->heap()->length_string())) {
|
| - BuildCheckHeapObject(Pop());
|
| - HValue* checked_object =
|
| - AddInstruction(HCheckInstanceType::NewIsString(object, zone()));
|
| - instr = BuildLoadStringLength(object, checked_object);
|
| } else if (types != NULL && types->length() > 1) {
|
| return HandlePolymorphicLoadNamedField(
|
| position, ast_id, Pop(), types, name);
|
| @@ -5933,7 +5914,9 @@ void HOptimizedGraphBuilder::VisitProperty(Property* expr) {
|
| if (TryArgumentsAccess(expr)) return;
|
|
|
| CHECK_ALIVE(VisitForValue(expr->obj()));
|
| - if ((!expr->IsFunctionPrototype() && !expr->key()->IsPropertyName()) ||
|
| + if ((!expr->IsStringLength() &&
|
| + !expr->IsFunctionPrototype() &&
|
| + !expr->key()->IsPropertyName()) ||
|
| expr->IsStringAccess()) {
|
| CHECK_ALIVE(VisitForValue(expr->key()));
|
| }
|
| @@ -7584,7 +7567,9 @@ void HOptimizedGraphBuilder::VisitCountOperation(CountOperation* expr) {
|
| HValue* object = Top();
|
|
|
| HValue* key = NULL;
|
| - if ((!prop->IsFunctionPrototype() && !prop->key()->IsPropertyName()) ||
|
| + if ((!prop->IsStringLength() &&
|
| + !prop->IsFunctionPrototype() &&
|
| + !prop->key()->IsPropertyName()) ||
|
| prop->IsStringAccess()) {
|
| CHECK_ALIVE(VisitForValue(prop->key()));
|
| key = Top();
|
|
|