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

Side by Side Diff: src/arguments.h

Issue 16642003: add a default value for return value (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: comments addressed Created 7 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 | Annotate | Revision Log
« no previous file with comments | « include/v8.h ('k') | src/arm/stub-cache-arm.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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 PropertyCallbackArguments(Isolate* isolate, 246 PropertyCallbackArguments(Isolate* isolate,
247 Object* data, 247 Object* data,
248 Object* self, 248 Object* self,
249 JSObject* holder) 249 JSObject* holder)
250 : Super(isolate) { 250 : Super(isolate) {
251 Object** values = this->end(); 251 Object** values = this->end();
252 values[T::kThisIndex] = self; 252 values[T::kThisIndex] = self;
253 values[T::kHolderIndex] = holder; 253 values[T::kHolderIndex] = holder;
254 values[T::kDataIndex] = data; 254 values[T::kDataIndex] = data;
255 values[T::kIsolateIndex] = reinterpret_cast<Object*>(isolate); 255 values[T::kIsolateIndex] = reinterpret_cast<Object*>(isolate);
256 // Here the hole is set as default value.
257 // It cannot escape into js as it's remove in Call below.
258 values[T::kReturnValueDefaultValueIndex] =
259 isolate->heap()->the_hole_value();
256 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); 260 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value();
257 ASSERT(values[T::kHolderIndex]->IsHeapObject()); 261 ASSERT(values[T::kHolderIndex]->IsHeapObject());
258 ASSERT(values[T::kIsolateIndex]->IsSmi()); 262 ASSERT(values[T::kIsolateIndex]->IsSmi());
259 } 263 }
260 264
261 /* 265 /*
262 * The following Call functions wrap the calling of all callbacks to handle 266 * The following Call functions wrap the calling of all callbacks to handle
263 * calling either the old or the new style callbacks depending on which one 267 * calling either the old or the new style callbacks depending on which one
264 * has been registered. 268 * has been registered.
265 * For old callbacks which return an empty handle, the ReturnValue is checked 269 * For old callbacks which return an empty handle, the ReturnValue is checked
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 bool is_construct_call) 310 bool is_construct_call)
307 : Super(isolate), 311 : Super(isolate),
308 argv_(argv), 312 argv_(argv),
309 argc_(argc), 313 argc_(argc),
310 is_construct_call_(is_construct_call) { 314 is_construct_call_(is_construct_call) {
311 Object** values = end(); 315 Object** values = end();
312 values[T::kDataIndex] = data; 316 values[T::kDataIndex] = data;
313 values[T::kCalleeIndex] = callee; 317 values[T::kCalleeIndex] = callee;
314 values[T::kHolderIndex] = holder; 318 values[T::kHolderIndex] = holder;
315 values[T::kIsolateIndex] = reinterpret_cast<internal::Object*>(isolate); 319 values[T::kIsolateIndex] = reinterpret_cast<internal::Object*>(isolate);
320 // Here the hole is set as default value.
321 // It cannot escape into js as it's remove in Call below.
322 values[T::kReturnValueDefaultValueIndex] =
323 isolate->heap()->the_hole_value();
316 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); 324 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value();
317 ASSERT(values[T::kCalleeIndex]->IsJSFunction()); 325 ASSERT(values[T::kCalleeIndex]->IsJSFunction());
318 ASSERT(values[T::kHolderIndex]->IsHeapObject()); 326 ASSERT(values[T::kHolderIndex]->IsHeapObject());
319 ASSERT(values[T::kIsolateIndex]->IsSmi()); 327 ASSERT(values[T::kIsolateIndex]->IsSmi());
320 } 328 }
321 329
322 /* 330 /*
323 * The following Call function wraps the calling of all callbacks to handle 331 * The following Call function wraps the calling of all callbacks to handle
324 * calling either the old or the new style callbacks depending on which one 332 * calling either the old or the new style callbacks depending on which one
325 * has been registered. 333 * has been registered.
(...skipping 20 matching lines...) Expand all
346 return __RT_impl_##Name(args, isolate); \ 354 return __RT_impl_##Name(args, isolate); \
347 } \ 355 } \
348 static Type __RT_impl_##Name(Arguments args, Isolate* isolate) 356 static Type __RT_impl_##Name(Arguments args, Isolate* isolate)
349 357
350 #define RUNTIME_ARGUMENTS(isolate, args) \ 358 #define RUNTIME_ARGUMENTS(isolate, args) \
351 args.length(), args.arguments(), isolate 359 args.length(), args.arguments(), isolate
352 360
353 } } // namespace v8::internal 361 } } // namespace v8::internal
354 362
355 #endif // V8_ARGUMENTS_H_ 363 #endif // V8_ARGUMENTS_H_
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698