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

Side by Side Diff: src/objects.cc

Issue 1997363002: Adds support for collecting statistics about code and its metadata. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments from Hannes. Created 4 years, 7 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 <sstream> 9 #include <sstream>
10 10
(...skipping 13475 matching lines...) Expand 10 before | Expand all | Expand 10 after
13486 switch (kind) { 13486 switch (kind) {
13487 #define CASE(name) case name: return #name; 13487 #define CASE(name) case name: return #name;
13488 CODE_KIND_LIST(CASE) 13488 CODE_KIND_LIST(CASE)
13489 #undef CASE 13489 #undef CASE
13490 case NUMBER_OF_KINDS: break; 13490 case NUMBER_OF_KINDS: break;
13491 } 13491 }
13492 UNREACHABLE(); 13492 UNREACHABLE();
13493 return NULL; 13493 return NULL;
13494 } 13494 }
13495 13495
13496 // Identify kind of code.
13497 const char* AbstractCode::Kind2String(Kind kind) {
13498 if (kind < AbstractCode::INTERPRETED_FUNCTION)
13499 return Code::Kind2String((Code::Kind)kind);
13500 if (kind == AbstractCode::INTERPRETED_FUNCTION) return "INTERPRETED_FUNCTION";
13501 UNREACHABLE();
13502 return NULL;
13503 }
13496 13504
13497 Handle<WeakCell> Code::WeakCellFor(Handle<Code> code) { 13505 Handle<WeakCell> Code::WeakCellFor(Handle<Code> code) {
13498 DCHECK(code->kind() == OPTIMIZED_FUNCTION); 13506 DCHECK(code->kind() == OPTIMIZED_FUNCTION);
13499 WeakCell* raw_cell = code->CachedWeakCell(); 13507 WeakCell* raw_cell = code->CachedWeakCell();
13500 if (raw_cell != NULL) return Handle<WeakCell>(raw_cell); 13508 if (raw_cell != NULL) return Handle<WeakCell>(raw_cell);
13501 Handle<WeakCell> cell = code->GetIsolate()->factory()->NewWeakCell(code); 13509 Handle<WeakCell> cell = code->GetIsolate()->factory()->NewWeakCell(code);
13502 DeoptimizationInputData::cast(code->deoptimization_data()) 13510 DeoptimizationInputData::cast(code->deoptimization_data())
13503 ->SetWeakCellCache(*cell); 13511 ->SetWeakCellCache(*cell);
13504 return cell; 13512 return cell;
13505 } 13513 }
(...skipping 4863 matching lines...) Expand 10 before | Expand all | Expand 10 after
18369 if (cell->value() != *new_value) { 18377 if (cell->value() != *new_value) {
18370 cell->set_value(*new_value); 18378 cell->set_value(*new_value);
18371 Isolate* isolate = cell->GetIsolate(); 18379 Isolate* isolate = cell->GetIsolate();
18372 cell->dependent_code()->DeoptimizeDependentCodeGroup( 18380 cell->dependent_code()->DeoptimizeDependentCodeGroup(
18373 isolate, DependentCode::kPropertyCellChangedGroup); 18381 isolate, DependentCode::kPropertyCellChangedGroup);
18374 } 18382 }
18375 } 18383 }
18376 18384
18377 } // namespace internal 18385 } // namespace internal
18378 } // namespace v8 18386 } // 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