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

Side by Side Diff: src/api.cc

Issue 268063005: Clean up hash creation code to use Handle<Smi> where possible (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 | « no previous file | src/objects.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 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 #include "api.h" 5 #include "api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #include <cmath> // For isnan. 8 #include <cmath> // For isnan.
9 #include "../include/v8-debug.h" 9 #include "../include/v8-debug.h"
10 #include "../include/v8-profiler.h" 10 #include "../include/v8-profiler.h"
(...skipping 3566 matching lines...) Expand 10 before | Expand all | Expand 10 after
3577 return Utils::ToLocal(i::Handle<i::Context>(context)); 3577 return Utils::ToLocal(i::Handle<i::Context>(context));
3578 } 3578 }
3579 3579
3580 3580
3581 int v8::Object::GetIdentityHash() { 3581 int v8::Object::GetIdentityHash() {
3582 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3582 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3583 ON_BAILOUT(isolate, "v8::Object::GetIdentityHash()", return 0); 3583 ON_BAILOUT(isolate, "v8::Object::GetIdentityHash()", return 0);
3584 ENTER_V8(isolate); 3584 ENTER_V8(isolate);
3585 i::HandleScope scope(isolate); 3585 i::HandleScope scope(isolate);
3586 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3586 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3587 return i::Handle<i::Smi>::cast( 3587 return i::JSReceiver::GetOrCreateIdentityHash(self)->value();
3588 i::JSReceiver::GetOrCreateIdentityHash(self))->value();
3589 } 3588 }
3590 3589
3591 3590
3592 bool v8::Object::SetHiddenValue(v8::Handle<v8::String> key, 3591 bool v8::Object::SetHiddenValue(v8::Handle<v8::String> key,
3593 v8::Handle<v8::Value> value) { 3592 v8::Handle<v8::Value> value) {
3594 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3593 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3595 ON_BAILOUT(isolate, "v8::Object::SetHiddenValue()", return false); 3594 ON_BAILOUT(isolate, "v8::Object::SetHiddenValue()", return false);
3596 if (value.IsEmpty()) return DeleteHiddenValue(key); 3595 if (value.IsEmpty()) return DeleteHiddenValue(key);
3597 ENTER_V8(isolate); 3596 ENTER_V8(isolate);
3598 i::HandleScope scope(isolate); 3597 i::HandleScope scope(isolate);
(...skipping 3995 matching lines...) Expand 10 before | Expand all | Expand 10 after
7594 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7593 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7595 Address callback_address = 7594 Address callback_address =
7596 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7595 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7597 VMState<EXTERNAL> state(isolate); 7596 VMState<EXTERNAL> state(isolate);
7598 ExternalCallbackScope call_scope(isolate, callback_address); 7597 ExternalCallbackScope call_scope(isolate, callback_address);
7599 callback(info); 7598 callback(info);
7600 } 7599 }
7601 7600
7602 7601
7603 } } // namespace v8::internal 7602 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698