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

Side by Side Diff: src/heap.cc

Issue 177683002: Mode clean-up pt 1: rename classic/non-strict mode to sloppy mode (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 2849 matching lines...) Expand 10 before | Expand all | Expand 10 after
2860 TYPED_ARRAYS(ALLOCATE_EXTERNAL_ARRAY_MAP) 2860 TYPED_ARRAYS(ALLOCATE_EXTERNAL_ARRAY_MAP)
2861 #undef ALLOCATE_EXTERNAL_ARRAY_MAP 2861 #undef ALLOCATE_EXTERNAL_ARRAY_MAP
2862 2862
2863 #define ALLOCATE_FIXED_TYPED_ARRAY_MAP(Type, type, TYPE, ctype, size) \ 2863 #define ALLOCATE_FIXED_TYPED_ARRAY_MAP(Type, type, TYPE, ctype, size) \
2864 ALLOCATE_VARSIZE_MAP(FIXED_##TYPE##_ARRAY_TYPE, \ 2864 ALLOCATE_VARSIZE_MAP(FIXED_##TYPE##_ARRAY_TYPE, \
2865 fixed_##type##_array) 2865 fixed_##type##_array)
2866 2866
2867 TYPED_ARRAYS(ALLOCATE_FIXED_TYPED_ARRAY_MAP) 2867 TYPED_ARRAYS(ALLOCATE_FIXED_TYPED_ARRAY_MAP)
2868 #undef ALLOCATE_FIXED_TYPED_ARRAY_MAP 2868 #undef ALLOCATE_FIXED_TYPED_ARRAY_MAP
2869 2869
2870 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, non_strict_arguments_elements) 2870 ALLOCATE_VARSIZE_MAP(FIXED_ARRAY_TYPE, sloppy_arguments_elements)
2871 2871
2872 ALLOCATE_VARSIZE_MAP(CODE_TYPE, code) 2872 ALLOCATE_VARSIZE_MAP(CODE_TYPE, code)
2873 2873
2874 ALLOCATE_MAP(CELL_TYPE, Cell::kSize, cell) 2874 ALLOCATE_MAP(CELL_TYPE, Cell::kSize, cell)
2875 ALLOCATE_MAP(PROPERTY_CELL_TYPE, PropertyCell::kSize, global_property_cell) 2875 ALLOCATE_MAP(PROPERTY_CELL_TYPE, PropertyCell::kSize, global_property_cell)
2876 ALLOCATE_MAP(FILLER_TYPE, kPointerSize, one_pointer_filler) 2876 ALLOCATE_MAP(FILLER_TYPE, kPointerSize, one_pointer_filler)
2877 ALLOCATE_MAP(FILLER_TYPE, 2 * kPointerSize, two_pointer_filler) 2877 ALLOCATE_MAP(FILLER_TYPE, 2 * kPointerSize, two_pointer_filler)
2878 2878
2879 2879
2880 for (unsigned i = 0; i < ARRAY_SIZE(struct_table); i++) { 2880 for (unsigned i = 0; i < ARRAY_SIZE(struct_table); i++) {
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after
4255 } 4255 }
4256 4256
4257 4257
4258 MaybeObject* Heap::AllocateArgumentsObject(Object* callee, int length) { 4258 MaybeObject* Heap::AllocateArgumentsObject(Object* callee, int length) {
4259 // To get fast allocation and map sharing for arguments objects we 4259 // To get fast allocation and map sharing for arguments objects we
4260 // allocate them based on an arguments boilerplate. 4260 // allocate them based on an arguments boilerplate.
4261 4261
4262 JSObject* boilerplate; 4262 JSObject* boilerplate;
4263 int arguments_object_size; 4263 int arguments_object_size;
4264 bool strict_mode_callee = callee->IsJSFunction() && 4264 bool strict_mode_callee = callee->IsJSFunction() &&
4265 !JSFunction::cast(callee)->shared()->is_classic_mode(); 4265 !JSFunction::cast(callee)->shared()->is_sloppy_mode();
4266 if (strict_mode_callee) { 4266 if (strict_mode_callee) {
4267 boilerplate = 4267 boilerplate =
4268 isolate()->context()->native_context()-> 4268 isolate()->context()->native_context()->
4269 strict_mode_arguments_boilerplate(); 4269 strict_mode_arguments_boilerplate();
4270 arguments_object_size = kArgumentsObjectSizeStrict; 4270 arguments_object_size = kArgumentsObjectSizeStrict;
4271 } else { 4271 } else {
4272 boilerplate = 4272 boilerplate =
4273 isolate()->context()->native_context()->arguments_boilerplate(); 4273 isolate()->context()->native_context()->arguments_boilerplate();
4274 arguments_object_size = kArgumentsObjectSize; 4274 arguments_object_size = kArgumentsObjectSize;
4275 } 4275 }
(...skipping 14 matching lines...) Expand all
4290 // fields that point to new space so it's safe to skip the write 4290 // fields that point to new space so it's safe to skip the write
4291 // barrier here. 4291 // barrier here.
4292 CopyBlock(HeapObject::cast(result)->address(), 4292 CopyBlock(HeapObject::cast(result)->address(),
4293 boilerplate->address(), 4293 boilerplate->address(),
4294 JSObject::kHeaderSize); 4294 JSObject::kHeaderSize);
4295 4295
4296 // Set the length property. 4296 // Set the length property.
4297 JSObject::cast(result)->InObjectPropertyAtPut(kArgumentsLengthIndex, 4297 JSObject::cast(result)->InObjectPropertyAtPut(kArgumentsLengthIndex,
4298 Smi::FromInt(length), 4298 Smi::FromInt(length),
4299 SKIP_WRITE_BARRIER); 4299 SKIP_WRITE_BARRIER);
4300 // Set the callee property for non-strict mode arguments object only. 4300 // Set the callee property for sloppy mode arguments object only.
4301 if (!strict_mode_callee) { 4301 if (!strict_mode_callee) {
4302 JSObject::cast(result)->InObjectPropertyAtPut(kArgumentsCalleeIndex, 4302 JSObject::cast(result)->InObjectPropertyAtPut(kArgumentsCalleeIndex,
4303 callee); 4303 callee);
4304 } 4304 }
4305 4305
4306 // Check the state of the object 4306 // Check the state of the object
4307 ASSERT(JSObject::cast(result)->HasFastProperties()); 4307 ASSERT(JSObject::cast(result)->HasFastProperties());
4308 ASSERT(JSObject::cast(result)->HasFastObjectElements()); 4308 ASSERT(JSObject::cast(result)->HasFastObjectElements());
4309 4309
4310 return result; 4310 return result;
(...skipping 3432 matching lines...) Expand 10 before | Expand all | Expand 10 after
7743 static_cast<int>(object_sizes_last_time_[index])); 7743 static_cast<int>(object_sizes_last_time_[index]));
7744 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 7744 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
7745 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7745 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7746 7746
7747 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7747 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7748 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7748 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7749 ClearObjectStats(); 7749 ClearObjectStats();
7750 } 7750 }
7751 7751
7752 } } // namespace v8::internal 7752 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698