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 2514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2525 Factory* factory = isolate()->factory(); | 2525 Factory* factory = isolate()->factory(); |
2526 Handle<Map> new_neander_map = | 2526 Handle<Map> new_neander_map = |
2527 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); | 2527 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
2528 | 2528 |
2529 // Don't use Smi-only elements optimizations for objects with the neander | 2529 // Don't use Smi-only elements optimizations for objects with the neander |
2530 // map. There are too many cases where element values are set directly with a | 2530 // map. There are too many cases where element values are set directly with a |
2531 // bottleneck to trap the Smi-only -> fast elements transition, and there | 2531 // bottleneck to trap the Smi-only -> fast elements transition, and there |
2532 // appears to be no benefit for optimize this case. | 2532 // appears to be no benefit for optimize this case. |
2533 new_neander_map->set_elements_kind(TERMINAL_FAST_ELEMENTS_KIND); | 2533 new_neander_map->set_elements_kind(TERMINAL_FAST_ELEMENTS_KIND); |
2534 set_neander_map(*new_neander_map); | 2534 set_neander_map(*new_neander_map); |
2535 | 2535 set_message_listeners(*TemplateList::New(isolate(), 2)); |
2536 Handle<JSObject> listeners = factory->NewNeanderObject(); | |
2537 Handle<FixedArray> elements = factory->NewFixedArray(2); | |
2538 elements->set(0, Smi::FromInt(0)); | |
2539 listeners->set_elements(*elements); | |
2540 set_message_listeners(*listeners); | |
2541 } | 2536 } |
2542 | 2537 |
2543 | 2538 |
2544 void Heap::CreateJSEntryStub() { | 2539 void Heap::CreateJSEntryStub() { |
2545 JSEntryStub stub(isolate(), StackFrame::ENTRY); | 2540 JSEntryStub stub(isolate(), StackFrame::ENTRY); |
2546 set_js_entry_code(*stub.GetCode()); | 2541 set_js_entry_code(*stub.GetCode()); |
2547 } | 2542 } |
2548 | 2543 |
2549 | 2544 |
2550 void Heap::CreateJSConstructEntryStub() { | 2545 void Heap::CreateJSConstructEntryStub() { |
(...skipping 3884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6435 } | 6430 } |
6436 | 6431 |
6437 | 6432 |
6438 // static | 6433 // static |
6439 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6434 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6440 return StaticVisitorBase::GetVisitorId(map); | 6435 return StaticVisitorBase::GetVisitorId(map); |
6441 } | 6436 } |
6442 | 6437 |
6443 } // namespace internal | 6438 } // namespace internal |
6444 } // namespace v8 | 6439 } // namespace v8 |
OLD | NEW |