OLD | NEW |
---|---|
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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
454 Object* result; | 454 Object* result; |
455 { MaybeObject* maybe_result = | 455 { MaybeObject* maybe_result = |
456 receiver->UpdateMapCodeCache(name, Code::cast(code)); | 456 receiver->UpdateMapCodeCache(name, Code::cast(code)); |
457 if (!maybe_result->ToObject(&result)) return maybe_result; | 457 if (!maybe_result->ToObject(&result)) return maybe_result; |
458 } | 458 } |
459 } | 459 } |
460 return code; | 460 return code; |
461 } | 461 } |
462 | 462 |
463 | 463 |
464 MaybeObject* StubCache::ComputeKeyedLoadPixelArray(JSObject* receiver) { | |
465 Code::Flags flags = | |
466 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, NORMAL); | |
Mads Ager (chromium)
2011/02/01 12:02:12
This is sort of a misuse of the NORMAL tag which n
danno
2011/02/03 12:53:26
Done.
| |
467 String* name = Heap::KeyedLoadPixelArray_symbol(); | |
468 Object* code = receiver->map()->FindInCodeCache(name, flags); | |
469 if (code->IsUndefined()) { | |
470 KeyedLoadStubCompiler compiler; | |
471 { MaybeObject* maybe_code = compiler.CompileLoadPixelArray(receiver); | |
472 if (!maybe_code->ToObject(&code)) return maybe_code; | |
473 } | |
474 PROFILE(CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, Code::cast(code), 0)); | |
475 Object* result; | |
476 { MaybeObject* maybe_result = | |
477 receiver->UpdateMapCodeCache(name, Code::cast(code)); | |
478 if (!maybe_result->ToObject(&result)) return maybe_result; | |
479 } | |
480 } | |
481 return code; | |
482 } | |
483 | |
484 | |
464 MaybeObject* StubCache::ComputeStoreField(String* name, | 485 MaybeObject* StubCache::ComputeStoreField(String* name, |
465 JSObject* receiver, | 486 JSObject* receiver, |
466 int field_index, | 487 int field_index, |
467 Map* transition) { | 488 Map* transition) { |
468 PropertyType type = (transition == NULL) ? FIELD : MAP_TRANSITION; | 489 PropertyType type = (transition == NULL) ? FIELD : MAP_TRANSITION; |
469 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::STORE_IC, type); | 490 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::STORE_IC, type); |
470 Object* code = receiver->map()->FindInCodeCache(name, flags); | 491 Object* code = receiver->map()->FindInCodeCache(name, flags); |
471 if (code->IsUndefined()) { | 492 if (code->IsUndefined()) { |
472 StoreStubCompiler compiler; | 493 StoreStubCompiler compiler; |
473 { MaybeObject* maybe_code = | 494 { MaybeObject* maybe_code = |
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1783 if (!maybe_result->ToObject(&result)) return maybe_result; | 1804 if (!maybe_result->ToObject(&result)) return maybe_result; |
1784 } | 1805 } |
1785 Code* code = Code::cast(result); | 1806 Code* code = Code::cast(result); |
1786 USE(code); | 1807 USE(code); |
1787 PROFILE(CodeCreateEvent(Logger::STUB_TAG, code, "ExternalArrayStub")); | 1808 PROFILE(CodeCreateEvent(Logger::STUB_TAG, code, "ExternalArrayStub")); |
1788 return result; | 1809 return result; |
1789 } | 1810 } |
1790 | 1811 |
1791 | 1812 |
1792 } } // namespace v8::internal | 1813 } } // namespace v8::internal |
OLD | NEW |