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: 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 values[T::kReturnValueDefaultValueIndex] =
Sven Panne 2013/06/10 07:24:00 How do we make sure that the hole never escapes to
257 isolate->heap()->the_hole_value();
256 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); 258 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value();
257 ASSERT(values[T::kHolderIndex]->IsHeapObject()); 259 ASSERT(values[T::kHolderIndex]->IsHeapObject());
258 ASSERT(values[T::kIsolateIndex]->IsSmi()); 260 ASSERT(values[T::kIsolateIndex]->IsSmi());
259 } 261 }
260 262
261 /* 263 /*
262 * The following Call functions wrap the calling of all callbacks to handle 264 * 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 265 * calling either the old or the new style callbacks depending on which one
264 * has been registered. 266 * has been registered.
265 * For old callbacks which return an empty handle, the ReturnValue is checked 267 * 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) 308 bool is_construct_call)
307 : Super(isolate), 309 : Super(isolate),
308 argv_(argv), 310 argv_(argv),
309 argc_(argc), 311 argc_(argc),
310 is_construct_call_(is_construct_call) { 312 is_construct_call_(is_construct_call) {
311 Object** values = end(); 313 Object** values = end();
312 values[T::kDataIndex] = data; 314 values[T::kDataIndex] = data;
313 values[T::kCalleeIndex] = callee; 315 values[T::kCalleeIndex] = callee;
314 values[T::kHolderIndex] = holder; 316 values[T::kHolderIndex] = holder;
315 values[T::kIsolateIndex] = reinterpret_cast<internal::Object*>(isolate); 317 values[T::kIsolateIndex] = reinterpret_cast<internal::Object*>(isolate);
318 values[T::kReturnValueDefaultValueIndex] =
Sven Panne 2013/06/10 07:24:00 Same here.
319 isolate->heap()->the_hole_value();
316 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value(); 320 values[T::kReturnValueIndex] = isolate->heap()->the_hole_value();
317 ASSERT(values[T::kCalleeIndex]->IsJSFunction()); 321 ASSERT(values[T::kCalleeIndex]->IsJSFunction());
318 ASSERT(values[T::kHolderIndex]->IsHeapObject()); 322 ASSERT(values[T::kHolderIndex]->IsHeapObject());
319 ASSERT(values[T::kIsolateIndex]->IsSmi()); 323 ASSERT(values[T::kIsolateIndex]->IsSmi());
320 } 324 }
321 325
322 /* 326 /*
323 * The following Call function wraps the calling of all callbacks to handle 327 * 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 328 * calling either the old or the new style callbacks depending on which one
325 * has been registered. 329 * has been registered.
(...skipping 20 matching lines...) Expand all
346 return __RT_impl_##Name(args, isolate); \ 350 return __RT_impl_##Name(args, isolate); \
347 } \ 351 } \
348 static Type __RT_impl_##Name(Arguments args, Isolate* isolate) 352 static Type __RT_impl_##Name(Arguments args, Isolate* isolate)
349 353
350 #define RUNTIME_ARGUMENTS(isolate, args) \ 354 #define RUNTIME_ARGUMENTS(isolate, args) \
351 args.length(), args.arguments(), isolate 355 args.length(), args.arguments(), isolate
352 356
353 } } // namespace v8::internal 357 } } // namespace v8::internal
354 358
355 #endif // V8_ARGUMENTS_H_ 359 #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