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

Side by Side Diff: src/stub-cache.cc

Issue 8139027: Version 3.6.5 (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 9 years, 2 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/stub-cache.h ('k') | src/token.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
48 memset(primary_, 0, sizeof(primary_[0]) * StubCache::kPrimaryTableSize); 48 memset(primary_, 0, sizeof(primary_[0]) * StubCache::kPrimaryTableSize);
49 memset(secondary_, 0, sizeof(secondary_[0]) * StubCache::kSecondaryTableSize); 49 memset(secondary_, 0, sizeof(secondary_[0]) * StubCache::kSecondaryTableSize);
50 } 50 }
51 51
52 52
53 void StubCache::Initialize(bool create_heap_objects) { 53 void StubCache::Initialize(bool create_heap_objects) {
54 ASSERT(IsPowerOf2(kPrimaryTableSize)); 54 ASSERT(IsPowerOf2(kPrimaryTableSize));
55 ASSERT(IsPowerOf2(kSecondaryTableSize)); 55 ASSERT(IsPowerOf2(kSecondaryTableSize));
56 if (create_heap_objects) { 56 if (create_heap_objects) {
57 HandleScope scope; 57 HandleScope scope;
58 Clear(); 58 Code* empty = isolate_->builtins()->builtin(Builtins::kIllegal);
59 for (int i = 0; i < kPrimaryTableSize; i++) {
60 primary_[i].key = heap()->empty_string();
61 primary_[i].value = empty;
62 }
63 for (int j = 0; j < kSecondaryTableSize; j++) {
64 secondary_[j].key = heap()->empty_string();
65 secondary_[j].value = empty;
66 }
59 } 67 }
60 } 68 }
61 69
62 70
63 Code* StubCache::Set(String* name, Map* map, Code* code) { 71 Code* StubCache::Set(String* name, Map* map, Code* code) {
64 // Get the flags from the code. 72 // Get the flags from the code.
65 Code::Flags flags = Code::RemoveTypeFromFlags(code->flags()); 73 Code::Flags flags = Code::RemoveTypeFromFlags(code->flags());
66 74
67 // Validate that the name does not move on scavenge, and that we 75 // Validate that the name does not move on scavenge, and that we
68 // can use identity checks instead of string equality checks. 76 // can use identity checks instead of string equality checks.
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 if (!maybe_probe->ToObject(&probe)) return maybe_probe; 1100 if (!maybe_probe->ToObject(&probe)) return maybe_probe;
1093 } 1101 }
1094 if (!probe->IsUndefined()) return probe; 1102 if (!probe->IsUndefined()) return probe;
1095 StubCompiler compiler; 1103 StubCompiler compiler;
1096 return FillCache(isolate_, compiler.CompileCallDebugPrepareStepIn(flags)); 1104 return FillCache(isolate_, compiler.CompileCallDebugPrepareStepIn(flags));
1097 } 1105 }
1098 #endif 1106 #endif
1099 1107
1100 1108
1101 void StubCache::Clear() { 1109 void StubCache::Clear() {
1110 Code* empty = isolate_->builtins()->builtin(Builtins::kIllegal);
1102 for (int i = 0; i < kPrimaryTableSize; i++) { 1111 for (int i = 0; i < kPrimaryTableSize; i++) {
1103 primary_[i].key = heap()->empty_string(); 1112 primary_[i].key = heap()->empty_string();
1104 primary_[i].value = isolate_->builtins()->builtin( 1113 primary_[i].value = empty;
1105 Builtins::kIllegal);
1106 } 1114 }
1107 for (int j = 0; j < kSecondaryTableSize; j++) { 1115 for (int j = 0; j < kSecondaryTableSize; j++) {
1108 secondary_[j].key = heap()->empty_string(); 1116 secondary_[j].key = heap()->empty_string();
1109 secondary_[j].value = isolate_->builtins()->builtin( 1117 secondary_[j].value = empty;
1110 Builtins::kIllegal);
1111 } 1118 }
1112 } 1119 }
1113 1120
1114 1121
1115 void StubCache::CollectMatchingMaps(SmallMapList* types, 1122 void StubCache::CollectMatchingMaps(SmallMapList* types,
1116 String* name, 1123 String* name,
1117 Code::Flags flags) { 1124 Code::Flags flags) {
1118 for (int i = 0; i < kPrimaryTableSize; i++) { 1125 for (int i = 0; i < kPrimaryTableSize; i++) {
1119 if (primary_[i].key == name) { 1126 if (primary_[i].key == name) {
1120 Map* map = primary_[i].value->FindFirstMap(); 1127 Map* map = primary_[i].value->FindFirstMap();
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1833 expected_receiver_type_ = 1840 expected_receiver_type_ =
1834 FunctionTemplateInfo::cast(signature->receiver()); 1841 FunctionTemplateInfo::cast(signature->receiver());
1835 } 1842 }
1836 } 1843 }
1837 1844
1838 is_simple_api_call_ = true; 1845 is_simple_api_call_ = true;
1839 } 1846 }
1840 1847
1841 1848
1842 } } // namespace v8::internal 1849 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698