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

Side by Side Diff: src/objects.cc

Issue 2766573003: [debug] introduce precise binary code coverage. (Closed)
Patch Set: fix test Created 3 years, 9 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/objects.h ('k') | src/objects-inl.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <memory> 9 #include <memory>
10 #include <sstream> 10 #include <sstream>
(...skipping 13440 matching lines...) Expand 10 before | Expand all | Expand 10 after
13451 Handle<String> script_source(String::cast(Script::cast(script())->source())); 13451 Handle<String> script_source(String::cast(Script::cast(script())->source()));
13452 int start_pos = function_token_position(); 13452 int start_pos = function_token_position();
13453 if (start_pos == kNoSourcePosition) start_pos = start_position(); 13453 if (start_pos == kNoSourcePosition) start_pos = start_position();
13454 return isolate->factory()->NewSubString(script_source, start_pos, 13454 return isolate->factory()->NewSubString(script_source, start_pos,
13455 end_position()); 13455 end_position());
13456 } 13456 }
13457 13457
13458 bool SharedFunctionInfo::IsInlineable() { 13458 bool SharedFunctionInfo::IsInlineable() {
13459 // Check that the function has a script associated with it. 13459 // Check that the function has a script associated with it.
13460 if (!script()->IsScript()) return false; 13460 if (!script()->IsScript()) return false;
13461 if (GetIsolate()->is_precise_binary_code_coverage() &&
13462 !has_reported_binary_coverage()) {
13463 // We may miss invocations if this function is inlined.
13464 return false;
13465 }
13461 return !optimization_disabled(); 13466 return !optimization_disabled();
13462 } 13467 }
13463 13468
13464
13465 int SharedFunctionInfo::SourceSize() { 13469 int SharedFunctionInfo::SourceSize() {
13466 return end_position() - start_position(); 13470 return end_position() - start_position();
13467 } 13471 }
13468 13472
13469 void JSFunction::CalculateInstanceSizeHelper(InstanceType instance_type, 13473 void JSFunction::CalculateInstanceSizeHelper(InstanceType instance_type,
13470 int requested_embedder_fields, 13474 int requested_embedder_fields,
13471 int requested_in_object_properties, 13475 int requested_in_object_properties,
13472 int* instance_size, 13476 int* instance_size,
13473 int* in_object_properties) { 13477 int* in_object_properties) {
13474 int header_size = JSObject::GetHeaderSize(instance_type); 13478 int header_size = JSObject::GetHeaderSize(instance_type);
(...skipping 6821 matching lines...) Expand 10 before | Expand all | Expand 10 after
20296 // depend on this. 20300 // depend on this.
20297 return DICTIONARY_ELEMENTS; 20301 return DICTIONARY_ELEMENTS;
20298 } 20302 }
20299 DCHECK_LE(kind, LAST_ELEMENTS_KIND); 20303 DCHECK_LE(kind, LAST_ELEMENTS_KIND);
20300 return kind; 20304 return kind;
20301 } 20305 }
20302 } 20306 }
20303 20307
20304 } // namespace internal 20308 } // namespace internal
20305 } // namespace v8 20309 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698