OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 9602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9613 SmartArrayPointer<char> name = shared()->DebugName()->ToCString(); | 9613 SmartArrayPointer<char> name = shared()->DebugName()->ToCString(); |
9614 PrintF(out, "%s", *name); | 9614 PrintF(out, "%s", *name); |
9615 } | 9615 } |
9616 | 9616 |
9617 | 9617 |
9618 Context* JSFunction::NativeContextFromLiterals(FixedArray* literals) { | 9618 Context* JSFunction::NativeContextFromLiterals(FixedArray* literals) { |
9619 return Context::cast(literals->get(JSFunction::kLiteralNativeContextIndex)); | 9619 return Context::cast(literals->get(JSFunction::kLiteralNativeContextIndex)); |
9620 } | 9620 } |
9621 | 9621 |
9622 | 9622 |
9623 bool JSFunction::PassesHydrogenFilter() { | 9623 // The filter is a pattern that matches function names in this way: |
| 9624 // "*" all; the default |
| 9625 // "-" all but the top-level function |
| 9626 // "-name" all but the function "name" |
| 9627 // "" only the top-level function |
| 9628 // "name" only the function "name" |
| 9629 // "name*" only functions starting with "name" |
| 9630 bool JSFunction::PassesFilter(const char* raw_filter) { |
| 9631 if (*raw_filter == '*') return true; |
9624 String* name = shared()->DebugName(); | 9632 String* name = shared()->DebugName(); |
9625 // The filter string is a pattern that matches functions in this way: | 9633 Vector<const char> filter = CStrVector(raw_filter); |
9626 // "*" all; the default | 9634 if (filter.length() == 0) return name->length() == 0; |
9627 // "-" all but the top-level function | 9635 if (filter[0] != '-' && name->IsUtf8EqualTo(filter)) return true; |
9628 // "-name" all but the function "name" | 9636 if (filter[0] == '-' && |
9629 // "" only the top-level function | 9637 !name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) { |
9630 // "name" only the function "name" | 9638 return true; |
9631 // "name*" only functions starting with "name" | |
9632 if (*FLAG_hydrogen_filter != '*') { | |
9633 Vector<const char> filter = CStrVector(FLAG_hydrogen_filter); | |
9634 if (filter.length() == 0) return name->length() == 0; | |
9635 if (filter[0] != '-' && name->IsUtf8EqualTo(filter)) return true; | |
9636 if (filter[0] == '-' && | |
9637 !name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) { | |
9638 return true; | |
9639 } | |
9640 if (filter[filter.length() - 1] == '*' && | |
9641 name->IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) { | |
9642 return true; | |
9643 } | |
9644 return false; | |
9645 } | 9639 } |
9646 | 9640 if (filter[filter.length() - 1] == '*' && |
9647 return true; | 9641 name->IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) { |
| 9642 return true; |
| 9643 } |
| 9644 return false; |
9648 } | 9645 } |
9649 | 9646 |
9650 | 9647 |
9651 MaybeObject* Oddball::Initialize(const char* to_string, | 9648 MaybeObject* Oddball::Initialize(const char* to_string, |
9652 Object* to_number, | 9649 Object* to_number, |
9653 byte kind) { | 9650 byte kind) { |
9654 String* internalized_to_string; | 9651 String* internalized_to_string; |
9655 { MaybeObject* maybe_string = | 9652 { MaybeObject* maybe_string = |
9656 Isolate::Current()->heap()->InternalizeUtf8String( | 9653 Isolate::Current()->heap()->InternalizeUtf8String( |
9657 CStrVector(to_string)); | 9654 CStrVector(to_string)); |
(...skipping 6294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15952 #define ERROR_MESSAGES_TEXTS(C, T) T, | 15949 #define ERROR_MESSAGES_TEXTS(C, T) T, |
15953 static const char* error_messages_[] = { | 15950 static const char* error_messages_[] = { |
15954 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 15951 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
15955 }; | 15952 }; |
15956 #undef ERROR_MESSAGES_TEXTS | 15953 #undef ERROR_MESSAGES_TEXTS |
15957 return error_messages_[reason]; | 15954 return error_messages_[reason]; |
15958 } | 15955 } |
15959 | 15956 |
15960 | 15957 |
15961 } } // namespace v8::internal | 15958 } } // namespace v8::internal |
OLD | NEW |