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

Side by Side Diff: src/factory.cc

Issue 2882973002: [coverage] Block coverage with support for IfStatements (Closed)
Patch Set: Address comments Created 3 years, 6 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/factory.h ('k') | src/flag-definitions.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/factory.h" 5 #include "src/factory.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/allocation-site-scopes.h" 8 #include "src/allocation-site-scopes.h"
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 2590 matching lines...) Expand 10 before | Expand all | Expand 10 after
2601 debug_info->set_debugger_hints(shared->debugger_hints()); 2601 debug_info->set_debugger_hints(shared->debugger_hints());
2602 debug_info->set_debug_bytecode_array(heap->undefined_value()); 2602 debug_info->set_debug_bytecode_array(heap->undefined_value());
2603 debug_info->set_break_points(heap->empty_fixed_array()); 2603 debug_info->set_break_points(heap->empty_fixed_array());
2604 2604
2605 // Link debug info to function. 2605 // Link debug info to function.
2606 shared->set_debug_info(*debug_info); 2606 shared->set_debug_info(*debug_info);
2607 2607
2608 return debug_info; 2608 return debug_info;
2609 } 2609 }
2610 2610
2611 Handle<CoverageInfo> Factory::NewCoverageInfo(
2612 const ZoneVector<SourceRange>& slots) {
2613 const int slot_count = static_cast<int>(slots.size());
2614
2615 const int length = CoverageInfo::FixedArrayLengthForSlotCount(slot_count);
2616 Handle<CoverageInfo> info =
2617 Handle<CoverageInfo>::cast(NewUninitializedFixedArray(length));
2618
2619 for (int i = 0; i < slot_count; i++) {
2620 SourceRange range = slots[i];
2621 info->InitializeSlot(i, range.start, range.end);
2622 }
2623
2624 return info;
2625 }
2626
2611 Handle<BreakPointInfo> Factory::NewBreakPointInfo(int source_position) { 2627 Handle<BreakPointInfo> Factory::NewBreakPointInfo(int source_position) {
2612 Handle<BreakPointInfo> new_break_point_info = 2628 Handle<BreakPointInfo> new_break_point_info =
2613 Handle<BreakPointInfo>::cast(NewStruct(TUPLE2_TYPE)); 2629 Handle<BreakPointInfo>::cast(NewStruct(TUPLE2_TYPE));
2614 new_break_point_info->set_source_position(source_position); 2630 new_break_point_info->set_source_position(source_position);
2615 new_break_point_info->set_break_point_objects(*undefined_value()); 2631 new_break_point_info->set_break_point_objects(*undefined_value());
2616 return new_break_point_info; 2632 return new_break_point_info;
2617 } 2633 }
2618 2634
2619 Handle<StackFrameInfo> Factory::NewStackFrameInfo() { 2635 Handle<StackFrameInfo> Factory::NewStackFrameInfo() {
2620 Handle<StackFrameInfo> stack_frame_info = 2636 Handle<StackFrameInfo> stack_frame_info =
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
2944 Handle<AccessorInfo> prototype = 2960 Handle<AccessorInfo> prototype =
2945 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs); 2961 Accessors::FunctionPrototypeInfo(isolate(), rw_attribs);
2946 Descriptor d = Descriptor::AccessorConstant( 2962 Descriptor d = Descriptor::AccessorConstant(
2947 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs); 2963 Handle<Name>(Name::cast(prototype->name())), prototype, rw_attribs);
2948 map->AppendDescriptor(&d); 2964 map->AppendDescriptor(&d);
2949 } 2965 }
2950 } 2966 }
2951 2967
2952 } // namespace internal 2968 } // namespace internal
2953 } // namespace v8 2969 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698