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

Side by Side Diff: src/heap.cc

Issue 93066: Built-in JSON support (Closed)
Patch Set: Created 11 years, 8 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
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 map->set_map(meta_map()); 932 map->set_map(meta_map());
933 map->set_instance_type(instance_type); 933 map->set_instance_type(instance_type);
934 map->set_prototype(null_value()); 934 map->set_prototype(null_value());
935 map->set_constructor(null_value()); 935 map->set_constructor(null_value());
936 map->set_instance_size(instance_size); 936 map->set_instance_size(instance_size);
937 map->set_inobject_properties(0); 937 map->set_inobject_properties(0);
938 map->set_instance_descriptors(empty_descriptor_array()); 938 map->set_instance_descriptors(empty_descriptor_array());
939 map->set_code_cache(empty_fixed_array()); 939 map->set_code_cache(empty_fixed_array());
940 map->set_unused_property_fields(0); 940 map->set_unused_property_fields(0);
941 map->set_bit_field(0); 941 map->set_bit_field(0);
942 map->set_bit_field2(0);
942 return map; 943 return map;
943 } 944 }
944 945
945 946
946 bool Heap::CreateInitialMaps() { 947 bool Heap::CreateInitialMaps() {
947 Object* obj = AllocatePartialMap(MAP_TYPE, Map::kSize); 948 Object* obj = AllocatePartialMap(MAP_TYPE, Map::kSize);
948 if (obj->IsFailure()) return false; 949 if (obj->IsFailure()) return false;
949 950
950 // Map::cast cannot be used due to uninitialized map field. 951 // Map::cast cannot be used due to uninitialized map field.
951 meta_map_ = reinterpret_cast<Map*>(obj); 952 meta_map_ = reinterpret_cast<Map*>(obj);
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 1403
1403 SharedFunctionInfo* share = SharedFunctionInfo::cast(result); 1404 SharedFunctionInfo* share = SharedFunctionInfo::cast(result);
1404 share->set_name(name); 1405 share->set_name(name);
1405 Code* illegal = Builtins::builtin(Builtins::Illegal); 1406 Code* illegal = Builtins::builtin(Builtins::Illegal);
1406 share->set_code(illegal); 1407 share->set_code(illegal);
1407 share->set_expected_nof_properties(0); 1408 share->set_expected_nof_properties(0);
1408 share->set_length(0); 1409 share->set_length(0);
1409 share->set_formal_parameter_count(0); 1410 share->set_formal_parameter_count(0);
1410 share->set_instance_class_name(Object_symbol()); 1411 share->set_instance_class_name(Object_symbol());
1411 share->set_function_data(undefined_value()); 1412 share->set_function_data(undefined_value());
1412 share->set_lazy_load_data(undefined_value());
1413 share->set_script(undefined_value()); 1413 share->set_script(undefined_value());
1414 share->set_start_position_and_type(0); 1414 share->set_start_position_and_type(0);
1415 share->set_debug_info(undefined_value()); 1415 share->set_debug_info(undefined_value());
1416 share->set_inferred_name(empty_string()); 1416 share->set_inferred_name(empty_string());
1417 return result; 1417 return result;
1418 } 1418 }
1419 1419
1420 1420
1421 Object* Heap::AllocateConsString(String* first, 1421 Object* Heap::AllocateConsString(String* first,
1422 String* second) { 1422 String* second) {
(...skipping 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after
3387 #ifdef DEBUG 3387 #ifdef DEBUG
3388 bool Heap::GarbageCollectionGreedyCheck() { 3388 bool Heap::GarbageCollectionGreedyCheck() {
3389 ASSERT(FLAG_gc_greedy); 3389 ASSERT(FLAG_gc_greedy);
3390 if (Bootstrapper::IsActive()) return true; 3390 if (Bootstrapper::IsActive()) return true;
3391 if (disallow_allocation_failure()) return true; 3391 if (disallow_allocation_failure()) return true;
3392 return CollectGarbage(0, NEW_SPACE); 3392 return CollectGarbage(0, NEW_SPACE);
3393 } 3393 }
3394 #endif 3394 #endif
3395 3395
3396 } } // namespace v8::internal 3396 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698