| OLD | NEW |
| 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 2375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2386 { MaybeObject* maybe_result = Allocate(foreign_map(), space); | 2386 { MaybeObject* maybe_result = Allocate(foreign_map(), space); |
| 2387 if (!maybe_result->ToObject(&result)) return maybe_result; | 2387 if (!maybe_result->ToObject(&result)) return maybe_result; |
| 2388 } | 2388 } |
| 2389 | 2389 |
| 2390 Foreign::cast(result)->set_address(address); | 2390 Foreign::cast(result)->set_address(address); |
| 2391 return result; | 2391 return result; |
| 2392 } | 2392 } |
| 2393 | 2393 |
| 2394 | 2394 |
| 2395 MaybeObject* Heap::AllocateSharedFunctionInfo(Object* name) { | 2395 MaybeObject* Heap::AllocateSharedFunctionInfo(Object* name) { |
| 2396 Object* result; | 2396 SharedFunctionInfo* share; |
| 2397 { MaybeObject* maybe_result = | 2397 MaybeObject* maybe = Allocate(shared_function_info_map(), OLD_POINTER_SPACE); |
| 2398 Allocate(shared_function_info_map(), OLD_POINTER_SPACE); | 2398 if (!maybe->To<SharedFunctionInfo>(&share)) return maybe; |
| 2399 if (!maybe_result->ToObject(&result)) return maybe_result; | |
| 2400 } | |
| 2401 | 2399 |
| 2402 SharedFunctionInfo* share = SharedFunctionInfo::cast(result); | 2400 // Set pointer fields. |
| 2403 share->set_name(name); | 2401 share->set_name(name); |
| 2404 Code* illegal = isolate_->builtins()->builtin(Builtins::kIllegal); | 2402 Code* illegal = isolate_->builtins()->builtin(Builtins::kIllegal); |
| 2405 share->set_code(illegal); | 2403 share->set_code(illegal); |
| 2406 share->set_scope_info(SerializedScopeInfo::Empty()); | 2404 share->set_scope_info(SerializedScopeInfo::Empty()); |
| 2407 Code* construct_stub = isolate_->builtins()->builtin( | 2405 Code* construct_stub = |
| 2408 Builtins::kJSConstructStubGeneric); | 2406 isolate_->builtins()->builtin(Builtins::kJSConstructStubGeneric); |
| 2409 share->set_construct_stub(construct_stub); | 2407 share->set_construct_stub(construct_stub); |
| 2410 share->set_expected_nof_properties(0); | |
| 2411 share->set_length(0); | |
| 2412 share->set_formal_parameter_count(0); | |
| 2413 share->set_instance_class_name(Object_symbol()); | 2408 share->set_instance_class_name(Object_symbol()); |
| 2414 share->set_function_data(undefined_value()); | 2409 share->set_function_data(undefined_value()); |
| 2415 share->set_script(undefined_value()); | 2410 share->set_script(undefined_value()); |
| 2416 share->set_start_position_and_type(0); | |
| 2417 share->set_debug_info(undefined_value()); | 2411 share->set_debug_info(undefined_value()); |
| 2418 share->set_inferred_name(empty_string()); | 2412 share->set_inferred_name(empty_string()); |
| 2419 share->set_compiler_hints(0); | 2413 share->set_initial_map(undefined_value()); |
| 2414 share->set_this_property_assignments(undefined_value()); |
| 2420 share->set_deopt_counter(Smi::FromInt(FLAG_deopt_every_n_times)); | 2415 share->set_deopt_counter(Smi::FromInt(FLAG_deopt_every_n_times)); |
| 2421 share->set_initial_map(undefined_value()); | 2416 |
| 2422 share->set_this_property_assignments_count(0); | 2417 // Set integer fields (smi or int, depending on the architecture). |
| 2423 share->set_this_property_assignments(undefined_value()); | 2418 share->set_length(0); |
| 2424 share->set_opt_count(0); | 2419 share->set_formal_parameter_count(0); |
| 2420 share->set_expected_nof_properties(0); |
| 2425 share->set_num_literals(0); | 2421 share->set_num_literals(0); |
| 2422 share->set_start_position_and_type(0); |
| 2426 share->set_end_position(0); | 2423 share->set_end_position(0); |
| 2427 share->set_function_token_position(0); | 2424 share->set_function_token_position(0); |
| 2428 share->set_native(false); | 2425 // All compiler hints default to false or 0. |
| 2429 return result; | 2426 share->set_compiler_hints(0); |
| 2427 share->set_this_property_assignments_count(0); |
| 2428 share->set_opt_count(0); |
| 2429 |
| 2430 return share; |
| 2430 } | 2431 } |
| 2431 | 2432 |
| 2432 | 2433 |
| 2433 MaybeObject* Heap::AllocateJSMessageObject(String* type, | 2434 MaybeObject* Heap::AllocateJSMessageObject(String* type, |
| 2434 JSArray* arguments, | 2435 JSArray* arguments, |
| 2435 int start_position, | 2436 int start_position, |
| 2436 int end_position, | 2437 int end_position, |
| 2437 Object* script, | 2438 Object* script, |
| 2438 Object* stack_trace, | 2439 Object* stack_trace, |
| 2439 Object* stack_frames) { | 2440 Object* stack_frames) { |
| (...skipping 3584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6024 } | 6025 } |
| 6025 | 6026 |
| 6026 | 6027 |
| 6027 void ExternalStringTable::TearDown() { | 6028 void ExternalStringTable::TearDown() { |
| 6028 new_space_strings_.Free(); | 6029 new_space_strings_.Free(); |
| 6029 old_space_strings_.Free(); | 6030 old_space_strings_.Free(); |
| 6030 } | 6031 } |
| 6031 | 6032 |
| 6032 | 6033 |
| 6033 } } // namespace v8::internal | 6034 } } // namespace v8::internal |
| OLD | NEW |