| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/contexts.h" | 5 #include "src/contexts.h" |
| 6 | 6 |
| 7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
| 9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
| 10 | 10 |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 } | 525 } |
| 526 | 526 |
| 527 | 527 |
| 528 int Context::IntrinsicIndexForName(Handle<String> string) { | 528 int Context::IntrinsicIndexForName(Handle<String> string) { |
| 529 NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(COMPARE_NAME); | 529 NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(COMPARE_NAME); |
| 530 return kNotFound; | 530 return kNotFound; |
| 531 } | 531 } |
| 532 | 532 |
| 533 #undef COMPARE_NAME | 533 #undef COMPARE_NAME |
| 534 | 534 |
| 535 #define COMPARE_NAME(index, type, name) \ |
| 536 if (strncmp(string, #name, length) == 0) return index; |
| 537 |
| 538 int Context::IntrinsicIndexForName(const unsigned char* unsigned_string, |
| 539 int length) { |
| 540 const char* string = reinterpret_cast<const char*>(unsigned_string); |
| 541 NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(COMPARE_NAME); |
| 542 return kNotFound; |
| 543 } |
| 544 |
| 545 #undef COMPARE_NAME |
| 535 | 546 |
| 536 #ifdef DEBUG | 547 #ifdef DEBUG |
| 537 | 548 |
| 538 bool Context::IsBootstrappingOrNativeContext(Isolate* isolate, Object* object) { | 549 bool Context::IsBootstrappingOrNativeContext(Isolate* isolate, Object* object) { |
| 539 // During bootstrapping we allow all objects to pass as global | 550 // During bootstrapping we allow all objects to pass as global |
| 540 // objects. This is necessary to fix circular dependencies. | 551 // objects. This is necessary to fix circular dependencies. |
| 541 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || | 552 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || |
| 542 isolate->bootstrapper()->IsActive() || object->IsNativeContext(); | 553 isolate->bootstrapper()->IsActive() || object->IsNativeContext(); |
| 543 } | 554 } |
| 544 | 555 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 562 | 573 |
| 563 int previous_value = errors_thrown()->value(); | 574 int previous_value = errors_thrown()->value(); |
| 564 set_errors_thrown(Smi::FromInt(previous_value + 1)); | 575 set_errors_thrown(Smi::FromInt(previous_value + 1)); |
| 565 } | 576 } |
| 566 | 577 |
| 567 | 578 |
| 568 int Context::GetErrorsThrown() { return errors_thrown()->value(); } | 579 int Context::GetErrorsThrown() { return errors_thrown()->value(); } |
| 569 | 580 |
| 570 } // namespace internal | 581 } // namespace internal |
| 571 } // namespace v8 | 582 } // namespace v8 |
| OLD | NEW |