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/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 2497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2508 // static | 2508 // static |
2509 TranslatedValue TranslatedValue::NewTagged(TranslatedState* container, | 2509 TranslatedValue TranslatedValue::NewTagged(TranslatedState* container, |
2510 Object* literal) { | 2510 Object* literal) { |
2511 TranslatedValue slot(container, kTagged); | 2511 TranslatedValue slot(container, kTagged); |
2512 slot.raw_literal_ = literal; | 2512 slot.raw_literal_ = literal; |
2513 return slot; | 2513 return slot; |
2514 } | 2514 } |
2515 | 2515 |
2516 | 2516 |
2517 // static | 2517 // static |
2518 TranslatedValue TranslatedValue::NewInvalid() { | 2518 TranslatedValue TranslatedValue::NewInvalid(TranslatedState* container) { |
2519 return TranslatedValue(nullptr, kInvalid); | 2519 return TranslatedValue(container, kInvalid); |
2520 } | 2520 } |
2521 | 2521 |
2522 | 2522 |
2523 Isolate* TranslatedValue::isolate() const { return container_->isolate(); } | 2523 Isolate* TranslatedValue::isolate() const { return container_->isolate(); } |
2524 | 2524 |
2525 | 2525 |
2526 Object* TranslatedValue::raw_literal() const { | 2526 Object* TranslatedValue::raw_literal() const { |
2527 DCHECK_EQ(kTagged, kind()); | 2527 DCHECK_EQ(kTagged, kind()); |
2528 return raw_literal_; | 2528 return raw_literal_; |
2529 } | 2529 } |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2978 PrintF(trace_file, "captured object #%d (length = %d)", object_index, | 2978 PrintF(trace_file, "captured object #%d (length = %d)", object_index, |
2979 field_count); | 2979 field_count); |
2980 } | 2980 } |
2981 object_positions_.push_back({frame_index, value_index}); | 2981 object_positions_.push_back({frame_index, value_index}); |
2982 return TranslatedValue::NewDeferredObject(this, field_count, | 2982 return TranslatedValue::NewDeferredObject(this, field_count, |
2983 object_index); | 2983 object_index); |
2984 } | 2984 } |
2985 | 2985 |
2986 case Translation::REGISTER: { | 2986 case Translation::REGISTER: { |
2987 int input_reg = iterator->Next(); | 2987 int input_reg = iterator->Next(); |
2988 if (registers == nullptr) return TranslatedValue::NewInvalid(); | 2988 if (registers == nullptr) return TranslatedValue::NewInvalid(this); |
2989 intptr_t value = registers->GetRegister(input_reg); | 2989 intptr_t value = registers->GetRegister(input_reg); |
2990 if (trace_file != nullptr) { | 2990 if (trace_file != nullptr) { |
2991 PrintF(trace_file, "0x%08" V8PRIxPTR " ; %s ", value, | 2991 PrintF(trace_file, "0x%08" V8PRIxPTR " ; %s ", value, |
2992 converter.NameOfCPURegister(input_reg)); | 2992 converter.NameOfCPURegister(input_reg)); |
2993 reinterpret_cast<Object*>(value)->ShortPrint(trace_file); | 2993 reinterpret_cast<Object*>(value)->ShortPrint(trace_file); |
2994 } | 2994 } |
2995 return TranslatedValue::NewTagged(this, reinterpret_cast<Object*>(value)); | 2995 return TranslatedValue::NewTagged(this, reinterpret_cast<Object*>(value)); |
2996 } | 2996 } |
2997 | 2997 |
2998 case Translation::INT32_REGISTER: { | 2998 case Translation::INT32_REGISTER: { |
2999 int input_reg = iterator->Next(); | 2999 int input_reg = iterator->Next(); |
3000 if (registers == nullptr) return TranslatedValue::NewInvalid(); | 3000 if (registers == nullptr) return TranslatedValue::NewInvalid(this); |
3001 intptr_t value = registers->GetRegister(input_reg); | 3001 intptr_t value = registers->GetRegister(input_reg); |
3002 if (trace_file != nullptr) { | 3002 if (trace_file != nullptr) { |
3003 PrintF(trace_file, "%" V8PRIdPTR " ; %s ", value, | 3003 PrintF(trace_file, "%" V8PRIdPTR " ; %s ", value, |
3004 converter.NameOfCPURegister(input_reg)); | 3004 converter.NameOfCPURegister(input_reg)); |
3005 } | 3005 } |
3006 return TranslatedValue::NewInt32(this, static_cast<int32_t>(value)); | 3006 return TranslatedValue::NewInt32(this, static_cast<int32_t>(value)); |
3007 } | 3007 } |
3008 | 3008 |
3009 case Translation::UINT32_REGISTER: { | 3009 case Translation::UINT32_REGISTER: { |
3010 int input_reg = iterator->Next(); | 3010 int input_reg = iterator->Next(); |
3011 if (registers == nullptr) return TranslatedValue::NewInvalid(); | 3011 if (registers == nullptr) return TranslatedValue::NewInvalid(this); |
3012 intptr_t value = registers->GetRegister(input_reg); | 3012 intptr_t value = registers->GetRegister(input_reg); |
3013 if (trace_file != nullptr) { | 3013 if (trace_file != nullptr) { |
3014 PrintF(trace_file, "%" V8PRIuPTR " ; %s (uint)", value, | 3014 PrintF(trace_file, "%" V8PRIuPTR " ; %s (uint)", value, |
3015 converter.NameOfCPURegister(input_reg)); | 3015 converter.NameOfCPURegister(input_reg)); |
3016 reinterpret_cast<Object*>(value)->ShortPrint(trace_file); | 3016 reinterpret_cast<Object*>(value)->ShortPrint(trace_file); |
3017 } | 3017 } |
3018 return TranslatedValue::NewUInt32(this, static_cast<uint32_t>(value)); | 3018 return TranslatedValue::NewUInt32(this, static_cast<uint32_t>(value)); |
3019 } | 3019 } |
3020 | 3020 |
3021 case Translation::BOOL_REGISTER: { | 3021 case Translation::BOOL_REGISTER: { |
3022 int input_reg = iterator->Next(); | 3022 int input_reg = iterator->Next(); |
3023 if (registers == nullptr) return TranslatedValue::NewInvalid(); | 3023 if (registers == nullptr) return TranslatedValue::NewInvalid(this); |
3024 intptr_t value = registers->GetRegister(input_reg); | 3024 intptr_t value = registers->GetRegister(input_reg); |
3025 if (trace_file != nullptr) { | 3025 if (trace_file != nullptr) { |
3026 PrintF(trace_file, "%" V8PRIdPTR " ; %s (bool)", value, | 3026 PrintF(trace_file, "%" V8PRIdPTR " ; %s (bool)", value, |
3027 converter.NameOfCPURegister(input_reg)); | 3027 converter.NameOfCPURegister(input_reg)); |
3028 } | 3028 } |
3029 return TranslatedValue::NewBool(this, static_cast<uint32_t>(value)); | 3029 return TranslatedValue::NewBool(this, static_cast<uint32_t>(value)); |
3030 } | 3030 } |
3031 | 3031 |
3032 case Translation::DOUBLE_REGISTER: { | 3032 case Translation::DOUBLE_REGISTER: { |
3033 int input_reg = iterator->Next(); | 3033 int input_reg = iterator->Next(); |
3034 if (registers == nullptr) return TranslatedValue::NewInvalid(); | 3034 if (registers == nullptr) return TranslatedValue::NewInvalid(this); |
3035 double value = registers->GetDoubleRegister(input_reg); | 3035 double value = registers->GetDoubleRegister(input_reg); |
3036 if (trace_file != nullptr) { | 3036 if (trace_file != nullptr) { |
3037 PrintF(trace_file, "%e ; %s (bool)", value, | 3037 PrintF(trace_file, "%e ; %s (bool)", value, |
3038 DoubleRegister::AllocationIndexToString(input_reg)); | 3038 DoubleRegister::AllocationIndexToString(input_reg)); |
3039 } | 3039 } |
3040 return TranslatedValue::NewDouble(this, value); | 3040 return TranslatedValue::NewDouble(this, value); |
3041 } | 3041 } |
3042 | 3042 |
3043 case Translation::STACK_SLOT: { | 3043 case Translation::STACK_SLOT: { |
3044 int slot_offset = SlotOffsetFp(iterator->Next()); | 3044 int slot_offset = SlotOffsetFp(iterator->Next()); |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3505 DCHECK(value_info->IsMaterializedObject()); | 3505 DCHECK(value_info->IsMaterializedObject()); |
3506 | 3506 |
3507 value_info->value_ = | 3507 value_info->value_ = |
3508 Handle<Object>(previously_materialized_objects->get(i), isolate_); | 3508 Handle<Object>(previously_materialized_objects->get(i), isolate_); |
3509 } | 3509 } |
3510 } | 3510 } |
3511 } | 3511 } |
3512 | 3512 |
3513 } // namespace internal | 3513 } // namespace internal |
3514 } // namespace v8 | 3514 } // namespace v8 |
OLD | NEW |