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

Side by Side Diff: src/isolate.h

Issue 352173006: Clean up the global object naming madness. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/ic-inl.h ('k') | src/isolate.cc » ('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 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 #ifndef V8_ISOLATE_H_ 5 #ifndef V8_ISOLATE_H_
6 #define V8_ISOLATE_H_ 6 #define V8_ISOLATE_H_
7 7
8 #include "include/v8-debug.h" 8 #include "include/v8-debug.h"
9 #include "src/allocation.h" 9 #include "src/allocation.h"
10 #include "src/assert-scope.h" 10 #include "src/assert-scope.h"
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 // Generated code scratch locations. 636 // Generated code scratch locations.
637 void* formal_count_address() { return &thread_local_top_.formal_count_; } 637 void* formal_count_address() { return &thread_local_top_.formal_count_; }
638 638
639 // Returns the global object of the current context. It could be 639 // Returns the global object of the current context. It could be
640 // a builtin object, or a JS global object. 640 // a builtin object, or a JS global object.
641 Handle<GlobalObject> global_object() { 641 Handle<GlobalObject> global_object() {
642 return Handle<GlobalObject>(context()->global_object()); 642 return Handle<GlobalObject>(context()->global_object());
643 } 643 }
644 644
645 // Returns the global proxy object of the current context. 645 // Returns the global proxy object of the current context.
646 Object* global_proxy() { 646 JSObject* global_proxy() {
647 return context()->global_proxy(); 647 return context()->global_proxy();
648 } 648 }
649 649
650 Handle<JSBuiltinsObject> js_builtins_object() { 650 Handle<JSBuiltinsObject> js_builtins_object() {
651 return Handle<JSBuiltinsObject>(thread_local_top_.context_->builtins()); 651 return Handle<JSBuiltinsObject>(thread_local_top_.context_->builtins());
652 } 652 }
653 653
654 static int ArchiveSpacePerThread() { return sizeof(ThreadLocalTop); } 654 static int ArchiveSpacePerThread() { return sizeof(ThreadLocalTop); }
655 void FreeThreadResources() { thread_local_top_.Free(); } 655 void FreeThreadResources() { thread_local_top_.Free(); }
656 656
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 #define GLOBAL_ARRAY_ACCESSOR(type, name, length) \ 803 #define GLOBAL_ARRAY_ACCESSOR(type, name, length) \
804 inline type* name() { \ 804 inline type* name() { \
805 ASSERT(OFFSET_OF(Isolate, name##_) == name##_debug_offset_); \ 805 ASSERT(OFFSET_OF(Isolate, name##_) == name##_debug_offset_); \
806 return &(name##_)[0]; \ 806 return &(name##_)[0]; \
807 } 807 }
808 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_ACCESSOR) 808 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_ACCESSOR)
809 #undef GLOBAL_ARRAY_ACCESSOR 809 #undef GLOBAL_ARRAY_ACCESSOR
810 810
811 #define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \ 811 #define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \
812 Handle<type> name() { \ 812 Handle<type> name() { \
813 return Handle<type>(context()->native_context()->name(), this); \ 813 return Handle<type>(native_context()->name(), this); \
814 } \ 814 } \
815 bool is_##name(type* value) { \ 815 bool is_##name(type* value) { \
816 return context()->native_context()->is_##name(value); \ 816 return native_context()->is_##name(value); \
817 } 817 }
818 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR) 818 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR)
819 #undef NATIVE_CONTEXT_FIELD_ACCESSOR 819 #undef NATIVE_CONTEXT_FIELD_ACCESSOR
820 820
821 Bootstrapper* bootstrapper() { return bootstrapper_; } 821 Bootstrapper* bootstrapper() { return bootstrapper_; }
822 Counters* counters() { 822 Counters* counters() {
823 // Call InitializeLoggingAndCounters() if logging is needed before 823 // Call InitializeLoggingAndCounters() if logging is needed before
824 // the isolate is fully initialized. 824 // the isolate is fully initialized.
825 ASSERT(counters_ != NULL); 825 ASSERT(counters_ != NULL);
826 return counters_; 826 return counters_;
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
1503 } 1503 }
1504 1504
1505 EmbeddedVector<char, 128> filename_; 1505 EmbeddedVector<char, 128> filename_;
1506 FILE* file_; 1506 FILE* file_;
1507 int scope_depth_; 1507 int scope_depth_;
1508 }; 1508 };
1509 1509
1510 } } // namespace v8::internal 1510 } } // namespace v8::internal
1511 1511
1512 #endif // V8_ISOLATE_H_ 1512 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « src/ic-inl.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698