Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/v8.h" | 5 #include "src/v8.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/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 391 36, | 391 36, |
| 392 "LDoubleConstant::min_int"); | 392 "LDoubleConstant::min_int"); |
| 393 Add(ExternalReference::address_of_one_half().address(), | 393 Add(ExternalReference::address_of_one_half().address(), |
| 394 UNCLASSIFIED, | 394 UNCLASSIFIED, |
| 395 37, | 395 37, |
| 396 "LDoubleConstant::one_half"); | 396 "LDoubleConstant::one_half"); |
| 397 Add(ExternalReference::isolate_address(isolate).address(), | 397 Add(ExternalReference::isolate_address(isolate).address(), |
| 398 UNCLASSIFIED, | 398 UNCLASSIFIED, |
| 399 38, | 399 38, |
| 400 "isolate"); | 400 "isolate"); |
| 401 Add(ExternalReference::address_of_minus_zero().address(), | |
| 402 UNCLASSIFIED, | |
| 403 39, | |
| 404 "LDoubleConstant::minus_zero"); | |
| 405 Add(ExternalReference::address_of_negative_infinity().address(), | 401 Add(ExternalReference::address_of_negative_infinity().address(), |
| 406 UNCLASSIFIED, | 402 UNCLASSIFIED, |
| 407 40, | 403 40, |
| 408 "LDoubleConstant::negative_infinity"); | 404 "LDoubleConstant::negative_infinity"); |
| 409 Add(ExternalReference::power_double_double_function(isolate).address(), | 405 Add(ExternalReference::power_double_double_function(isolate).address(), |
| 410 UNCLASSIFIED, | 406 UNCLASSIFIED, |
| 411 41, | 407 41, |
| 412 "power_double_double_function"); | 408 "power_double_double_function"); |
| 413 Add(ExternalReference::power_double_int_function(isolate).address(), | 409 Add(ExternalReference::power_double_int_function(isolate).address(), |
| 414 UNCLASSIFIED, | 410 UNCLASSIFIED, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 520 UNCLASSIFIED, | 516 UNCLASSIFIED, |
| 521 66, | 517 66, |
| 522 "Debug::after_break_target_address()"); | 518 "Debug::after_break_target_address()"); |
| 523 | 519 |
| 524 Add(ExternalReference::debug_restarter_frame_function_pointer_address( | 520 Add(ExternalReference::debug_restarter_frame_function_pointer_address( |
| 525 isolate).address(), | 521 isolate).address(), |
| 526 UNCLASSIFIED, | 522 UNCLASSIFIED, |
| 527 67, | 523 67, |
| 528 "Debug::restarter_frame_function_pointer_address()"); | 524 "Debug::restarter_frame_function_pointer_address()"); |
| 529 | 525 |
| 526 Add(ExternalReference::flush_icache_function(isolate).address(), UNCLASSIFIED, | |
| 527 68, "CpuFeatures::FlushICache"); | |
| 528 | |
| 529 Add(ExternalReference::log_enter_external_function(isolate).address(), | |
| 530 UNCLASSIFIED, 69, "Logger::EnterExternal"); | |
| 531 | |
| 532 Add(ExternalReference::log_leave_external_function(isolate).address(), | |
| 533 UNCLASSIFIED, 70, "Logger::LeaveExternal"); | |
| 534 | |
| 535 Add(ExternalReference::address_of_minus_one_half().address(), UNCLASSIFIED, | |
| 536 71, "double_constants.minus_one_half"); | |
| 537 | |
| 538 Add(ExternalReference::stress_deopt_count(isolate).address(), UNCLASSIFIED, | |
| 539 72, "Isolate::stress_deopt_count_address()"); | |
| 540 | |
| 541 Add(ExternalReference::debug_is_active_address(isolate).address(), | |
| 542 UNCLASSIFIED, 73, "Debug::is_active_address()"); | |
| 543 | |
| 544 Add(ExternalReference::incremental_marking_record_write_function(isolate) | |
| 545 .address(), | |
| 546 UNCLASSIFIED, 74, "IncrementalMarking::RecordWriteFromCode"); | |
| 547 | |
| 548 Add(ExternalReference::math_log_double_function(isolate).address(), | |
| 549 UNCLASSIFIED, 75, "std::log"); | |
| 550 | |
| 530 // Add a small set of deopt entry addresses to encoder without generating the | 551 // Add a small set of deopt entry addresses to encoder without generating the |
| 531 // deopt table code, which isn't possible at deserialization time. | 552 // deopt table code, which isn't possible at deserialization time. |
| 532 HandleScope scope(isolate); | 553 HandleScope scope(isolate); |
| 533 for (int entry = 0; entry < kDeoptTableSerializeEntryCount; ++entry) { | 554 for (int entry = 0; entry < kDeoptTableSerializeEntryCount; ++entry) { |
| 534 Address address = Deoptimizer::GetDeoptimizationEntry( | 555 Address address = Deoptimizer::GetDeoptimizationEntry( |
| 535 isolate, | 556 isolate, |
| 536 entry, | 557 entry, |
| 537 Deoptimizer::LAZY, | 558 Deoptimizer::LAZY, |
| 538 Deoptimizer::CALCULATE_ENTRY_ADDRESS); | 559 Deoptimizer::CALCULATE_ENTRY_ADDRESS); |
| 539 Add(address, LAZY_DEOPTIMIZATION, entry, "lazy_deopt"); | 560 Add(address, LAZY_DEOPTIMIZATION, entry, "lazy_deopt"); |
| 540 } | 561 } |
| 562 | |
| 563 #ifdef DEBUG | |
| 564 // Make sure that we do not have duplicate codes. | |
| 565 refs_.Sort(&Compare); | |
| 566 for (int i = 0; i < refs_.length() - 1; i++) CHECK(code(i) != code(i + 1)); | |
|
Jakob Kummerow
2014/08/05 13:12:07
With a little reordering of the TypeCode enum, you
| |
| 567 #endif // DEBUG | |
| 541 } | 568 } |
| 542 | 569 |
| 543 | 570 |
| 544 ExternalReferenceEncoder::ExternalReferenceEncoder(Isolate* isolate) | 571 ExternalReferenceEncoder::ExternalReferenceEncoder(Isolate* isolate) |
| 545 : encodings_(HashMap::PointersMatch), | 572 : encodings_(HashMap::PointersMatch), |
| 546 isolate_(isolate) { | 573 isolate_(isolate) { |
| 547 ExternalReferenceTable* external_references = | 574 ExternalReferenceTable* external_references = |
| 548 ExternalReferenceTable::instance(isolate_); | 575 ExternalReferenceTable::instance(isolate_); |
| 549 for (int i = 0; i < external_references->size(); ++i) { | 576 for (int i = 0; i < external_references->size(); ++i) { |
| 550 Put(external_references->address(i), i); | 577 Put(external_references->address(i), i); |
| (...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2070 | 2097 |
| 2071 int SerializedCodeData::CheckSum(String* string) { | 2098 int SerializedCodeData::CheckSum(String* string) { |
| 2072 int checksum = Version::Hash(); | 2099 int checksum = Version::Hash(); |
| 2073 #ifdef DEBUG | 2100 #ifdef DEBUG |
| 2074 uint32_t seed = static_cast<uint32_t>(checksum); | 2101 uint32_t seed = static_cast<uint32_t>(checksum); |
| 2075 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); | 2102 checksum = static_cast<int>(IteratingStringHasher::Hash(string, seed)); |
| 2076 #endif // DEBUG | 2103 #endif // DEBUG |
| 2077 return checksum; | 2104 return checksum; |
| 2078 } | 2105 } |
| 2079 } } // namespace v8::internal | 2106 } } // namespace v8::internal |
| OLD | NEW |