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

Side by Side Diff: src/api.h

Issue 24345003: remove Isolate::GetCurrent from Context api functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: comments Created 7 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 | Annotate | Revision Log
« no previous file with comments | « samples/lineprocessor.cc ('k') | src/api.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 536
537 537
538 inline internal::Object** GetSpareOrNewBlock(); 538 inline internal::Object** GetSpareOrNewBlock();
539 inline void DeleteExtensions(internal::Object** prev_limit); 539 inline void DeleteExtensions(internal::Object** prev_limit);
540 540
541 inline void IncrementCallDepth() {call_depth_++;} 541 inline void IncrementCallDepth() {call_depth_++;}
542 inline void DecrementCallDepth() {call_depth_--;} 542 inline void DecrementCallDepth() {call_depth_--;}
543 inline bool CallDepthIsZero() { return call_depth_ == 0; } 543 inline bool CallDepthIsZero() { return call_depth_ == 0; }
544 544
545 inline void EnterContext(Handle<Object> context); 545 inline void EnterContext(Handle<Object> context);
546 inline bool LeaveLastContext(); 546 inline bool LeaveContext(Handle<Object> context);
547 547
548 // Returns the last entered context or an empty handle if no 548 // Returns the last entered context or an empty handle if no
549 // contexts have been entered. 549 // contexts have been entered.
550 inline Handle<Object> LastEnteredContext(); 550 inline Handle<Object> LastEnteredContext();
551 551
552 inline void SaveContext(Context* context); 552 inline void SaveContext(Context* context);
553 inline Context* RestoreContext(); 553 inline Context* RestoreContext();
554 inline bool HasSavedContexts(); 554 inline bool HasSavedContexts();
555 555
556 inline List<internal::Object**>* blocks() { return &blocks_; } 556 inline List<internal::Object**>* blocks() { return &blocks_; }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 bool HandleScopeImplementer::HasSavedContexts() { 628 bool HandleScopeImplementer::HasSavedContexts() {
629 return !saved_contexts_.is_empty(); 629 return !saved_contexts_.is_empty();
630 } 630 }
631 631
632 632
633 void HandleScopeImplementer::EnterContext(Handle<Object> context) { 633 void HandleScopeImplementer::EnterContext(Handle<Object> context) {
634 entered_contexts_.Add(context); 634 entered_contexts_.Add(context);
635 } 635 }
636 636
637 637
638 bool HandleScopeImplementer::LeaveLastContext() { 638 bool HandleScopeImplementer::LeaveContext(Handle<Object> context) {
639 if (entered_contexts_.is_empty()) return false; 639 if (entered_contexts_.is_empty()) return false;
640 // TODO(dcarney): figure out what's wrong here
641 // if (*entered_contexts_.last() != *context) return false;
640 entered_contexts_.RemoveLast(); 642 entered_contexts_.RemoveLast();
641 return true; 643 return true;
642 } 644 }
643 645
644 646
645 Handle<Object> HandleScopeImplementer::LastEnteredContext() { 647 Handle<Object> HandleScopeImplementer::LastEnteredContext() {
646 if (entered_contexts_.is_empty()) return Handle<Object>::null(); 648 if (entered_contexts_.is_empty()) return Handle<Object>::null();
647 return entered_contexts_.last(); 649 return entered_contexts_.last();
648 } 650 }
649 651
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 stress_type_ = stress_type; 707 stress_type_ = stress_type;
706 } 708 }
707 709
708 private: 710 private:
709 static v8::Testing::StressType stress_type_; 711 static v8::Testing::StressType stress_type_;
710 }; 712 };
711 713
712 } } // namespace v8::internal 714 } } // namespace v8::internal
713 715
714 #endif // V8_API_H_ 716 #endif // V8_API_H_
OLDNEW
« no previous file with comments | « samples/lineprocessor.cc ('k') | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698