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

Side by Side Diff: src/api.cc

Issue 2627543004: [test] Fix test-api.cc test for caching of FunctionTemplate. (Closed)
Patch Set: Created 3 years, 11 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/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 "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 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 i::Isolate* isolate, FunctionCallback callback, 1269 i::Isolate* isolate, FunctionCallback callback,
1270 experimental::FastAccessorBuilder* fast_handler, v8::Local<Value> data, 1270 experimental::FastAccessorBuilder* fast_handler, v8::Local<Value> data,
1271 v8::Local<Signature> signature, int length, bool do_not_cache, 1271 v8::Local<Signature> signature, int length, bool do_not_cache,
1272 v8::Local<Private> cached_property_name = v8::Local<Private>()) { 1272 v8::Local<Private> cached_property_name = v8::Local<Private>()) {
1273 i::Handle<i::Struct> struct_obj = 1273 i::Handle<i::Struct> struct_obj =
1274 isolate->factory()->NewStruct(i::FUNCTION_TEMPLATE_INFO_TYPE); 1274 isolate->factory()->NewStruct(i::FUNCTION_TEMPLATE_INFO_TYPE);
1275 i::Handle<i::FunctionTemplateInfo> obj = 1275 i::Handle<i::FunctionTemplateInfo> obj =
1276 i::Handle<i::FunctionTemplateInfo>::cast(struct_obj); 1276 i::Handle<i::FunctionTemplateInfo>::cast(struct_obj);
1277 InitializeFunctionTemplate(obj); 1277 InitializeFunctionTemplate(obj);
1278 obj->set_do_not_cache(do_not_cache); 1278 obj->set_do_not_cache(do_not_cache);
1279 int next_serial_number = 0; 1279 int next_serial_number = i::FunctionTemplateInfo::kInvalidSerialNumber;
1280 if (!do_not_cache) { 1280 if (!do_not_cache) {
1281 next_serial_number = isolate->heap()->GetNextTemplateSerialNumber(); 1281 next_serial_number = isolate->heap()->GetNextTemplateSerialNumber();
1282 } 1282 }
1283 obj->set_serial_number(i::Smi::FromInt(next_serial_number)); 1283 obj->set_serial_number(i::Smi::FromInt(next_serial_number));
1284 if (callback != 0) { 1284 if (callback != 0) {
1285 if (data.IsEmpty()) { 1285 if (data.IsEmpty()) {
1286 data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate)); 1286 data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
1287 } 1287 }
1288 Utils::ToLocal(obj)->SetCallHandler(callback, data, fast_handler); 1288 Utils::ToLocal(obj)->SetCallHandler(callback, data, fast_handler);
1289 } 1289 }
(...skipping 8686 matching lines...) Expand 10 before | Expand all | Expand 10 after
9976 Address callback_address = 9976 Address callback_address =
9977 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9977 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9978 VMState<EXTERNAL> state(isolate); 9978 VMState<EXTERNAL> state(isolate);
9979 ExternalCallbackScope call_scope(isolate, callback_address); 9979 ExternalCallbackScope call_scope(isolate, callback_address);
9980 callback(info); 9980 callback(info);
9981 } 9981 }
9982 9982
9983 9983
9984 } // namespace internal 9984 } // namespace internal
9985 } // namespace v8 9985 } // namespace v8
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