Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: src/objects.cc

Issue 9618003: Automatically determine ElementsKind name for debug printing (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix lint issues Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/elements.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "vm-state-inl.h" 48 #include "vm-state-inl.h"
49 49
50 #ifdef ENABLE_DISASSEMBLER 50 #ifdef ENABLE_DISASSEMBLER
51 #include "disasm.h" 51 #include "disasm.h"
52 #include "disassembler.h" 52 #include "disassembler.h"
53 #endif 53 #endif
54 54
55 namespace v8 { 55 namespace v8 {
56 namespace internal { 56 namespace internal {
57 57
58
58 void PrintElementsKind(FILE* out, ElementsKind kind) { 59 void PrintElementsKind(FILE* out, ElementsKind kind) {
59 switch (kind) { 60 ElementsAccessor* accessor = ElementsAccessor::ForKind(kind);
60 case FAST_SMI_ONLY_ELEMENTS: 61 PrintF(out, "%s", accessor->name());
61 PrintF(out, "FAST_SMI_ONLY_ELEMENTS");
62 break;
63 case FAST_ELEMENTS:
64 PrintF(out, "FAST_ELEMENTS");
65 break;
66 case FAST_DOUBLE_ELEMENTS:
67 PrintF(out, "FAST_DOUBLE_ELEMENTS");
68 break;
69 case DICTIONARY_ELEMENTS:
70 PrintF(out, "DICTIONARY_ELEMENTS");
71 break;
72 case NON_STRICT_ARGUMENTS_ELEMENTS:
73 PrintF(out, "NON_STRICT_ARGUMENTS_ELEMENTS");
74 break;
75 case EXTERNAL_BYTE_ELEMENTS:
76 PrintF(out, "EXTERNAL_BYTE_ELEMENTS");
77 break;
78 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
79 PrintF(out, "EXTERNAL_UNSIGNED_BYTE_ELEMENTS");
80 break;
81 case EXTERNAL_SHORT_ELEMENTS:
82 PrintF(out, "EXTERNAL_SHORT_ELEMENTS");
83 break;
84 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS:
85 PrintF(out, "EXTERNAL_UNSIGNED_SHORT_ELEMENTS");
86 break;
87 case EXTERNAL_INT_ELEMENTS:
88 PrintF(out, "EXTERNAL_INT_ELEMENTS");
89 break;
90 case EXTERNAL_UNSIGNED_INT_ELEMENTS:
91 PrintF(out, "EXTERNAL_UNSIGNED_INT_ELEMENTS");
92 break;
93 case EXTERNAL_FLOAT_ELEMENTS:
94 PrintF(out, "EXTERNAL_FLOAT_ELEMENTS");
95 break;
96 case EXTERNAL_DOUBLE_ELEMENTS:
97 PrintF(out, "EXTERNAL_DOUBLE_ELEMENTS");
98 break;
99 case EXTERNAL_PIXEL_ELEMENTS:
100 PrintF(out, "EXTERNAL_DOUBLE_ELEMENTS");
101 break;
102 }
103 } 62 }
104 63
105 64
106 MUST_USE_RESULT static MaybeObject* CreateJSValue(JSFunction* constructor, 65 MUST_USE_RESULT static MaybeObject* CreateJSValue(JSFunction* constructor,
107 Object* value) { 66 Object* value) {
108 Object* result; 67 Object* result;
109 { MaybeObject* maybe_result = 68 { MaybeObject* maybe_result =
110 constructor->GetHeap()->AllocateJSObject(constructor); 69 constructor->GetHeap()->AllocateJSObject(constructor);
111 if (!maybe_result->ToObject(&result)) return maybe_result; 70 if (!maybe_result->ToObject(&result)) return maybe_result;
112 } 71 }
(...skipping 12911 matching lines...) Expand 10 before | Expand all | Expand 10 after
13024 if (break_point_objects()->IsUndefined()) return 0; 12983 if (break_point_objects()->IsUndefined()) return 0;
13025 // Single break point. 12984 // Single break point.
13026 if (!break_point_objects()->IsFixedArray()) return 1; 12985 if (!break_point_objects()->IsFixedArray()) return 1;
13027 // Multiple break points. 12986 // Multiple break points.
13028 return FixedArray::cast(break_point_objects())->length(); 12987 return FixedArray::cast(break_point_objects())->length();
13029 } 12988 }
13030 #endif // ENABLE_DEBUGGER_SUPPORT 12989 #endif // ENABLE_DEBUGGER_SUPPORT
13031 12990
13032 12991
13033 } } // namespace v8::internal 12992 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/elements.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698