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

Side by Side Diff: src/hydrogen.cc

Issue 22272002: Work in progress: don't optimize increment/decrements on frozen objects (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 | « no previous file | src/objects.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 7442 matching lines...) Expand 10 before | Expand all | Expand 10 after
7453 } 7453 }
7454 7454
7455 case Variable::LOOKUP: 7455 case Variable::LOOKUP:
7456 return Bailout(kLookupVariableInCountOperation); 7456 return Bailout(kLookupVariableInCountOperation);
7457 } 7457 }
7458 7458
7459 } else { 7459 } else {
7460 // Argument of the count operation is a property. 7460 // Argument of the count operation is a property.
7461 ASSERT(prop != NULL); 7461 ASSERT(prop != NULL);
7462 7462
7463 SmallMapList* types = prop->GetReceiverTypes();
7464 for (int i = 0; i < types->length(); ++i) {
7465 if (types->at(i)->is_frozen()) {
7466 return Bailout(kFrozenObjectInCountOperation);
Mark Miller 2013/08/07 18:36:07 Do you want to bail on the object being frozen, or
7467 }
7468 }
7469
7463 if (prop->key()->IsPropertyName()) { 7470 if (prop->key()->IsPropertyName()) {
7464 // Named property. 7471 // Named property.
7465 if (returns_original_input) Push(graph()->GetConstantUndefined()); 7472 if (returns_original_input) Push(graph()->GetConstantUndefined());
7466 7473
7467 CHECK_ALIVE(VisitForValue(prop->obj())); 7474 CHECK_ALIVE(VisitForValue(prop->obj()));
7468 HValue* object = Top(); 7475 HValue* object = Top();
7469 7476
7470 Handle<String> name = prop->key()->AsLiteral()->AsPropertyName(); 7477 Handle<String> name = prop->key()->AsLiteral()->AsPropertyName();
7471 Handle<Map> map; 7478 Handle<Map> map;
7472 HInstruction* load = NULL; 7479 HInstruction* load = NULL;
7473 bool monomorphic = prop->IsMonomorphic(); 7480 bool monomorphic = prop->IsMonomorphic();
7474 SmallMapList* types = prop->GetReceiverTypes();
7475 if (monomorphic) { 7481 if (monomorphic) {
7476 map = types->first(); 7482 map = types->first();
7477 if (map->is_dictionary_map()) monomorphic = false; 7483 if (map->is_dictionary_map()) monomorphic = false;
7478 } 7484 }
7479 if (monomorphic) { 7485 if (monomorphic) {
7480 Handle<JSFunction> getter; 7486 Handle<JSFunction> getter;
7481 Handle<JSObject> holder; 7487 Handle<JSObject> holder;
7482 if (LookupGetter(map, name, &getter, &holder)) { 7488 if (LookupGetter(map, name, &getter, &holder)) {
7483 load = BuildCallGetter(object, map, getter, holder); 7489 load = BuildCallGetter(object, map, getter, holder);
7484 } else { 7490 } else {
(...skipping 2244 matching lines...) Expand 10 before | Expand all | Expand 10 after
9729 if (ShouldProduceTraceOutput()) { 9735 if (ShouldProduceTraceOutput()) {
9730 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 9736 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
9731 } 9737 }
9732 9738
9733 #ifdef DEBUG 9739 #ifdef DEBUG
9734 graph_->Verify(false); // No full verify. 9740 graph_->Verify(false); // No full verify.
9735 #endif 9741 #endif
9736 } 9742 }
9737 9743
9738 } } // namespace v8::internal 9744 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698