diff options
author | Michaƫl Zasso <mic.besace@gmail.com> | 2015-10-06 08:42:38 +0200 |
---|---|---|
committer | Ali Ijaz Sheikh <ofrobots@google.com> | 2015-10-14 11:20:34 -0700 |
commit | d8011d1683fe0d977de2bea1147f5213d4490c5a (patch) | |
tree | 54967df8dc1732e59eef39e5c5b39fe99ad88977 /deps/v8/src/objects-printer.cc | |
parent | d1a2e5357ef0357cec9b516fa9ac78cc38a984aa (diff) | |
download | android-node-v8-d8011d1683fe0d977de2bea1147f5213d4490c5a.tar.gz android-node-v8-d8011d1683fe0d977de2bea1147f5213d4490c5a.tar.bz2 android-node-v8-d8011d1683fe0d977de2bea1147f5213d4490c5a.zip |
deps: upgrade V8 to 4.6.85.23
PR-URL: https://github.com/nodejs/node/pull/3351
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/src/objects-printer.cc')
-rw-r--r-- | deps/v8/src/objects-printer.cc | 169 |
1 files changed, 125 insertions, 44 deletions
diff --git a/deps/v8/src/objects-printer.cc b/deps/v8/src/objects-printer.cc index b514a9443f..799561eb8b 100644 --- a/deps/v8/src/objects-printer.cc +++ b/deps/v8/src/objects-printer.cc @@ -6,9 +6,9 @@ #include "src/disasm.h" #include "src/disassembler.h" -#include "src/heap/objects-visiting.h" -#include "src/jsregexp.h" +#include "src/interpreter/bytecodes.h" #include "src/ostreams.h" +#include "src/regexp/jsregexp.h" namespace v8 { namespace internal { @@ -60,8 +60,8 @@ void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT HeapNumber::cast(this)->HeapNumberPrint(os); os << ">"; break; - case FLOAT32X4_TYPE: - Float32x4::cast(this)->Float32x4Print(os); + case SIMD128_VALUE_TYPE: + Simd128Value::cast(this)->Simd128ValuePrint(os); break; case FIXED_DOUBLE_ARRAY_TYPE: FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(os); @@ -72,18 +72,13 @@ void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT case BYTE_ARRAY_TYPE: ByteArray::cast(this)->ByteArrayPrint(os); break; + case BYTECODE_ARRAY_TYPE: + BytecodeArray::cast(this)->BytecodeArrayPrint(os); + break; case FREE_SPACE_TYPE: FreeSpace::cast(this)->FreeSpacePrint(os); break; -#define PRINT_EXTERNAL_ARRAY(Type, type, TYPE, ctype, size) \ - case EXTERNAL_##TYPE##_ARRAY_TYPE: \ - External##Type##Array::cast(this)->External##Type##ArrayPrint(os); \ - break; - - TYPED_ARRAYS(PRINT_EXTERNAL_ARRAY) -#undef PRINT_EXTERNAL_ARRAY - #define PRINT_FIXED_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ case Fixed##Type##Array::kInstanceType: \ Fixed##Type##Array::cast(this)->FixedTypedArrayPrint(os); \ @@ -196,24 +191,68 @@ void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT } -void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT - os << "byte array, data starts at " << GetDataStartAddress(); +void Simd128Value::Simd128ValuePrint(std::ostream& os) { // NOLINT +#define PRINT_SIMD128_VALUE(TYPE, Type, type, lane_count, lane_type) \ + if (Is##Type()) return Type::cast(this)->Type##Print(os); + SIMD128_TYPES(PRINT_SIMD128_VALUE) +#undef PRINT_SIMD128_VALUE + UNREACHABLE(); } -void FreeSpace::FreeSpacePrint(std::ostream& os) { // NOLINT - os << "free space, size " << Size(); +void Float32x4::Float32x4Print(std::ostream& os) { // NOLINT + char arr[100]; + Vector<char> buffer(arr, arraysize(arr)); + os << std::string(DoubleToCString(get_lane(0), buffer)) << ", " + << std::string(DoubleToCString(get_lane(1), buffer)) << ", " + << std::string(DoubleToCString(get_lane(2), buffer)) << ", " + << std::string(DoubleToCString(get_lane(3), buffer)); } -#define EXTERNAL_ARRAY_PRINTER(Type, type, TYPE, ctype, size) \ - void External##Type##Array::External##Type##ArrayPrint(std::ostream& os) { \ - os << "external " #type " array"; \ +#define SIMD128_INT_PRINT_FUNCTION(type, lane_count) \ + void type::type##Print(std::ostream& os) { \ + char arr[100]; \ + Vector<char> buffer(arr, arraysize(arr)); \ + os << std::string(IntToCString(get_lane(0), buffer)); \ + for (int i = 1; i < lane_count; i++) { \ + os << ", " << std::string(IntToCString(get_lane(i), buffer)); \ + } \ } +SIMD128_INT_PRINT_FUNCTION(Int32x4, 4) +SIMD128_INT_PRINT_FUNCTION(Int16x8, 8) +SIMD128_INT_PRINT_FUNCTION(Int8x16, 16) +#undef SIMD128_INT_PRINT_FUNCTION + + +#define SIMD128_BOOL_PRINT_FUNCTION(type, lane_count) \ + void type::type##Print(std::ostream& os) { \ + char arr[100]; \ + Vector<char> buffer(arr, arraysize(arr)); \ + os << std::string(get_lane(0) ? "true" : "false"); \ + for (int i = 1; i < lane_count; i++) { \ + os << ", " << std::string(get_lane(i) ? "true" : "false"); \ + } \ + } +SIMD128_BOOL_PRINT_FUNCTION(Bool32x4, 4) +SIMD128_BOOL_PRINT_FUNCTION(Bool16x8, 8) +SIMD128_BOOL_PRINT_FUNCTION(Bool8x16, 16) +#undef SIMD128_BOOL_PRINT_FUNCTION -TYPED_ARRAYS(EXTERNAL_ARRAY_PRINTER) -#undef EXTERNAL_ARRAY_PRINTER +void ByteArray::ByteArrayPrint(std::ostream& os) { // NOLINT + os << "byte array, data starts at " << GetDataStartAddress(); +} + + +void BytecodeArray::BytecodeArrayPrint(std::ostream& os) { // NOLINT + Disassemble(os); +} + + +void FreeSpace::FreeSpacePrint(std::ostream& os) { // NOLINT + os << "free space, size " << Size(); +} template <class Traits> @@ -312,19 +351,6 @@ void JSObject::PrintElements(std::ostream& os) { // NOLINT break; \ } - PRINT_ELEMENTS(EXTERNAL_UINT8_CLAMPED_ELEMENTS, ExternalUint8ClampedArray) - PRINT_ELEMENTS(EXTERNAL_INT8_ELEMENTS, ExternalInt8Array) - PRINT_ELEMENTS(EXTERNAL_UINT8_ELEMENTS, - ExternalUint8Array) - PRINT_ELEMENTS(EXTERNAL_INT16_ELEMENTS, ExternalInt16Array) - PRINT_ELEMENTS(EXTERNAL_UINT16_ELEMENTS, - ExternalUint16Array) - PRINT_ELEMENTS(EXTERNAL_INT32_ELEMENTS, ExternalInt32Array) - PRINT_ELEMENTS(EXTERNAL_UINT32_ELEMENTS, - ExternalUint32Array) - PRINT_ELEMENTS(EXTERNAL_FLOAT32_ELEMENTS, ExternalFloat32Array) - PRINT_ELEMENTS(EXTERNAL_FLOAT64_ELEMENTS, ExternalFloat64Array) - PRINT_ELEMENTS(UINT8_ELEMENTS, FixedUint8Array) PRINT_ELEMENTS(UINT8_CLAMPED_ELEMENTS, FixedUint8ClampedArray) PRINT_ELEMENTS(INT8_ELEMENTS, FixedInt8Array) @@ -411,10 +437,10 @@ void Map::MapPrint(std::ostream& os) { // NOLINT HeapObject::PrintHeader(os, "Map"); os << " - type: " << TypeToString(instance_type()) << "\n"; os << " - instance size: " << instance_size() << "\n"; - os << " - inobject properties: " << inobject_properties() << "\n"; - os << " - elements kind: " << ElementsKindToString(elements_kind()); - os << "\n - pre-allocated property fields: " - << pre_allocated_property_fields() << "\n"; + if (IsJSObjectMap()) { + os << " - inobject properties: " << GetInObjectProperties() << "\n"; + } + os << " - elements kind: " << ElementsKindToString(elements_kind()) << "\n"; os << " - unused property fields: " << unused_property_fields() << "\n"; if (is_deprecated()) os << " - deprecated_map\n"; if (is_stable()) os << " - stable_map\n"; @@ -505,6 +531,61 @@ void FixedDoubleArray::FixedDoubleArrayPrint(std::ostream& os) { // NOLINT } +void TypeFeedbackVector::Print() { + OFStream os(stdout); + TypeFeedbackVectorPrint(os); + os << std::flush; +} + + +void TypeFeedbackVector::TypeFeedbackVectorPrint(std::ostream& os) { // NOLINT + HeapObject::PrintHeader(os, "TypeFeedbackVector"); + os << " - length: " << length(); + if (length() == 0) { + os << " (empty)\n"; + return; + } + + os << "\n - ics with type info: " << ic_with_type_info_count(); + os << "\n - generic ics: " << ic_generic_count(); + + if (Slots() > 0) { + for (int i = 0; i < Slots(); i++) { + FeedbackVectorSlot slot(i); + os << "\n Slot " << i << " [" << GetIndex(slot) + << "]: " << Brief(Get(slot)); + } + } + + if (ICSlots() > 0) { + DCHECK(elements_per_ic_slot() == 2); + + for (int i = 0; i < ICSlots(); i++) { + FeedbackVectorICSlot slot(i); + Code::Kind kind = GetKind(slot); + os << "\n ICSlot " << i; + if (kind == Code::LOAD_IC) { + LoadICNexus nexus(this, slot); + os << " LOAD_IC " << Code::ICState2String(nexus.StateFromFeedback()); + } else if (kind == Code::KEYED_LOAD_IC) { + KeyedLoadICNexus nexus(this, slot); + os << " KEYED_LOAD_IC " + << Code::ICState2String(nexus.StateFromFeedback()); + } else { + DCHECK(kind == Code::CALL_IC); + CallICNexus nexus(this, slot); + os << " CALL_IC " << Code::ICState2String(nexus.StateFromFeedback()); + } + + os << "\n [" << GetIndex(slot) << "]: " << Brief(Get(slot)); + os << "\n [" << (GetIndex(slot) + 1) + << "]: " << Brief(get(GetIndex(slot) + 1)); + } + } + os << "\n"; +} + + void JSValue::JSValuePrint(std::ostream& os) { // NOLINT HeapObject::PrintHeader(os, "ValueObject"); value()->Print(os); @@ -748,10 +829,8 @@ void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT String* source = String::cast(Script::cast(script())->source()); int start = start_position(); int length = end_position() - start; - SmartArrayPointer<char> source_string = - source->ToCString(DISALLOW_NULLS, - FAST_STRING_TRAVERSAL, - start, length, NULL); + base::SmartArrayPointer<char> source_string = source->ToCString( + DISALLOW_NULLS, FAST_STRING_TRAVERSAL, start, length, NULL); os << source_string.get(); } // Script files are often large, hard to read. @@ -765,7 +844,10 @@ void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT os << "\n - length = " << length(); os << "\n - optimized_code_map = " << Brief(optimized_code_map()); os << "\n - feedback_vector = "; - feedback_vector()->FixedArrayPrint(os); + feedback_vector()->TypeFeedbackVectorPrint(os); + if (HasBytecodeArray()) { + os << "\n - bytecode_array = " << bytecode_array(); + } os << "\n"; } @@ -993,7 +1075,6 @@ void Script::ScriptPrint(std::ostream& os) { // NOLINT void DebugInfo::DebugInfoPrint(std::ostream& os) { // NOLINT HeapObject::PrintHeader(os, "DebugInfo"); os << "\n - shared: " << Brief(shared()); - os << "\n - original_code: " << Brief(original_code()); os << "\n - code: " << Brief(code()); os << "\n - break_points: "; break_points()->Print(os); |