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

Side by Side Diff: src/heap/heap.cc

Issue 2636903002: Assert that context creation doesn't throw (Closed)
Patch Set: updates Created 3 years, 11 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
« no previous file with comments | « src/heap/heap.h ('k') | src/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/context-slot-cache.h" 9 #include "src/ast/context-slot-cache.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 2506 matching lines...) Expand 10 before | Expand all | Expand 10 after
2517 if (incremental_marking()->black_allocation()) { 2517 if (incremental_marking()->black_allocation()) {
2518 array->set_next_link(encountered_transition_arrays(), 2518 array->set_next_link(encountered_transition_arrays(),
2519 UPDATE_WEAK_WRITE_BARRIER); 2519 UPDATE_WEAK_WRITE_BARRIER);
2520 set_encountered_transition_arrays(array); 2520 set_encountered_transition_arrays(array);
2521 } else { 2521 } else {
2522 array->set_next_link(undefined_value(), SKIP_WRITE_BARRIER); 2522 array->set_next_link(undefined_value(), SKIP_WRITE_BARRIER);
2523 } 2523 }
2524 return array; 2524 return array;
2525 } 2525 }
2526 2526
2527 2527 bool Heap::CreateApiObjects() {
2528 void Heap::CreateApiObjects() {
2529 HandleScope scope(isolate()); 2528 HandleScope scope(isolate());
2530 set_message_listeners(*TemplateList::New(isolate(), 2)); 2529 set_message_listeners(*TemplateList::New(isolate(), 2));
2530 HeapObject* obj = nullptr;
2531 {
2532 AllocationResult allocation = AllocateStruct(INTERCEPTOR_INFO_TYPE);
2533 if (!allocation.To(&obj)) return false;
2534 }
2535 InterceptorInfo* info = InterceptorInfo::cast(obj);
2536 info->set_flags(0);
2537 set_noop_interceptor_info(info);
2538 return true;
2531 } 2539 }
2532 2540
2533 2541
2534 void Heap::CreateJSEntryStub() { 2542 void Heap::CreateJSEntryStub() {
2535 JSEntryStub stub(isolate(), StackFrame::ENTRY); 2543 JSEntryStub stub(isolate(), StackFrame::ENTRY);
2536 set_js_entry_code(*stub.GetCode()); 2544 set_js_entry_code(*stub.GetCode());
2537 } 2545 }
2538 2546
2539 2547
2540 void Heap::CreateJSConstructEntryStub() { 2548 void Heap::CreateJSConstructEntryStub() {
(...skipping 3028 matching lines...) Expand 10 before | Expand all | Expand 10 after
5569 *this, ScavengeJob::kBytesAllocatedBeforeNextIdleTask); 5577 *this, ScavengeJob::kBytesAllocatedBeforeNextIdleTask);
5570 new_space()->AddAllocationObserver(idle_scavenge_observer_); 5578 new_space()->AddAllocationObserver(idle_scavenge_observer_);
5571 5579
5572 return true; 5580 return true;
5573 } 5581 }
5574 5582
5575 5583
5576 bool Heap::CreateHeapObjects() { 5584 bool Heap::CreateHeapObjects() {
5577 // Create initial maps. 5585 // Create initial maps.
5578 if (!CreateInitialMaps()) return false; 5586 if (!CreateInitialMaps()) return false;
5579 CreateApiObjects(); 5587 if (!CreateApiObjects()) return false;
5580 5588
5581 // Create initial objects 5589 // Create initial objects
5582 CreateInitialObjects(); 5590 CreateInitialObjects();
5583 CHECK_EQ(0u, gc_count_); 5591 CHECK_EQ(0u, gc_count_);
5584 5592
5585 set_native_contexts_list(undefined_value()); 5593 set_native_contexts_list(undefined_value());
5586 set_allocation_sites_list(undefined_value()); 5594 set_allocation_sites_list(undefined_value());
5587 5595
5588 return true; 5596 return true;
5589 } 5597 }
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
6562 } 6570 }
6563 6571
6564 6572
6565 // static 6573 // static
6566 int Heap::GetStaticVisitorIdForMap(Map* map) { 6574 int Heap::GetStaticVisitorIdForMap(Map* map) {
6567 return StaticVisitorBase::GetVisitorId(map); 6575 return StaticVisitorBase::GetVisitorId(map);
6568 } 6576 }
6569 6577
6570 } // namespace internal 6578 } // namespace internal
6571 } // namespace v8 6579 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698