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

Side by Side Diff: src/contexts.cc

Issue 2324803002: [Parser] Avoid on-the-fly internalization for natives_syntax. (Closed)
Patch Set: Created 4 years, 3 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/contexts.h ('k') | src/heap/heap.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 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
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
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
OLDNEW
« no previous file with comments | « src/contexts.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698