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

Side by Side Diff: src/objects.cc

Issue 23691056: Handle non-JSObject heap objects using slow-path IC stub guarded by the map. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comment Created 7 years, 3 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/objects.h ('k') | src/stub-cache.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 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 4461 matching lines...) Expand 10 before | Expand all | Expand 10 after
4472 4472
4473 4473
4474 void NormalizedMapCache::Clear() { 4474 void NormalizedMapCache::Clear() {
4475 int entries = length(); 4475 int entries = length();
4476 for (int i = 0; i != entries; i++) { 4476 for (int i = 0; i != entries; i++) {
4477 set_undefined(i); 4477 set_undefined(i);
4478 } 4478 }
4479 } 4479 }
4480 4480
4481 4481
4482 void JSObject::UpdateMapCodeCache(Handle<JSObject> object, 4482 void HeapObject::UpdateMapCodeCache(Handle<HeapObject> object,
4483 Handle<Name> name, 4483 Handle<Name> name,
4484 Handle<Code> code) { 4484 Handle<Code> code) {
4485 Handle<Map> map(object->map()); 4485 Handle<Map> map(object->map());
4486 if (map->is_shared()) { 4486 if (map->is_shared()) {
4487 Handle<JSObject> receiver = Handle<JSObject>::cast(object);
4487 // Fast case maps are never marked as shared. 4488 // Fast case maps are never marked as shared.
4488 ASSERT(!object->HasFastProperties()); 4489 ASSERT(!receiver->HasFastProperties());
4489 // Replace the map with an identical copy that can be safely modified. 4490 // Replace the map with an identical copy that can be safely modified.
4490 map = Map::CopyNormalized(map, KEEP_INOBJECT_PROPERTIES, 4491 map = Map::CopyNormalized(map, KEEP_INOBJECT_PROPERTIES,
4491 UNIQUE_NORMALIZED_MAP); 4492 UNIQUE_NORMALIZED_MAP);
4492 object->GetIsolate()->counters()->normalized_maps()->Increment(); 4493 receiver->GetIsolate()->counters()->normalized_maps()->Increment();
4493 object->set_map(*map); 4494 receiver->set_map(*map);
4494 } 4495 }
4495 Map::UpdateCodeCache(map, name, code); 4496 Map::UpdateCodeCache(map, name, code);
4496 } 4497 }
4497 4498
4498 4499
4499 void JSObject::NormalizeProperties(Handle<JSObject> object, 4500 void JSObject::NormalizeProperties(Handle<JSObject> object,
4500 PropertyNormalizationMode mode, 4501 PropertyNormalizationMode mode,
4501 int expected_additional_properties) { 4502 int expected_additional_properties) {
4502 CALL_HEAP_FUNCTION_VOID(object->GetIsolate(), 4503 CALL_HEAP_FUNCTION_VOID(object->GetIsolate(),
4503 object->NormalizeProperties( 4504 object->NormalizeProperties(
(...skipping 11584 matching lines...) Expand 10 before | Expand all | Expand 10 after
16088 #define ERROR_MESSAGES_TEXTS(C, T) T, 16089 #define ERROR_MESSAGES_TEXTS(C, T) T,
16089 static const char* error_messages_[] = { 16090 static const char* error_messages_[] = {
16090 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16091 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16091 }; 16092 };
16092 #undef ERROR_MESSAGES_TEXTS 16093 #undef ERROR_MESSAGES_TEXTS
16093 return error_messages_[reason]; 16094 return error_messages_[reason];
16094 } 16095 }
16095 16096
16096 16097
16097 } } // namespace v8::internal 16098 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698