OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |