OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 Loading... |
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 void PrintElementsKind(FILE* out, ElementsKind kind) { |
| 59 switch (kind) { |
| 60 case FAST_SMI_ONLY_ELEMENTS: |
| 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 } |
| 104 |
| 105 |
58 // Getters and setters are stored in a fixed array property. These are | 106 // Getters and setters are stored in a fixed array property. These are |
59 // constants for their indices. | 107 // constants for their indices. |
60 const int kGetterIndex = 0; | 108 const int kGetterIndex = 0; |
61 const int kSetterIndex = 1; | 109 const int kSetterIndex = 1; |
62 | 110 |
63 MUST_USE_RESULT static MaybeObject* CreateJSValue(JSFunction* constructor, | 111 MUST_USE_RESULT static MaybeObject* CreateJSValue(JSFunction* constructor, |
64 Object* value) { | 112 Object* value) { |
65 Object* result; | 113 Object* result; |
66 { MaybeObject* maybe_result = | 114 { MaybeObject* maybe_result = |
67 constructor->GetHeap()->AllocateJSObject(constructor); | 115 constructor->GetHeap()->AllocateJSObject(constructor); |
(...skipping 12466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12534 if (break_point_objects()->IsUndefined()) return 0; | 12582 if (break_point_objects()->IsUndefined()) return 0; |
12535 // Single break point. | 12583 // Single break point. |
12536 if (!break_point_objects()->IsFixedArray()) return 1; | 12584 if (!break_point_objects()->IsFixedArray()) return 1; |
12537 // Multiple break points. | 12585 // Multiple break points. |
12538 return FixedArray::cast(break_point_objects())->length(); | 12586 return FixedArray::cast(break_point_objects())->length(); |
12539 } | 12587 } |
12540 #endif // ENABLE_DEBUGGER_SUPPORT | 12588 #endif // ENABLE_DEBUGGER_SUPPORT |
12541 | 12589 |
12542 | 12590 |
12543 } } // namespace v8::internal | 12591 } } // namespace v8::internal |
OLD | NEW |