OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 5208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5220 | 5220 |
5221 Object* Oddball::Initialize(const char* to_string, Object* to_number) { | 5221 Object* Oddball::Initialize(const char* to_string, Object* to_number) { |
5222 Object* symbol = Heap::LookupAsciiSymbol(to_string); | 5222 Object* symbol = Heap::LookupAsciiSymbol(to_string); |
5223 if (symbol->IsFailure()) return symbol; | 5223 if (symbol->IsFailure()) return symbol; |
5224 set_to_string(String::cast(symbol)); | 5224 set_to_string(String::cast(symbol)); |
5225 set_to_number(to_number); | 5225 set_to_number(to_number); |
5226 return this; | 5226 return this; |
5227 } | 5227 } |
5228 | 5228 |
5229 | 5229 |
| 5230 String* SharedFunctionInfo::DebugName() { |
| 5231 Object* n = name(); |
| 5232 if (!n->IsString() || String::cast(n)->length() == 0) return inferred_name(); |
| 5233 return String::cast(n); |
| 5234 } |
| 5235 |
| 5236 |
5230 bool SharedFunctionInfo::HasSourceCode() { | 5237 bool SharedFunctionInfo::HasSourceCode() { |
5231 return !script()->IsUndefined() && | 5238 return !script()->IsUndefined() && |
5232 !reinterpret_cast<Script*>(script())->source()->IsUndefined(); | 5239 !reinterpret_cast<Script*>(script())->source()->IsUndefined(); |
5233 } | 5240 } |
5234 | 5241 |
5235 | 5242 |
5236 Object* SharedFunctionInfo::GetSourceCode() { | 5243 Object* SharedFunctionInfo::GetSourceCode() { |
5237 HandleScope scope; | 5244 HandleScope scope; |
5238 if (script()->IsUndefined()) return Heap::undefined_value(); | 5245 if (script()->IsUndefined()) return Heap::undefined_value(); |
5239 Object* source = Script::cast(script())->source(); | 5246 Object* source = Script::cast(script())->source(); |
(...skipping 3797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9037 if (break_point_objects()->IsUndefined()) return 0; | 9044 if (break_point_objects()->IsUndefined()) return 0; |
9038 // Single beak point. | 9045 // Single beak point. |
9039 if (!break_point_objects()->IsFixedArray()) return 1; | 9046 if (!break_point_objects()->IsFixedArray()) return 1; |
9040 // Multiple break points. | 9047 // Multiple break points. |
9041 return FixedArray::cast(break_point_objects())->length(); | 9048 return FixedArray::cast(break_point_objects())->length(); |
9042 } | 9049 } |
9043 #endif | 9050 #endif |
9044 | 9051 |
9045 | 9052 |
9046 } } // namespace v8::internal | 9053 } } // namespace v8::internal |
OLD | NEW |