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

Side by Side Diff: src/api.cc

Issue 1177043009: Make sure to flatten names before lookup. Lookup using cons strings is really slow. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | src/lookup.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 "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 3640 matching lines...) Expand 10 before | Expand all | Expand 10 after
3651 name = i::Handle<i::Name>::cast(key); 3651 name = i::Handle<i::Name>::cast(key);
3652 } else { 3652 } else {
3653 // Call-back into JavaScript to convert the key to a string. 3653 // Call-back into JavaScript to convert the key to a string.
3654 i::Handle<i::Object> converted; 3654 i::Handle<i::Object> converted;
3655 if (!i::Execution::ToString(isolate, key).ToHandle(&converted)) { 3655 if (!i::Execution::ToString(isolate, key).ToHandle(&converted)) {
3656 return i::MaybeHandle<i::Object>(); 3656 return i::MaybeHandle<i::Object>();
3657 } 3657 }
3658 name = i::Handle<i::String>::cast(converted); 3658 name = i::Handle<i::String>::cast(converted);
3659 } 3659 }
3660 3660
3661 if (name->IsString()) {
3662 name = i::String::Flatten(i::Handle<i::String>::cast(name));
3663 }
3664 return i::JSReceiver::DeleteProperty(receiver, name, language_mode); 3661 return i::JSReceiver::DeleteProperty(receiver, name, language_mode);
3665 } 3662 }
3666 3663
3667 } // namespace 3664 } // namespace
3668 3665
3669 3666
3670 MaybeLocal<Value> v8::Object::Get(Local<v8::Context> context, 3667 MaybeLocal<Value> v8::Object::Get(Local<v8::Context> context,
3671 Local<Value> key) { 3668 Local<Value> key) {
3672 PREPARE_FOR_EXECUTION(context, "v8::Object::Get()", Value); 3669 PREPARE_FOR_EXECUTION(context, "v8::Object::Get()", Value);
3673 auto self = Utils::OpenHandle(this); 3670 auto self = Utils::OpenHandle(this);
(...skipping 4725 matching lines...) Expand 10 before | Expand all | Expand 10 after
8399 Address callback_address = 8396 Address callback_address =
8400 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8397 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8401 VMState<EXTERNAL> state(isolate); 8398 VMState<EXTERNAL> state(isolate);
8402 ExternalCallbackScope call_scope(isolate, callback_address); 8399 ExternalCallbackScope call_scope(isolate, callback_address);
8403 callback(info); 8400 callback(info);
8404 } 8401 }
8405 8402
8406 8403
8407 } // namespace internal 8404 } // namespace internal
8408 } // namespace v8 8405 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/lookup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698