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

Side by Side Diff: src/objects-inl.h

Issue 447293002: Mark as prototype only after instantiating the function (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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.cc ('k') | test/mjsunit/dictionary-properties.js » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 4433 matching lines...) Expand 10 before | Expand all | Expand 10 after
4444 } else { 4444 } else {
4445 set_bit_field2(bit_field2() & ~(1 << kIsExtensible)); 4445 set_bit_field2(bit_field2() & ~(1 << kIsExtensible));
4446 } 4446 }
4447 } 4447 }
4448 4448
4449 bool Map::is_extensible() { 4449 bool Map::is_extensible() {
4450 return ((1 << kIsExtensible) & bit_field2()) != 0; 4450 return ((1 << kIsExtensible) & bit_field2()) != 0;
4451 } 4451 }
4452 4452
4453 4453
4454 void Map::mark_prototype_map() { 4454 void Map::set_is_prototype_map(bool value) {
4455 set_bit_field2(IsPrototypeMapBits::update(bit_field2(), true)); 4455 set_bit_field2(IsPrototypeMapBits::update(bit_field2(), value));
4456 } 4456 }
4457 4457
4458 bool Map::is_prototype_map() { 4458 bool Map::is_prototype_map() {
4459 return IsPrototypeMapBits::decode(bit_field2()); 4459 return IsPrototypeMapBits::decode(bit_field2());
4460 } 4460 }
4461 4461
4462 4462
4463 void Map::set_is_shared(bool value) { 4463 void Map::set_is_shared(bool value) {
4464 set_bit_field3(IsShared::update(bit_field3(), value)); 4464 set_bit_field3(IsShared::update(bit_field3(), value));
4465 } 4465 }
(...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after
5933 5933
5934 ACCESSORS(JSFunction, prototype_or_initial_map, Object, 5934 ACCESSORS(JSFunction, prototype_or_initial_map, Object,
5935 kPrototypeOrInitialMapOffset) 5935 kPrototypeOrInitialMapOffset)
5936 5936
5937 5937
5938 Map* JSFunction::initial_map() { 5938 Map* JSFunction::initial_map() {
5939 return Map::cast(prototype_or_initial_map()); 5939 return Map::cast(prototype_or_initial_map());
5940 } 5940 }
5941 5941
5942 5942
5943 void JSFunction::set_initial_map(Map* value) {
5944 set_prototype_or_initial_map(value);
5945 }
5946
5947
5948 bool JSFunction::has_initial_map() { 5943 bool JSFunction::has_initial_map() {
5949 return prototype_or_initial_map()->IsMap(); 5944 return prototype_or_initial_map()->IsMap();
5950 } 5945 }
5951 5946
5952 5947
5953 bool JSFunction::has_instance_prototype() { 5948 bool JSFunction::has_instance_prototype() {
5954 return has_initial_map() || !prototype_or_initial_map()->IsTheHole(); 5949 return has_initial_map() || !prototype_or_initial_map()->IsTheHole();
5955 } 5950 }
5956 5951
5957 5952
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after
7291 #undef READ_SHORT_FIELD 7286 #undef READ_SHORT_FIELD
7292 #undef WRITE_SHORT_FIELD 7287 #undef WRITE_SHORT_FIELD
7293 #undef READ_BYTE_FIELD 7288 #undef READ_BYTE_FIELD
7294 #undef WRITE_BYTE_FIELD 7289 #undef WRITE_BYTE_FIELD
7295 #undef NOBARRIER_READ_BYTE_FIELD 7290 #undef NOBARRIER_READ_BYTE_FIELD
7296 #undef NOBARRIER_WRITE_BYTE_FIELD 7291 #undef NOBARRIER_WRITE_BYTE_FIELD
7297 7292
7298 } } // namespace v8::internal 7293 } } // namespace v8::internal
7299 7294
7300 #endif // V8_OBJECTS_INL_H_ 7295 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/dictionary-properties.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698