| OLD | NEW |
| 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 #include "src/heap/heap.h" | 5 #include "src/heap/heap.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 2586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2597 set_minus_infinity_value( | 2597 set_minus_infinity_value( |
| 2598 *factory->NewHeapNumber(-V8_INFINITY, IMMUTABLE, TENURED)); | 2598 *factory->NewHeapNumber(-V8_INFINITY, IMMUTABLE, TENURED)); |
| 2599 | 2599 |
| 2600 // Allocate initial string table. | 2600 // Allocate initial string table. |
| 2601 set_string_table(*StringTable::New(isolate(), kInitialStringTableSize)); | 2601 set_string_table(*StringTable::New(isolate(), kInitialStringTableSize)); |
| 2602 | 2602 |
| 2603 // Allocate | 2603 // Allocate |
| 2604 | 2604 |
| 2605 // Finish initializing oddballs after creating the string table. | 2605 // Finish initializing oddballs after creating the string table. |
| 2606 Oddball::Initialize(isolate(), factory->undefined_value(), "undefined", | 2606 Oddball::Initialize(isolate(), factory->undefined_value(), "undefined", |
| 2607 factory->nan_value(), false, "undefined", | 2607 factory->nan_value(), "undefined", Oddball::kUndefined); |
| 2608 Oddball::kUndefined); | |
| 2609 | 2608 |
| 2610 // Initialize the null_value. | 2609 // Initialize the null_value. |
| 2611 Oddball::Initialize(isolate(), factory->null_value(), "null", | 2610 Oddball::Initialize(isolate(), factory->null_value(), "null", |
| 2612 handle(Smi::FromInt(0), isolate()), false, "object", | 2611 handle(Smi::FromInt(0), isolate()), "object", |
| 2613 Oddball::kNull); | 2612 Oddball::kNull); |
| 2614 | 2613 |
| 2615 // Initialize the_hole_value. | 2614 // Initialize the_hole_value. |
| 2616 Oddball::Initialize(isolate(), factory->the_hole_value(), "hole", | 2615 Oddball::Initialize(isolate(), factory->the_hole_value(), "hole", |
| 2617 handle(Smi::FromInt(-1), isolate()), false, "undefined", | 2616 handle(Smi::FromInt(-1), isolate()), "undefined", |
| 2618 Oddball::kTheHole); | 2617 Oddball::kTheHole); |
| 2619 | 2618 |
| 2620 // Initialize the true_value. | 2619 // Initialize the true_value. |
| 2621 Oddball::Initialize(isolate(), factory->true_value(), "true", | 2620 Oddball::Initialize(isolate(), factory->true_value(), "true", |
| 2622 handle(Smi::FromInt(1), isolate()), true, "boolean", | 2621 handle(Smi::FromInt(1), isolate()), "boolean", |
| 2623 Oddball::kTrue); | 2622 Oddball::kTrue); |
| 2624 | 2623 |
| 2625 // Initialize the false_value. | 2624 // Initialize the false_value. |
| 2626 Oddball::Initialize(isolate(), factory->false_value(), "false", | 2625 Oddball::Initialize(isolate(), factory->false_value(), "false", |
| 2627 handle(Smi::FromInt(0), isolate()), false, "boolean", | 2626 handle(Smi::FromInt(0), isolate()), "boolean", |
| 2628 Oddball::kFalse); | 2627 Oddball::kFalse); |
| 2629 | 2628 |
| 2630 set_uninitialized_value( | 2629 set_uninitialized_value( |
| 2631 *factory->NewOddball(factory->uninitialized_map(), "uninitialized", | 2630 *factory->NewOddball(factory->uninitialized_map(), "uninitialized", |
| 2632 handle(Smi::FromInt(-1), isolate()), false, | 2631 handle(Smi::FromInt(-1), isolate()), "undefined", |
| 2633 "undefined", Oddball::kUninitialized)); | 2632 Oddball::kUninitialized)); |
| 2634 | 2633 |
| 2635 set_arguments_marker( | 2634 set_arguments_marker( |
| 2636 *factory->NewOddball(factory->arguments_marker_map(), "arguments_marker", | 2635 *factory->NewOddball(factory->arguments_marker_map(), "arguments_marker", |
| 2637 handle(Smi::FromInt(-4), isolate()), false, | 2636 handle(Smi::FromInt(-4), isolate()), "undefined", |
| 2638 "undefined", Oddball::kArgumentsMarker)); | 2637 Oddball::kArgumentsMarker)); |
| 2639 | 2638 |
| 2640 set_no_interceptor_result_sentinel(*factory->NewOddball( | 2639 set_no_interceptor_result_sentinel(*factory->NewOddball( |
| 2641 factory->no_interceptor_result_sentinel_map(), | 2640 factory->no_interceptor_result_sentinel_map(), |
| 2642 "no_interceptor_result_sentinel", handle(Smi::FromInt(-2), isolate()), | 2641 "no_interceptor_result_sentinel", handle(Smi::FromInt(-2), isolate()), |
| 2643 false, "undefined", Oddball::kOther)); | 2642 "undefined", Oddball::kOther)); |
| 2644 | 2643 |
| 2645 set_termination_exception(*factory->NewOddball( | 2644 set_termination_exception(*factory->NewOddball( |
| 2646 factory->termination_exception_map(), "termination_exception", | 2645 factory->termination_exception_map(), "termination_exception", |
| 2647 handle(Smi::FromInt(-3), isolate()), false, "undefined", | 2646 handle(Smi::FromInt(-3), isolate()), "undefined", Oddball::kOther)); |
| 2648 Oddball::kOther)); | |
| 2649 | 2647 |
| 2650 set_exception(*factory->NewOddball(factory->exception_map(), "exception", | 2648 set_exception(*factory->NewOddball(factory->exception_map(), "exception", |
| 2651 handle(Smi::FromInt(-5), isolate()), false, | 2649 handle(Smi::FromInt(-5), isolate()), |
| 2652 "undefined", Oddball::kException)); | 2650 "undefined", Oddball::kException)); |
| 2653 | 2651 |
| 2654 set_optimized_out( | 2652 set_optimized_out(*factory->NewOddball(factory->optimized_out_map(), |
| 2655 *factory->NewOddball(factory->optimized_out_map(), "optimized_out", | 2653 "optimized_out", |
| 2656 handle(Smi::FromInt(-6), isolate()), false, | 2654 handle(Smi::FromInt(-6), isolate()), |
| 2657 "undefined", Oddball::kOptimizedOut)); | 2655 "undefined", Oddball::kOptimizedOut)); |
| 2658 | 2656 |
| 2659 set_stale_register( | 2657 set_stale_register( |
| 2660 *factory->NewOddball(factory->stale_register_map(), "stale_register", | 2658 *factory->NewOddball(factory->stale_register_map(), "stale_register", |
| 2661 handle(Smi::FromInt(-7), isolate()), false, | 2659 handle(Smi::FromInt(-7), isolate()), "undefined", |
| 2662 "undefined", Oddball::kStaleRegister)); | 2660 Oddball::kStaleRegister)); |
| 2663 | 2661 |
| 2664 for (unsigned i = 0; i < arraysize(constant_string_table); i++) { | 2662 for (unsigned i = 0; i < arraysize(constant_string_table); i++) { |
| 2665 Handle<String> str = | 2663 Handle<String> str = |
| 2666 factory->InternalizeUtf8String(constant_string_table[i].contents); | 2664 factory->InternalizeUtf8String(constant_string_table[i].contents); |
| 2667 roots_[constant_string_table[i].index] = *str; | 2665 roots_[constant_string_table[i].index] = *str; |
| 2668 } | 2666 } |
| 2669 | 2667 |
| 2670 // Create the code_stubs dictionary. The initial size is set to avoid | 2668 // Create the code_stubs dictionary. The initial size is set to avoid |
| 2671 // expanding the dictionary during bootstrapping. | 2669 // expanding the dictionary during bootstrapping. |
| 2672 set_code_stubs(*UnseededNumberDictionary::New(isolate(), 128)); | 2670 set_code_stubs(*UnseededNumberDictionary::New(isolate(), 128)); |
| (...skipping 3767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6440 } | 6438 } |
| 6441 | 6439 |
| 6442 | 6440 |
| 6443 // static | 6441 // static |
| 6444 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6442 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6445 return StaticVisitorBase::GetVisitorId(map); | 6443 return StaticVisitorBase::GetVisitorId(map); |
| 6446 } | 6444 } |
| 6447 | 6445 |
| 6448 } // namespace internal | 6446 } // namespace internal |
| 6449 } // namespace v8 | 6447 } // namespace v8 |
| OLD | NEW |