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

Side by Side Diff: src/objects.cc

Issue 19590002: Add support for empty hydrogen filter that matches only the top-level JSFunction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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/flag-definitions.h ('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 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 9624 matching lines...) Expand 10 before | Expand all | Expand 10 after
9635 } 9635 }
9636 9636
9637 9637
9638 Context* JSFunction::NativeContextFromLiterals(FixedArray* literals) { 9638 Context* JSFunction::NativeContextFromLiterals(FixedArray* literals) {
9639 return Context::cast(literals->get(JSFunction::kLiteralNativeContextIndex)); 9639 return Context::cast(literals->get(JSFunction::kLiteralNativeContextIndex));
9640 } 9640 }
9641 9641
9642 9642
9643 bool JSFunction::PassesHydrogenFilter() { 9643 bool JSFunction::PassesHydrogenFilter() {
9644 String* name = shared()->DebugName(); 9644 String* name = shared()->DebugName();
9645 if (*FLAG_hydrogen_filter != '\0') { 9645 // The filter string is a pattern that matches functions in this way:
9646 // "*" all; the default
9647 // "-" all but the top-level function
9648 // "-name" all but the function "name"
9649 // "" only the top-level function
9650 // "name" only the function "name"
9651 // "name*" only functions starting with "name"
9652 if (*FLAG_hydrogen_filter != '*') {
9646 Vector<const char> filter = CStrVector(FLAG_hydrogen_filter); 9653 Vector<const char> filter = CStrVector(FLAG_hydrogen_filter);
9654 if (filter.length() == 0) return name->length() == 0;
9647 if (filter[0] != '-' && name->IsUtf8EqualTo(filter)) return true; 9655 if (filter[0] != '-' && name->IsUtf8EqualTo(filter)) return true;
9648 if (filter[0] == '-' && 9656 if (filter[0] == '-' &&
9649 !name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) { 9657 !name->IsUtf8EqualTo(filter.SubVector(1, filter.length()))) {
9650 return true; 9658 return true;
9651 } 9659 }
9652 if (filter[filter.length() - 1] == '*' && 9660 if (filter[filter.length() - 1] == '*' &&
9653 name->IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) { 9661 name->IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) {
9654 return true; 9662 return true;
9655 } 9663 }
9656 return false; 9664 return false;
(...skipping 6291 matching lines...) Expand 10 before | Expand all | Expand 10 after
15948 15956
15949 void PropertyCell::AddDependentCode(Handle<Code> code) { 15957 void PropertyCell::AddDependentCode(Handle<Code> code) {
15950 Handle<DependentCode> codes = DependentCode::Insert( 15958 Handle<DependentCode> codes = DependentCode::Insert(
15951 Handle<DependentCode>(dependent_code()), 15959 Handle<DependentCode>(dependent_code()),
15952 DependentCode::kPropertyCellChangedGroup, code); 15960 DependentCode::kPropertyCellChangedGroup, code);
15953 if (*codes != dependent_code()) set_dependent_code(*codes); 15961 if (*codes != dependent_code()) set_dependent_code(*codes);
15954 } 15962 }
15955 15963
15956 15964
15957 } } // namespace v8::internal 15965 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698