OLD | NEW |
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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/disasm.h" | 10 #include "src/disasm.h" |
(...skipping 3268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3279 if (should_deopt) { | 3279 if (should_deopt) { |
3280 List<JSFunction*> functions(2); | 3280 List<JSFunction*> functions(2); |
3281 frame->GetFunctions(&functions); | 3281 frame->GetFunctions(&functions); |
3282 Deoptimizer::DeoptimizeFunction(functions[0]); | 3282 Deoptimizer::DeoptimizeFunction(functions[0]); |
3283 } | 3283 } |
3284 } | 3284 } |
3285 | 3285 |
3286 | 3286 |
3287 Handle<Object> SlotRef::GetValue(Isolate* isolate) { | 3287 Handle<Object> SlotRef::GetValue(Isolate* isolate) { |
3288 switch (representation_) { | 3288 switch (representation_) { |
3289 case TAGGED: | 3289 case TAGGED: { |
3290 return Handle<Object>(Memory::Object_at(addr_), isolate); | 3290 Handle<Object> value(Memory::Object_at(addr_), isolate); |
| 3291 if (value->IsMutableHeapNumber()) { |
| 3292 HeapNumber::cast(*value)->set_map(isolate->heap()->heap_number_map()); |
| 3293 } |
| 3294 return value; |
| 3295 } |
3291 | 3296 |
3292 case INT32: { | 3297 case INT32: { |
3293 #if V8_TARGET_BIG_ENDIAN && V8_HOST_ARCH_64_BIT | 3298 #if V8_TARGET_BIG_ENDIAN && V8_HOST_ARCH_64_BIT |
3294 int value = Memory::int32_at(addr_ + kIntSize); | 3299 int value = Memory::int32_at(addr_ + kIntSize); |
3295 #else | 3300 #else |
3296 int value = Memory::int32_at(addr_); | 3301 int value = Memory::int32_at(addr_); |
3297 #endif | 3302 #endif |
3298 if (Smi::IsValid(value)) { | 3303 if (Smi::IsValid(value)) { |
3299 return Handle<Object>(Smi::FromInt(value), isolate); | 3304 return Handle<Object>(Smi::FromInt(value), isolate); |
3300 } else { | 3305 } else { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3381 | 3386 |
3382 | 3387 |
3383 Handle<Object> SlotRefValueBuilder::GetNext(Isolate* isolate, int lvl) { | 3388 Handle<Object> SlotRefValueBuilder::GetNext(Isolate* isolate, int lvl) { |
3384 SlotRef& slot = slot_refs_[current_slot_]; | 3389 SlotRef& slot = slot_refs_[current_slot_]; |
3385 current_slot_++; | 3390 current_slot_++; |
3386 switch (slot.Representation()) { | 3391 switch (slot.Representation()) { |
3387 case SlotRef::TAGGED: | 3392 case SlotRef::TAGGED: |
3388 case SlotRef::INT32: | 3393 case SlotRef::INT32: |
3389 case SlotRef::UINT32: | 3394 case SlotRef::UINT32: |
3390 case SlotRef::DOUBLE: | 3395 case SlotRef::DOUBLE: |
3391 case SlotRef::LITERAL: { | 3396 case SlotRef::LITERAL: |
3392 return slot.GetValue(isolate); | 3397 return slot.GetValue(isolate); |
3393 } | 3398 |
3394 case SlotRef::ARGUMENTS_OBJECT: { | 3399 case SlotRef::ARGUMENTS_OBJECT: { |
3395 // We should never need to materialize an arguments object, | 3400 // We should never need to materialize an arguments object, |
3396 // but we still need to put something into the array | 3401 // but we still need to put something into the array |
3397 // so that the indexing is consistent. | 3402 // so that the indexing is consistent. |
3398 materialized_objects_.Add(isolate->factory()->undefined_value()); | 3403 materialized_objects_.Add(isolate->factory()->undefined_value()); |
3399 int length = slot.GetChildrenCount(); | 3404 int length = slot.GetChildrenCount(); |
3400 for (int i = 0; i < length; ++i) { | 3405 for (int i = 0; i < length; ++i) { |
3401 // We don't need the argument, just ignore it | 3406 // We don't need the argument, just ignore it |
3402 GetNext(isolate, lvl + 1); | 3407 GetNext(isolate, lvl + 1); |
3403 } | 3408 } |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3663 Deoptimizer::GetDeoptimizationId(isolate, info->target_address(), | 3668 Deoptimizer::GetDeoptimizationId(isolate, info->target_address(), |
3664 Deoptimizer::LAZY))) { | 3669 Deoptimizer::LAZY))) { |
3665 CHECK(RelocInfo::IsRuntimeEntry(info->rmode())); | 3670 CHECK(RelocInfo::IsRuntimeEntry(info->rmode())); |
3666 return DeoptInfo(last_position, NULL, last_reason); | 3671 return DeoptInfo(last_position, NULL, last_reason); |
3667 } | 3672 } |
3668 } | 3673 } |
3669 } | 3674 } |
3670 return DeoptInfo(0, NULL, Deoptimizer::kNoReason); | 3675 return DeoptInfo(0, NULL, Deoptimizer::kNoReason); |
3671 } | 3676 } |
3672 } } // namespace v8::internal | 3677 } } // namespace v8::internal |
OLD | NEW |