Revision: 24117
Author: [email protected]
Date: Mon Sep 22 12:43:40 2014 UTC
Log: Pass the ast_id to HandleKeyed to make sure it's the right one
(e.g., CountOperation, not just the load-expression's id)
BUG=
[email protected]
Review URL: https://codereview.chromium.org/595453002
https://code.google.com/p/v8/source/detail?r=24117
Modified:
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/src/hydrogen.h
/branches/bleeding_edge/test/mjsunit/keyed-named-access.js
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Fri Sep 19 15:09:50 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc Mon Sep 22 12:43:40 2014 UTC
@@ -6436,7 +6436,7 @@
HValue* key = environment()->ExpressionStackAt(1);
HValue* object = environment()->ExpressionStackAt(2);
bool has_side_effects = false;
- HandleKeyedElementAccess(object, key, value, expr, return_id, STORE,
+ HandleKeyedElementAccess(object, key, value, expr, ast_id, return_id,
STORE,
&has_side_effects);
Drop(3);
Push(value);
@@ -7129,7 +7129,7 @@
HValue* HOptimizedGraphBuilder::HandleKeyedElementAccess(
- HValue* obj, HValue* key, HValue* val, Expression* expr,
+ HValue* obj, HValue* key, HValue* val, Expression* expr, BailoutId
ast_id,
BailoutId return_id, PropertyAccessType access_type,
bool* has_side_effects) {
if (key->ActualValue()->IsConstant()) {
@@ -7143,7 +7143,7 @@
Handle<String>::cast(constant));
}
HInstruction* instr =
- BuildNamedAccess(access_type, expr->id(), return_id, expr, obj,
+ BuildNamedAccess(access_type, ast_id, return_id, expr, obj,
Handle<String>::cast(constant), val, false);
if (instr == NULL || instr->IsLinked()) {
*has_side_effects = false;
@@ -7365,7 +7365,7 @@
bool has_side_effects = false;
HValue* load = HandleKeyedElementAccess(
- obj, key, NULL, expr, expr->LoadId(), LOAD, &has_side_effects);
+ obj, key, NULL, expr, ast_id, expr->LoadId(), LOAD,
&has_side_effects);
if (has_side_effects) {
if (ast_context()->IsEffect()) {
Add<HSimulate>(ast_id, REMOVABLE_SIMULATE);
=======================================
--- /branches/bleeding_edge/src/hydrogen.h Fri Sep 19 07:27:13 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.h Mon Sep 22 12:43:40 2014 UTC
@@ -2627,7 +2627,8 @@
bool* has_side_effects);
HValue* HandleKeyedElementAccess(HValue* obj, HValue* key, HValue* val,
- Expression* expr, BailoutId return_id,
+ Expression* expr, BailoutId ast_id,
+ BailoutId return_id,
PropertyAccessType access_type,
bool* has_side_effects);
=======================================
--- /branches/bleeding_edge/test/mjsunit/keyed-named-access.js Thu Sep 18
12:00:00 2014 UTC
+++ /branches/bleeding_edge/test/mjsunit/keyed-named-access.js Mon Sep 22
12:43:40 2014 UTC
@@ -34,3 +34,39 @@
f(o3);
%OptimizeFunctionOnNextCall(f);
assertEquals(1200, f(o3));
+
+(function CountOperationDeoptimizationGetter() {
+ var global = {};
+ global.__defineGetter__("A", function () { return "x"; });
+
+ function h() {
+ return "A";
+ }
+
+ function g(a, b, c) {
+ try {
+ return a + b.toString() + c;
+ } catch (e) { }
+ }
+
+ function test(o) {
+ return g(1, o[h()]--, 10);
+ }
+
+ test(global);
+ test(global);
+ %OptimizeFunctionOnNextCall(test);
+ print(test(global));
+})();
+
+
+(function CountOperationDeoptimizationPoint() {
+ function test() {
+ this[0, ""]--;
+ }
+
+ test();
+ test();
+ %OptimizeFunctionOnNextCall(test);
+ test();
+})();
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.