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

Unified Diff: src/hydrogen.cc

Issue 23890030: Rollback trunk to 3.21.15. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/heap.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698