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

Side by Side Diff: src/hydrogen.cc

Issue 1360723002: [crankshaft] Handle @@toStringTag accessor correctly for BuildCompareInstruction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | test/mjsunit/compare-known-objects-tostringtag.js » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/allocation-site-scopes.h" 9 #include "src/allocation-site-scopes.h"
10 #include "src/ast-numbering.h" 10 #include "src/ast-numbering.h"
(...skipping 11582 matching lines...) Expand 10 before | Expand all | Expand 10 after
11593 // even do that in Crankshaft but we don't want to waste too much 11593 // even do that in Crankshaft but we don't want to waste too much
11594 // time on this now). 11594 // time on this now).
11595 DCHECK(Token::IsOrderedRelationalCompareOp(op)); 11595 DCHECK(Token::IsOrderedRelationalCompareOp(op));
11596 Handle<Map> map = combined_type->AsClass()->Map(); 11596 Handle<Map> map = combined_type->AsClass()->Map();
11597 PropertyAccessInfo value_of(this, LOAD, map, 11597 PropertyAccessInfo value_of(this, LOAD, map,
11598 isolate()->factory()->valueOf_string()); 11598 isolate()->factory()->valueOf_string());
11599 PropertyAccessInfo to_primitive( 11599 PropertyAccessInfo to_primitive(
11600 this, LOAD, map, isolate()->factory()->to_primitive_symbol()); 11600 this, LOAD, map, isolate()->factory()->to_primitive_symbol());
11601 PropertyAccessInfo to_string(this, LOAD, map, 11601 PropertyAccessInfo to_string(this, LOAD, map,
11602 isolate()->factory()->toString_string()); 11602 isolate()->factory()->toString_string());
11603 PropertyAccessInfo to_string_tag(
11604 this, LOAD, map, isolate()->factory()->to_string_tag_symbol());
11603 if (to_primitive.CanAccessMonomorphic() && !to_primitive.IsFound() && 11605 if (to_primitive.CanAccessMonomorphic() && !to_primitive.IsFound() &&
11606 to_string_tag.CanAccessMonomorphic() &&
11607 (!to_string_tag.IsFound() || to_string_tag.IsData() ||
11608 to_string_tag.IsDataConstant()) &&
11604 value_of.CanAccessMonomorphic() && value_of.IsDataConstant() && 11609 value_of.CanAccessMonomorphic() && value_of.IsDataConstant() &&
11605 value_of.constant().is_identical_to(isolate()->object_value_of()) && 11610 value_of.constant().is_identical_to(isolate()->object_value_of()) &&
11606 to_string.CanAccessMonomorphic() && to_string.IsDataConstant() && 11611 to_string.CanAccessMonomorphic() && to_string.IsDataConstant() &&
11607 to_string.constant().is_identical_to( 11612 to_string.constant().is_identical_to(
11608 isolate()->object_to_string())) { 11613 isolate()->object_to_string())) {
11609 // We depend on the prototype chain to stay the same, because we 11614 // We depend on the prototype chain to stay the same, because we
11610 // also need to deoptimize when someone installs @@toPrimitive 11615 // also need to deoptimize when someone installs @@toPrimitive
11611 // somewhere in the prototype chain. 11616 // or @@toStringTag somewhere in the prototype chain.
11612 BuildCheckPrototypeMaps(handle(JSObject::cast(map->prototype())), 11617 BuildCheckPrototypeMaps(handle(JSObject::cast(map->prototype())),
11613 Handle<JSObject>::null()); 11618 Handle<JSObject>::null());
11614 AddCheckMap(left, map); 11619 AddCheckMap(left, map);
11615 AddCheckMap(right, map); 11620 AddCheckMap(right, map);
11616 // The caller expects a branch instruction, so make it happy. 11621 // The caller expects a branch instruction, so make it happy.
11617 return New<HBranch>( 11622 return New<HBranch>(
11618 graph()->GetConstantBool(op == Token::LTE || op == Token::GTE)); 11623 graph()->GetConstantBool(op == Token::LTE || op == Token::GTE));
11619 } 11624 }
11620 } 11625 }
11621 Bailout(kUnsupportedNonPrimitiveCompare); 11626 Bailout(kUnsupportedNonPrimitiveCompare);
(...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after
13603 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13608 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13604 } 13609 }
13605 13610
13606 #ifdef DEBUG 13611 #ifdef DEBUG
13607 graph_->Verify(false); // No full verify. 13612 graph_->Verify(false); // No full verify.
13608 #endif 13613 #endif
13609 } 13614 }
13610 13615
13611 } // namespace internal 13616 } // namespace internal
13612 } // namespace v8 13617 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/compare-known-objects-tostringtag.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698