Change a few sites where the Handle<T>(NULL) constructor is used so
that they use the static Handle<T>::null() member function instead. Review URL: http://codereview.chromium.org/155135 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2371 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
fa12b9a4e2
commit
8e0e670bde
@ -1556,7 +1556,7 @@ Genesis::Genesis(Handle<Object> global_object,
|
||||
// will always do unlinking.
|
||||
previous_ = current_;
|
||||
current_ = this;
|
||||
result_ = NULL;
|
||||
result_ = Handle<Context>::null();
|
||||
|
||||
// If V8 isn't running and cannot be initialized, just return.
|
||||
if (!V8::IsRunning() && !V8::Initialize(NULL)) return;
|
||||
|
@ -372,10 +372,10 @@ static void ClearWrapperCache(Persistent<v8::Value> handle, void*) {
|
||||
|
||||
|
||||
Handle<JSValue> GetScriptWrapper(Handle<Script> script) {
|
||||
Handle<Object> cache(reinterpret_cast<Object**>(script->wrapper()->proxy()));
|
||||
if (!cache.is_null()) {
|
||||
if (script->wrapper()->proxy() != NULL) {
|
||||
// Return the script wrapper directly from the cache.
|
||||
return Handle<JSValue>(JSValue::cast(*cache));
|
||||
return Handle<JSValue>(
|
||||
reinterpret_cast<JSValue**>(script->wrapper()->proxy()));
|
||||
}
|
||||
|
||||
// Construct a new script wrapper.
|
||||
|
@ -42,7 +42,7 @@ namespace internal {
|
||||
template<class T>
|
||||
class Handle {
|
||||
public:
|
||||
INLINE(Handle(T** location)) { location_ = location; }
|
||||
INLINE(Handle(T** location)) { location_ = location; }
|
||||
INLINE(explicit Handle(T* obj));
|
||||
|
||||
INLINE(Handle()) : location_(NULL) {}
|
||||
@ -59,7 +59,7 @@ class Handle {
|
||||
location_ = reinterpret_cast<T**>(handle.location());
|
||||
}
|
||||
|
||||
INLINE(T* operator ->() const) { return operator*(); }
|
||||
INLINE(T* operator ->() const) { return operator*(); }
|
||||
|
||||
// Check if this handle refers to the exact same object as the other handle.
|
||||
bool is_identical_to(const Handle<T> other) const {
|
||||
|
@ -114,8 +114,10 @@ void CpuFeatures::Probe() {
|
||||
|
||||
CodeDesc desc;
|
||||
assm.GetCode(&desc);
|
||||
Object* code =
|
||||
Heap::CreateCode(desc, NULL, Code::ComputeFlags(Code::STUB), NULL);
|
||||
Object* code = Heap::CreateCode(desc,
|
||||
NULL,
|
||||
Code::ComputeFlags(Code::STUB),
|
||||
Handle<Code>::null());
|
||||
if (!code->IsCode()) return;
|
||||
LOG(CodeCreateEvent(Logger::BUILTIN_TAG,
|
||||
Code::cast(code), "CpuFeatures::Probe"));
|
||||
|
@ -2045,7 +2045,7 @@ Statement* Parser::ParseContinueStatement(bool* ok) {
|
||||
// 'continue' Identifier? ';'
|
||||
|
||||
Expect(Token::CONTINUE, CHECK_OK);
|
||||
Handle<String> label(static_cast<String**>(NULL));
|
||||
Handle<String> label = Handle<String>::null();
|
||||
Token::Value tok = peek();
|
||||
if (!scanner_.has_line_terminator_before_next() &&
|
||||
tok != Token::SEMICOLON && tok != Token::RBRACE && tok != Token::EOS) {
|
||||
|
Loading…
Reference in New Issue
Block a user