Revision: 22272
Author: [email protected]
Date: Tue Jul 8 08:50:03 2014 UTC
Log: Version 3.27.34.5 (merged r21907)
Add missing map check to optimized f.apply(...)
BUG=386034
LOG=N
[email protected]
Review URL: https://codereview.chromium.org/373003003
http://code.google.com/p/v8/source/detail?r=22272
Added:
/branches/3.27/test/mjsunit/regress/regress-386034.js
Modified:
/branches/3.27/src/hydrogen.cc
/branches/3.27/src/version.cc
=======================================
--- /dev/null
+++ /branches/3.27/test/mjsunit/regress/regress-386034.js Tue Jul 8
08:50:03 2014 UTC
@@ -0,0 +1,19 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+function f(x) {
+ var v = x;
+ for (i = 0; i < 1; i++) {
+ v.apply(this, arguments);
+ }
+}
+
+function g() {}
+
+f(g);
+f(g);
+%OptimizeFunctionOnNextCall(f);
+assertThrows(function() { f('----'); }, TypeError);
=======================================
--- /branches/3.27/src/hydrogen.cc Wed Jun 18 14:15:57 2014 UTC
+++ /branches/3.27/src/hydrogen.cc Tue Jul 8 08:50:03 2014 UTC
@@ -8563,10 +8563,12 @@
HValue* function = Pop(); // f
Drop(1); // apply
+ HValue* checked_function = AddCheckMap(function, function_map);
+
if (function_state()->outer() == NULL) {
HInstruction* elements = Add<HArgumentsElements>(false);
HInstruction* length = Add<HArgumentsLength>(elements);
- HValue* wrapped_receiver = BuildWrapReceiver(receiver, function);
+ HValue* wrapped_receiver = BuildWrapReceiver(receiver,
checked_function);
HInstruction* result = New<HApplyArguments>(function,
wrapped_receiver,
length,
@@ -8582,7 +8584,7 @@
const ZoneList<HValue*>* arguments_values = args->arguments_values();
int arguments_count = arguments_values->length();
Push(function);
- Push(BuildWrapReceiver(receiver, function));
+ Push(BuildWrapReceiver(receiver, checked_function));
for (int i = 1; i < arguments_count; i++) {
Push(arguments_values->at(i));
}
=======================================
--- /branches/3.27/src/version.cc Wed Jul 2 12:53:18 2014 UTC
+++ /branches/3.27/src/version.cc Tue Jul 8 08:50:03 2014 UTC
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 3
#define MINOR_VERSION 27
#define BUILD_NUMBER 34
-#define PATCH_LEVEL 4
+#define PATCH_LEVEL 5
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define IS_CANDIDATE_VERSION 0
--
--
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.