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

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

Issue 2813002: Only update the stub cache tables with monomorphic stubs used by... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 6 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/ic.cc ('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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 Object* code = receiver->map()->FindInCodeCache(cache_name, flags); 114 Object* code = receiver->map()->FindInCodeCache(cache_name, flags);
115 if (code->IsUndefined()) { 115 if (code->IsUndefined()) {
116 LoadStubCompiler compiler; 116 LoadStubCompiler compiler;
117 code = compiler.CompileLoadNonexistent(cache_name, receiver, last); 117 code = compiler.CompileLoadNonexistent(cache_name, receiver, last);
118 if (code->IsFailure()) return code; 118 if (code->IsFailure()) return code;
119 PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), cache_name)); 119 PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), cache_name));
120 Object* result = 120 Object* result =
121 receiver->map()->UpdateCodeCache(cache_name, Code::cast(code)); 121 receiver->map()->UpdateCodeCache(cache_name, Code::cast(code));
122 if (result->IsFailure()) return result; 122 if (result->IsFailure()) return result;
123 } 123 }
124 return Set(name, receiver->map(), Code::cast(code)); 124 return code;
125 } 125 }
126 126
127 127
128 Object* StubCache::ComputeLoadField(String* name, 128 Object* StubCache::ComputeLoadField(String* name,
129 JSObject* receiver, 129 JSObject* receiver,
130 JSObject* holder, 130 JSObject* holder,
131 int field_index) { 131 int field_index) {
132 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, FIELD); 132 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, FIELD);
133 Object* code = receiver->map()->FindInCodeCache(name, flags); 133 Object* code = receiver->map()->FindInCodeCache(name, flags);
134 if (code->IsUndefined()) { 134 if (code->IsUndefined()) {
135 LoadStubCompiler compiler; 135 LoadStubCompiler compiler;
136 code = compiler.CompileLoadField(receiver, holder, field_index, name); 136 code = compiler.CompileLoadField(receiver, holder, field_index, name);
137 if (code->IsFailure()) return code; 137 if (code->IsFailure()) return code;
138 PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name)); 138 PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
139 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); 139 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code));
140 if (result->IsFailure()) return result; 140 if (result->IsFailure()) return result;
141 } 141 }
142 return Set(name, receiver->map(), Code::cast(code)); 142 return code;
143 } 143 }
144 144
145 145
146 Object* StubCache::ComputeLoadCallback(String* name, 146 Object* StubCache::ComputeLoadCallback(String* name,
147 JSObject* receiver, 147 JSObject* receiver,
148 JSObject* holder, 148 JSObject* holder,
149 AccessorInfo* callback) { 149 AccessorInfo* callback) {
150 ASSERT(v8::ToCData<Address>(callback->getter()) != 0); 150 ASSERT(v8::ToCData<Address>(callback->getter()) != 0);
151 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, CALLBACKS); 151 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, CALLBACKS);
152 Object* code = receiver->map()->FindInCodeCache(name, flags); 152 Object* code = receiver->map()->FindInCodeCache(name, flags);
153 if (code->IsUndefined()) { 153 if (code->IsUndefined()) {
154 LoadStubCompiler compiler; 154 LoadStubCompiler compiler;
155 code = compiler.CompileLoadCallback(name, receiver, holder, callback); 155 code = compiler.CompileLoadCallback(name, receiver, holder, callback);
156 if (code->IsFailure()) return code; 156 if (code->IsFailure()) return code;
157 PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name)); 157 PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
158 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); 158 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code));
159 if (result->IsFailure()) return result; 159 if (result->IsFailure()) return result;
160 } 160 }
161 return Set(name, receiver->map(), Code::cast(code)); 161 return code;
162 } 162 }
163 163
164 164
165 Object* StubCache::ComputeLoadConstant(String* name, 165 Object* StubCache::ComputeLoadConstant(String* name,
166 JSObject* receiver, 166 JSObject* receiver,
167 JSObject* holder, 167 JSObject* holder,
168 Object* value) { 168 Object* value) {
169 Code::Flags flags = 169 Code::Flags flags =
170 Code::ComputeMonomorphicFlags(Code::LOAD_IC, CONSTANT_FUNCTION); 170 Code::ComputeMonomorphicFlags(Code::LOAD_IC, CONSTANT_FUNCTION);
171 Object* code = receiver->map()->FindInCodeCache(name, flags); 171 Object* code = receiver->map()->FindInCodeCache(name, flags);
172 if (code->IsUndefined()) { 172 if (code->IsUndefined()) {
173 LoadStubCompiler compiler; 173 LoadStubCompiler compiler;
174 code = compiler.CompileLoadConstant(receiver, holder, value, name); 174 code = compiler.CompileLoadConstant(receiver, holder, value, name);
175 if (code->IsFailure()) return code; 175 if (code->IsFailure()) return code;
176 PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name)); 176 PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
177 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); 177 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code));
178 if (result->IsFailure()) return result; 178 if (result->IsFailure()) return result;
179 } 179 }
180 return Set(name, receiver->map(), Code::cast(code)); 180 return code;
181 } 181 }
182 182
183 183
184 Object* StubCache::ComputeLoadInterceptor(String* name, 184 Object* StubCache::ComputeLoadInterceptor(String* name,
185 JSObject* receiver, 185 JSObject* receiver,
186 JSObject* holder) { 186 JSObject* holder) {
187 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, INTERCEPTOR); 187 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, INTERCEPTOR);
188 Object* code = receiver->map()->FindInCodeCache(name, flags); 188 Object* code = receiver->map()->FindInCodeCache(name, flags);
189 if (code->IsUndefined()) { 189 if (code->IsUndefined()) {
190 LoadStubCompiler compiler; 190 LoadStubCompiler compiler;
191 code = compiler.CompileLoadInterceptor(receiver, holder, name); 191 code = compiler.CompileLoadInterceptor(receiver, holder, name);
192 if (code->IsFailure()) return code; 192 if (code->IsFailure()) return code;
193 PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name)); 193 PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
194 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); 194 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code));
195 if (result->IsFailure()) return result; 195 if (result->IsFailure()) return result;
196 } 196 }
197 return Set(name, receiver->map(), Code::cast(code)); 197 return code;
198 } 198 }
199 199
200 200
201 Object* StubCache::ComputeLoadNormal(String* name, JSObject* receiver) { 201 Object* StubCache::ComputeLoadNormal(String* name, JSObject* receiver) {
202 Code* code = Builtins::builtin(Builtins::LoadIC_Normal); 202 return Builtins::builtin(Builtins::LoadIC_Normal);
203 return Set(name, receiver->map(), code);
204 } 203 }
205 204
206 205
207 Object* StubCache::ComputeLoadGlobal(String* name, 206 Object* StubCache::ComputeLoadGlobal(String* name,
208 JSObject* receiver, 207 JSObject* receiver,
209 GlobalObject* holder, 208 GlobalObject* holder,
210 JSGlobalPropertyCell* cell, 209 JSGlobalPropertyCell* cell,
211 bool is_dont_delete) { 210 bool is_dont_delete) {
212 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, NORMAL); 211 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, NORMAL);
213 Object* code = receiver->map()->FindInCodeCache(name, flags); 212 Object* code = receiver->map()->FindInCodeCache(name, flags);
214 if (code->IsUndefined()) { 213 if (code->IsUndefined()) {
215 LoadStubCompiler compiler; 214 LoadStubCompiler compiler;
216 code = compiler.CompileLoadGlobal(receiver, 215 code = compiler.CompileLoadGlobal(receiver,
217 holder, 216 holder,
218 cell, 217 cell,
219 name, 218 name,
220 is_dont_delete); 219 is_dont_delete);
221 if (code->IsFailure()) return code; 220 if (code->IsFailure()) return code;
222 PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name)); 221 PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
223 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); 222 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code));
224 if (result->IsFailure()) return result; 223 if (result->IsFailure()) return result;
225 } 224 }
226 return Set(name, receiver->map(), Code::cast(code)); 225 return code;
227 } 226 }
228 227
229 228
230 Object* StubCache::ComputeKeyedLoadField(String* name, 229 Object* StubCache::ComputeKeyedLoadField(String* name,
231 JSObject* receiver, 230 JSObject* receiver,
232 JSObject* holder, 231 JSObject* holder,
233 int field_index) { 232 int field_index) {
234 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, FIELD); 233 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, FIELD);
235 Object* code = receiver->map()->FindInCodeCache(name, flags); 234 Object* code = receiver->map()->FindInCodeCache(name, flags);
236 if (code->IsUndefined()) { 235 if (code->IsUndefined()) {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::STORE_IC, type); 360 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::STORE_IC, type);
362 Object* code = receiver->map()->FindInCodeCache(name, flags); 361 Object* code = receiver->map()->FindInCodeCache(name, flags);
363 if (code->IsUndefined()) { 362 if (code->IsUndefined()) {
364 StoreStubCompiler compiler; 363 StoreStubCompiler compiler;
365 code = compiler.CompileStoreField(receiver, field_index, transition, name); 364 code = compiler.CompileStoreField(receiver, field_index, transition, name);
366 if (code->IsFailure()) return code; 365 if (code->IsFailure()) return code;
367 PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG, Code::cast(code), name)); 366 PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG, Code::cast(code), name));
368 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); 367 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code));
369 if (result->IsFailure()) return result; 368 if (result->IsFailure()) return result;
370 } 369 }
371 return Set(name, receiver->map(), Code::cast(code)); 370 return code;
372 } 371 }
373 372
374 373
375 Object* StubCache::ComputeStoreGlobal(String* name, 374 Object* StubCache::ComputeStoreGlobal(String* name,
376 GlobalObject* receiver, 375 GlobalObject* receiver,
377 JSGlobalPropertyCell* cell) { 376 JSGlobalPropertyCell* cell) {
378 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::STORE_IC, NORMAL); 377 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::STORE_IC, NORMAL);
379 Object* code = receiver->map()->FindInCodeCache(name, flags); 378 Object* code = receiver->map()->FindInCodeCache(name, flags);
380 if (code->IsUndefined()) { 379 if (code->IsUndefined()) {
381 StoreStubCompiler compiler; 380 StoreStubCompiler compiler;
382 code = compiler.CompileStoreGlobal(receiver, cell, name); 381 code = compiler.CompileStoreGlobal(receiver, cell, name);
383 if (code->IsFailure()) return code; 382 if (code->IsFailure()) return code;
384 PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name)); 383 PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, Code::cast(code), name));
385 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); 384 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code));
386 if (result->IsFailure()) return result; 385 if (result->IsFailure()) return result;
387 } 386 }
388 return Set(name, receiver->map(), Code::cast(code)); 387 return code;
389 } 388 }
390 389
391 390
392 Object* StubCache::ComputeStoreCallback(String* name, 391 Object* StubCache::ComputeStoreCallback(String* name,
393 JSObject* receiver, 392 JSObject* receiver,
394 AccessorInfo* callback) { 393 AccessorInfo* callback) {
395 ASSERT(v8::ToCData<Address>(callback->setter()) != 0); 394 ASSERT(v8::ToCData<Address>(callback->setter()) != 0);
396 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::STORE_IC, CALLBACKS); 395 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::STORE_IC, CALLBACKS);
397 Object* code = receiver->map()->FindInCodeCache(name, flags); 396 Object* code = receiver->map()->FindInCodeCache(name, flags);
398 if (code->IsUndefined()) { 397 if (code->IsUndefined()) {
399 StoreStubCompiler compiler; 398 StoreStubCompiler compiler;
400 code = compiler.CompileStoreCallback(receiver, callback, name); 399 code = compiler.CompileStoreCallback(receiver, callback, name);
401 if (code->IsFailure()) return code; 400 if (code->IsFailure()) return code;
402 PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG, Code::cast(code), name)); 401 PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG, Code::cast(code), name));
403 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); 402 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code));
404 if (result->IsFailure()) return result; 403 if (result->IsFailure()) return result;
405 } 404 }
406 return Set(name, receiver->map(), Code::cast(code)); 405 return code;
407 } 406 }
408 407
409 408
410 Object* StubCache::ComputeStoreInterceptor(String* name, 409 Object* StubCache::ComputeStoreInterceptor(String* name,
411 JSObject* receiver) { 410 JSObject* receiver) {
412 Code::Flags flags = 411 Code::Flags flags =
413 Code::ComputeMonomorphicFlags(Code::STORE_IC, INTERCEPTOR); 412 Code::ComputeMonomorphicFlags(Code::STORE_IC, INTERCEPTOR);
414 Object* code = receiver->map()->FindInCodeCache(name, flags); 413 Object* code = receiver->map()->FindInCodeCache(name, flags);
415 if (code->IsUndefined()) { 414 if (code->IsUndefined()) {
416 StoreStubCompiler compiler; 415 StoreStubCompiler compiler;
417 code = compiler.CompileStoreInterceptor(receiver, name); 416 code = compiler.CompileStoreInterceptor(receiver, name);
418 if (code->IsFailure()) return code; 417 if (code->IsFailure()) return code;
419 PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG, Code::cast(code), name)); 418 PROFILE(CodeCreateEvent(Logger::STORE_IC_TAG, Code::cast(code), name));
420 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); 419 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code));
421 if (result->IsFailure()) return result; 420 if (result->IsFailure()) return result;
422 } 421 }
423 return Set(name, receiver->map(), Code::cast(code)); 422 return code;
424 } 423 }
425 424
426 425
427 Object* StubCache::ComputeKeyedStoreField(String* name, JSObject* receiver, 426 Object* StubCache::ComputeKeyedStoreField(String* name, JSObject* receiver,
428 int field_index, Map* transition) { 427 int field_index, Map* transition) {
429 PropertyType type = (transition == NULL) ? FIELD : MAP_TRANSITION; 428 PropertyType type = (transition == NULL) ? FIELD : MAP_TRANSITION;
430 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_STORE_IC, type); 429 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_STORE_IC, type);
431 Object* code = receiver->map()->FindInCodeCache(name, flags); 430 Object* code = receiver->map()->FindInCodeCache(name, flags);
432 if (code->IsUndefined()) { 431 if (code->IsUndefined()) {
433 KeyedStoreStubCompiler compiler; 432 KeyedStoreStubCompiler compiler;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 // Compile the stub - only create stubs for fully compiled functions. 478 // Compile the stub - only create stubs for fully compiled functions.
480 CallStubCompiler compiler(argc, in_loop, kind); 479 CallStubCompiler compiler(argc, in_loop, kind);
481 code = compiler.CompileCallConstant(object, holder, function, name, check); 480 code = compiler.CompileCallConstant(object, holder, function, name, check);
482 if (code->IsFailure()) return code; 481 if (code->IsFailure()) return code;
483 ASSERT_EQ(flags, Code::cast(code)->flags()); 482 ASSERT_EQ(flags, Code::cast(code)->flags());
484 PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), 483 PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG),
485 Code::cast(code), name)); 484 Code::cast(code), name));
486 Object* result = map->UpdateCodeCache(name, Code::cast(code)); 485 Object* result = map->UpdateCodeCache(name, Code::cast(code));
487 if (result->IsFailure()) return result; 486 if (result->IsFailure()) return result;
488 } 487 }
489 return Set(name, map, Code::cast(code)); 488 return code;
490 } 489 }
491 490
492 491
493 Object* StubCache::ComputeCallField(int argc, 492 Object* StubCache::ComputeCallField(int argc,
494 InLoopFlag in_loop, 493 InLoopFlag in_loop,
495 Code::Kind kind, 494 Code::Kind kind,
496 String* name, 495 String* name,
497 Object* object, 496 Object* object,
498 JSObject* holder, 497 JSObject* holder,
499 int index) { 498 int index) {
(...skipping 18 matching lines...) Expand all
518 holder, 517 holder,
519 index, 518 index,
520 name); 519 name);
521 if (code->IsFailure()) return code; 520 if (code->IsFailure()) return code;
522 ASSERT_EQ(flags, Code::cast(code)->flags()); 521 ASSERT_EQ(flags, Code::cast(code)->flags());
523 PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), 522 PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG),
524 Code::cast(code), name)); 523 Code::cast(code), name));
525 Object* result = map->UpdateCodeCache(name, Code::cast(code)); 524 Object* result = map->UpdateCodeCache(name, Code::cast(code));
526 if (result->IsFailure()) return result; 525 if (result->IsFailure()) return result;
527 } 526 }
528 return Set(name, map, Code::cast(code)); 527 return code;
529 } 528 }
530 529
531 530
532 Object* StubCache::ComputeCallInterceptor(int argc, 531 Object* StubCache::ComputeCallInterceptor(int argc,
533 Code::Kind kind, 532 Code::Kind kind,
534 String* name, 533 String* name,
535 Object* object, 534 Object* object,
536 JSObject* holder) { 535 JSObject* holder) {
537 // Compute the check type and the map. 536 // Compute the check type and the map.
538 // If the object is a value, we use the prototype map for the cache. 537 // If the object is a value, we use the prototype map for the cache.
(...skipping 17 matching lines...) Expand all
556 code = compiler.CompileCallInterceptor(JSObject::cast(object), 555 code = compiler.CompileCallInterceptor(JSObject::cast(object),
557 holder, 556 holder,
558 name); 557 name);
559 if (code->IsFailure()) return code; 558 if (code->IsFailure()) return code;
560 ASSERT_EQ(flags, Code::cast(code)->flags()); 559 ASSERT_EQ(flags, Code::cast(code)->flags());
561 PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), 560 PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG),
562 Code::cast(code), name)); 561 Code::cast(code), name));
563 Object* result = map->UpdateCodeCache(name, Code::cast(code)); 562 Object* result = map->UpdateCodeCache(name, Code::cast(code));
564 if (result->IsFailure()) return result; 563 if (result->IsFailure()) return result;
565 } 564 }
566 return Set(name, map, Code::cast(code)); 565 return code;
567 } 566 }
568 567
569 568
570 Object* StubCache::ComputeCallNormal(int argc, 569 Object* StubCache::ComputeCallNormal(int argc,
571 InLoopFlag in_loop, 570 InLoopFlag in_loop,
572 Code::Kind kind, 571 Code::Kind kind,
573 String* name, 572 String* name,
574 JSObject* receiver) { 573 JSObject* receiver) {
575 Object* code = ComputeCallNormal(argc, in_loop, kind); 574 Object* code = ComputeCallNormal(argc, in_loop, kind);
576 if (code->IsFailure()) return code; 575 if (code->IsFailure()) return code;
577 return Set(name, receiver->map(), Code::cast(code)); 576 return code;
578 } 577 }
579 578
580 579
581 Object* StubCache::ComputeCallGlobal(int argc, 580 Object* StubCache::ComputeCallGlobal(int argc,
582 InLoopFlag in_loop, 581 InLoopFlag in_loop,
583 Code::Kind kind, 582 Code::Kind kind,
584 String* name, 583 String* name,
585 JSObject* receiver, 584 JSObject* receiver,
586 GlobalObject* holder, 585 GlobalObject* holder,
587 JSGlobalPropertyCell* cell, 586 JSGlobalPropertyCell* cell,
(...skipping 12 matching lines...) Expand all
600 if (!function->is_compiled()) return Failure::InternalError(); 599 if (!function->is_compiled()) return Failure::InternalError();
601 CallStubCompiler compiler(argc, in_loop, kind); 600 CallStubCompiler compiler(argc, in_loop, kind);
602 code = compiler.CompileCallGlobal(receiver, holder, cell, function, name); 601 code = compiler.CompileCallGlobal(receiver, holder, cell, function, name);
603 if (code->IsFailure()) return code; 602 if (code->IsFailure()) return code;
604 ASSERT_EQ(flags, Code::cast(code)->flags()); 603 ASSERT_EQ(flags, Code::cast(code)->flags());
605 PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), 604 PROFILE(CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG),
606 Code::cast(code), name)); 605 Code::cast(code), name));
607 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); 606 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code));
608 if (result->IsFailure()) return result; 607 if (result->IsFailure()) return result;
609 } 608 }
610 return Set(name, receiver->map(), Code::cast(code)); 609 return code;
611 } 610 }
612 611
613 612
614 static Object* GetProbeValue(Code::Flags flags) { 613 static Object* GetProbeValue(Code::Flags flags) {
615 // Use raw_unchecked... so we don't get assert failures during GC. 614 // Use raw_unchecked... so we don't get assert failures during GC.
616 NumberDictionary* dictionary = Heap::raw_unchecked_non_monomorphic_cache(); 615 NumberDictionary* dictionary = Heap::raw_unchecked_non_monomorphic_cache();
617 int entry = dictionary->FindEntry(flags); 616 int entry = dictionary->FindEntry(flags);
618 if (entry != -1) return dictionary->ValueAt(entry); 617 if (entry != -1) return dictionary->ValueAt(entry);
619 return Heap::raw_unchecked_undefined_value(); 618 return Heap::raw_unchecked_undefined_value();
620 } 619 }
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 expected_receiver_type_ = 1317 expected_receiver_type_ =
1319 FunctionTemplateInfo::cast(signature->receiver()); 1318 FunctionTemplateInfo::cast(signature->receiver());
1320 } 1319 }
1321 } 1320 }
1322 1321
1323 is_simple_api_call_ = true; 1322 is_simple_api_call_ = true;
1324 } 1323 }
1325 1324
1326 1325
1327 } } // namespace v8::internal 1326 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698