Handle<Object> SlotRef::GetValue(Isolate* isolate) {
switch (representation_) {
- case TAGGED:
- return Handle<Object>(Memory::Object_at(addr_), isolate);
+ case TAGGED: {
+ Handle<Object> value(Memory::Object_at(addr_), isolate);
+ if (value->IsMutableHeapNumber()) {
+ HeapNumber::cast(*value)->set_map(isolate->heap()->heap_number_map());
+ }
+ return value;
+ }
case INT32: {
#if V8_TARGET_BIG_ENDIAN && V8_HOST_ARCH_64_BIT
case SlotRef::INT32:
case SlotRef::UINT32:
case SlotRef::DOUBLE:
- case SlotRef::LITERAL: {
+ case SlotRef::LITERAL:
return slot.GetValue(isolate);
- }
+
case SlotRef::ARGUMENTS_OBJECT: {
// We should never need to materialize an arguments object,
// but we still need to put something into the array
--- /dev/null
+// Copyright 2015 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 dummy(x) { };
+
+function g() {
+ return g.arguments;
+}
+
+function f(limit) {
+ var i = 0;
+ var o = {};
+ for (; i < limit; i++) {
+ o.y = +o.y;
+ g();
+ }
+}
+
+f(1);
+f(1);
+%OptimizeFunctionOnNextCall(f);
+dummy(f(1));
+dummy(f(2));