| 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/ast/scopeinfo.h" | 7 #include "src/ast/scopeinfo.h" |
| 8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
| 9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
| 10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 | 535 |
| 536 | 536 |
| 537 int Context::IntrinsicIndexForName(Handle<String> string) { | 537 int Context::IntrinsicIndexForName(Handle<String> string) { |
| 538 NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(COMPARE_NAME); | 538 NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(COMPARE_NAME); |
| 539 return kNotFound; | 539 return kNotFound; |
| 540 } | 540 } |
| 541 | 541 |
| 542 #undef COMPARE_NAME | 542 #undef COMPARE_NAME |
| 543 | 543 |
| 544 | 544 |
| 545 bool Context::IsJSBuiltin(Handle<Context> native_context, | |
| 546 Handle<JSFunction> function) { | |
| 547 #define COMPARE_FUNCTION(index, type, name) \ | |
| 548 if (*function == native_context->get(index)) return true; | |
| 549 NATIVE_CONTEXT_JS_BUILTINS(COMPARE_FUNCTION); | |
| 550 #undef COMPARE_FUNCTION | |
| 551 return false; | |
| 552 } | |
| 553 | |
| 554 | |
| 555 #ifdef DEBUG | 545 #ifdef DEBUG |
| 556 | 546 |
| 557 bool Context::IsBootstrappingOrNativeContext(Isolate* isolate, Object* object) { | 547 bool Context::IsBootstrappingOrNativeContext(Isolate* isolate, Object* object) { |
| 558 // During bootstrapping we allow all objects to pass as global | 548 // During bootstrapping we allow all objects to pass as global |
| 559 // objects. This is necessary to fix circular dependencies. | 549 // objects. This is necessary to fix circular dependencies. |
| 560 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || | 550 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || |
| 561 isolate->bootstrapper()->IsActive() || object->IsNativeContext(); | 551 isolate->bootstrapper()->IsActive() || object->IsNativeContext(); |
| 562 } | 552 } |
| 563 | 553 |
| 564 | 554 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 581 | 571 |
| 582 int previous_value = errors_thrown()->value(); | 572 int previous_value = errors_thrown()->value(); |
| 583 set_errors_thrown(Smi::FromInt(previous_value + 1)); | 573 set_errors_thrown(Smi::FromInt(previous_value + 1)); |
| 584 } | 574 } |
| 585 | 575 |
| 586 | 576 |
| 587 int Context::GetErrorsThrown() { return errors_thrown()->value(); } | 577 int Context::GetErrorsThrown() { return errors_thrown()->value(); } |
| 588 | 578 |
| 589 } // namespace internal | 579 } // namespace internal |
| 590 } // namespace v8 | 580 } // namespace v8 |
| OLD | NEW |