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

Side by Side Diff: src/objects.cc

Issue 6894003: Better support for 'polymorphic' JS and external arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback and merge Created 9 years, 7 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
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 3746 matching lines...) Expand 10 before | Expand all | Expand 10 after
3757 *map_or_index_field = heap()->fixed_array_map(); 3757 *map_or_index_field = heap()->fixed_array_map();
3758 Map* prev = current->map(); 3758 Map* prev = current->map();
3759 current->set_map(meta_map); 3759 current->set_map(meta_map);
3760 callback(current, data); 3760 callback(current, data);
3761 current = prev; 3761 current = prev;
3762 } 3762 }
3763 } 3763 }
3764 3764
3765 3765
3766 MaybeObject* CodeCache::Update(String* name, Code* code) { 3766 MaybeObject* CodeCache::Update(String* name, Code* code) {
3767 ASSERT(code->ic_state() == MONOMORPHIC);
Mads Ager (chromium) 2011/05/12 09:42:47 We should reintroduce this assert once we have rem
danno 2011/06/01 13:16:08 Agreed. On 2011/05/12 09:42:47, Mads Ager wrote:
3768
3769 // The number of monomorphic stubs for normal load/store/call IC's can grow to 3767 // The number of monomorphic stubs for normal load/store/call IC's can grow to
3770 // a large number and therefore they need to go into a hash table. They are 3768 // a large number and therefore they need to go into a hash table. They are
3771 // used to load global properties from cells. 3769 // used to load global properties from cells.
3772 if (code->type() == NORMAL) { 3770 if (code->type() == NORMAL) {
3773 // Make sure that a hash table is allocated for the normal load code cache. 3771 // Make sure that a hash table is allocated for the normal load code cache.
3774 if (normal_type_cache()->IsUndefined()) { 3772 if (normal_type_cache()->IsUndefined()) {
3775 Object* result; 3773 Object* result;
3776 { MaybeObject* maybe_result = 3774 { MaybeObject* maybe_result =
3777 CodeCacheHashTable::Allocate(CodeCacheHashTable::kInitialSize); 3775 CodeCacheHashTable::Allocate(CodeCacheHashTable::kInitialSize);
3778 if (!maybe_result->ToObject(&result)) return maybe_result; 3776 if (!maybe_result->ToObject(&result)) return maybe_result;
(...skipping 2722 matching lines...) Expand 10 before | Expand all | Expand 10 after
6501 6499
6502 // Identify kind of code. 6500 // Identify kind of code.
6503 const char* Code::Kind2String(Kind kind) { 6501 const char* Code::Kind2String(Kind kind) {
6504 switch (kind) { 6502 switch (kind) {
6505 case FUNCTION: return "FUNCTION"; 6503 case FUNCTION: return "FUNCTION";
6506 case OPTIMIZED_FUNCTION: return "OPTIMIZED_FUNCTION"; 6504 case OPTIMIZED_FUNCTION: return "OPTIMIZED_FUNCTION";
6507 case STUB: return "STUB"; 6505 case STUB: return "STUB";
6508 case BUILTIN: return "BUILTIN"; 6506 case BUILTIN: return "BUILTIN";
6509 case LOAD_IC: return "LOAD_IC"; 6507 case LOAD_IC: return "LOAD_IC";
6510 case KEYED_LOAD_IC: return "KEYED_LOAD_IC"; 6508 case KEYED_LOAD_IC: return "KEYED_LOAD_IC";
6511 case KEYED_EXTERNAL_ARRAY_LOAD_IC: return "KEYED_EXTERNAL_ARRAY_LOAD_IC";
6512 case STORE_IC: return "STORE_IC"; 6509 case STORE_IC: return "STORE_IC";
6513 case KEYED_STORE_IC: return "KEYED_STORE_IC"; 6510 case KEYED_STORE_IC: return "KEYED_STORE_IC";
6514 case KEYED_EXTERNAL_ARRAY_STORE_IC: return "KEYED_EXTERNAL_ARRAY_STORE_IC";
6515 case CALL_IC: return "CALL_IC"; 6511 case CALL_IC: return "CALL_IC";
6516 case KEYED_CALL_IC: return "KEYED_CALL_IC"; 6512 case KEYED_CALL_IC: return "KEYED_CALL_IC";
6517 case TYPE_RECORDING_UNARY_OP_IC: return "TYPE_RECORDING_UNARY_OP_IC"; 6513 case TYPE_RECORDING_UNARY_OP_IC: return "TYPE_RECORDING_UNARY_OP_IC";
6518 case TYPE_RECORDING_BINARY_OP_IC: return "TYPE_RECORDING_BINARY_OP_IC"; 6514 case TYPE_RECORDING_BINARY_OP_IC: return "TYPE_RECORDING_BINARY_OP_IC";
6519 case COMPARE_IC: return "COMPARE_IC"; 6515 case COMPARE_IC: return "COMPARE_IC";
6520 } 6516 }
6521 UNREACHABLE(); 6517 UNREACHABLE();
6522 return NULL; 6518 return NULL;
6523 } 6519 }
6524 6520
(...skipping 3897 matching lines...) Expand 10 before | Expand all | Expand 10 after
10422 if (break_point_objects()->IsUndefined()) return 0; 10418 if (break_point_objects()->IsUndefined()) return 0;
10423 // Single beak point. 10419 // Single beak point.
10424 if (!break_point_objects()->IsFixedArray()) return 1; 10420 if (!break_point_objects()->IsFixedArray()) return 1;
10425 // Multiple break points. 10421 // Multiple break points.
10426 return FixedArray::cast(break_point_objects())->length(); 10422 return FixedArray::cast(break_point_objects())->length();
10427 } 10423 }
10428 #endif 10424 #endif
10429 10425
10430 10426
10431 } } // namespace v8::internal 10427 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698