1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #include "allocation.h"
37 // The interface to C++ runtime functions.
39 // ----------------------------------------------------------------------------
40 // RUNTIME_FUNCTION_LIST_ALWAYS defines runtime calls available in both
41 // release and debug mode.
42 // This macro should only be used by the macro RUNTIME_FUNCTION_LIST.
44 // WARNING: RUNTIME_FUNCTION_LIST_ALWAYS_* is a very large macro that caused
45 // MSVC Intellisense to crash. It was broken into two macros to work around
46 // this problem. Please avoid large recursive macros whenever possible.
47 #define RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \
48 /* Property access */ \
49 F(GetProperty, 2, 1) \
50 F(KeyedGetProperty, 2, 1) \
51 F(DeleteProperty, 3, 1) \
52 F(HasLocalProperty, 2, 1) \
53 F(HasProperty, 2, 1) \
55 F(IsPropertyEnumerable, 2, 1) \
56 F(GetPropertyNames, 1, 1) \
57 F(GetPropertyNamesFast, 1, 1) \
58 F(GetLocalPropertyNames, 1, 1) \
59 F(GetLocalElementNames, 1, 1) \
60 F(GetInterceptorInfo, 1, 1) \
61 F(GetNamedInterceptorPropertyNames, 1, 1) \
62 F(GetIndexedInterceptorElementNames, 1, 1) \
63 F(GetArgumentsProperty, 1, 1) \
64 F(ToFastProperties, 1, 1) \
65 F(ToSlowProperties, 1, 1) \
66 F(FinishArrayPrototypeSetup, 1, 1) \
67 F(SpecialArrayFunctions, 1, 1) \
68 F(GetDefaultReceiver, 1, 1) \
70 F(GetPrototype, 1, 1) \
71 F(IsInPrototypeChain, 2, 1) \
72 F(SetHiddenPrototype, 2, 1) \
74 F(IsConstructCall, 0, 1) \
76 F(GetOwnProperty, 2, 1) \
78 F(IsExtensible, 1, 1) \
79 F(PreventExtensions, 1, 1)\
82 F(CheckIsBootstrapping, 0, 1) \
84 F(GetFunctionDelegate, 1, 1) \
85 F(GetConstructorDelegate, 1, 1) \
86 F(NewArgumentsFast, 3, 1) \
87 F(NewStrictArgumentsFast, 3, 1) \
88 F(LazyCompile, 1, 1) \
89 F(LazyRecompile, 1, 1) \
90 F(NotifyDeoptimized, 1, 1) \
92 F(DeoptimizeFunction, 1, 1) \
93 F(RunningInSimulator, 0, 1) \
94 F(OptimizeFunctionOnNextCall, 1, 1) \
95 F(GetOptimizationStatus, 1, 1) \
96 F(GetOptimizationCount, 1, 1) \
97 F(CompileForOnStackReplacement, 1, 1) \
98 F(SetNewFunctionAttributes, 1, 1) \
99 F(AllocateInNewSpace, 1, 1) \
100 F(SetNativeFlag, 1, 1) \
101 F(StoreArrayLiteralElement, 5, 1) \
103 /* Array join support */ \
104 F(PushIfAbsent, 2, 1) \
105 F(ArrayConcat, 1, 1) \
111 F(StringToNumber, 1, 1) \
112 F(StringFromCharCodeArray, 1, 1) \
113 F(StringParseInt, 2, 1) \
114 F(StringParseFloat, 1, 1) \
115 F(StringToLowerCase, 1, 1) \
116 F(StringToUpperCase, 1, 1) \
117 F(StringSplit, 3, 1) \
118 F(CharFromCode, 1, 1) \
120 F(URIUnescape, 1, 1) \
121 F(QuoteJSONString, 1, 1) \
122 F(QuoteJSONStringComma, 1, 1) \
123 F(QuoteJSONStringArray, 1, 1) \
125 F(NumberToString, 1, 1) \
126 F(NumberToStringSkipCache, 1, 1) \
127 F(NumberToInteger, 1, 1) \
128 F(NumberToIntegerMapMinusZero, 1, 1) \
129 F(NumberToJSUint32, 1, 1) \
130 F(NumberToJSInt32, 1, 1) \
131 F(NumberToSmi, 1, 1) \
132 F(AllocateHeapNumber, 0, 1) \
134 /* Arithmetic operations */ \
140 F(NumberUnaryMinus, 1, 1) \
141 F(NumberAlloc, 0, 1) \
144 F(StringBuilderConcat, 3, 1) \
145 F(StringBuilderJoin, 3, 1) \
146 F(SparseJoinWithSeparator, 3, 1) \
148 /* Bit operations */ \
159 F(NumberEquals, 2, 1) \
160 F(StringEquals, 2, 1) \
161 F(UserObjectEquals, 2, 1) \
163 F(NumberCompare, 3, 1) \
164 F(SmiLexicographicCompare, 2, 1) \
165 F(StringCompare, 2, 1) \
171 F(Math_atan2, 2, 1) \
175 F(Math_floor, 1, 1) \
178 F(Math_pow_cfunction, 2, 1) \
179 F(RoundNumber, 1, 1) \
184 /* Regular expressions */ \
185 F(RegExpCompile, 3, 1) \
186 F(RegExpExec, 4, 1) \
187 F(RegExpExecMultiple, 4, 1) \
188 F(RegExpInitializeObject, 5, 1) \
189 F(RegExpConstructResult, 3, 1) \
195 F(StringCharCodeAt, 2, 1) \
196 F(StringIndexOf, 3, 1) \
197 F(StringLastIndexOf, 3, 1) \
198 F(StringLocaleCompare, 2, 1) \
200 F(StringReplaceRegExpWithString, 4, 1) \
201 F(StringMatch, 3, 1) \
202 F(StringTrim, 3, 1) \
203 F(StringToArray, 2, 1) \
204 F(NewStringWrapper, 1, 1) \
207 F(NumberToRadixString, 2, 1) \
208 F(NumberToFixed, 2, 1) \
209 F(NumberToExponential, 2, 1) \
210 F(NumberToPrecision, 2, 1)
212 #define RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \
214 F(FunctionSetInstanceClassName, 2, 1) \
215 F(FunctionSetLength, 2, 1) \
216 F(FunctionSetPrototype, 2, 1) \
217 F(FunctionSetReadOnlyPrototype, 1, 1) \
218 F(FunctionGetName, 1, 1) \
219 F(FunctionSetName, 2, 1) \
220 F(FunctionNameShouldPrintAsAnonymous, 1, 1) \
221 F(FunctionMarkNameShouldPrintAsAnonymous, 1, 1) \
222 F(FunctionBindArguments, 4, 1) \
223 F(BoundFunctionGetBindings, 1, 1) \
224 F(FunctionRemovePrototype, 1, 1) \
225 F(FunctionGetSourceCode, 1, 1) \
226 F(FunctionGetScript, 1, 1) \
227 F(FunctionGetScriptSourcePosition, 1, 1) \
228 F(FunctionGetPositionForOffset, 2, 1) \
229 F(FunctionIsAPIFunction, 1, 1) \
230 F(FunctionIsBuiltin, 1, 1) \
232 F(CollectStackTrace, 2, 1) \
233 F(GetV8Version, 0, 1) \
237 F(SetExpectedNumberOfProperties, 2, 1) \
239 F(CreateApiFunction, 1, 1) \
240 F(IsTemplate, 1, 1) \
241 F(GetTemplateField, 2, 1) \
242 F(DisableAccessChecks, 1, 1) \
243 F(EnableAccessChecks, 1, 1) \
246 F(DateCurrentTime, 0, 1) \
247 F(DateParseString, 2, 1) \
248 F(DateLocalTimezone, 1, 1) \
249 F(DateLocalTimeOffset, 0, 1) \
250 F(DateDaylightSavingsOffset, 1, 1) \
251 F(DateMakeDay, 2, 1) \
252 F(DateYMDFromTime, 2, 1) \
257 F(CompileString, 1, 1) \
258 F(GlobalPrint, 1, 1) \
261 F(GlobalReceiver, 1, 1) \
262 F(ResolvePossiblyDirectEval, 5, 2) \
264 F(SetProperty, -1 /* 4 or 5 */, 1) \
265 F(DefineOrRedefineDataProperty, 4, 1) \
266 F(DefineOrRedefineAccessorProperty, 5, 1) \
267 F(IgnoreAttributesAndSetProperty, -1 /* 3 or 4 */, 1) \
270 F(RemoveArrayHoles, 2, 1) \
271 F(GetArrayKeys, 2, 1) \
272 F(MoveArrayContents, 2, 1) \
273 F(EstimateNumberOfElements, 1, 1) \
274 F(SwapElements, 3, 1) \
276 /* Getters and Setters */ \
277 F(DefineAccessor, -1 /* 4 or 5 */, 1) \
278 F(LookupAccessor, 3, 1) \
281 F(MaterializeRegExpLiteral, 4, 1)\
282 F(CreateArrayLiteralBoilerplate, 4, 1) \
283 F(CloneLiteralBoilerplate, 1, 1) \
284 F(CloneShallowLiteralBoilerplate, 1, 1) \
285 F(CreateObjectLiteral, 4, 1) \
286 F(CreateObjectLiteralShallow, 4, 1) \
287 F(CreateArrayLiteral, 3, 1) \
288 F(CreateArrayLiteralShallow, 3, 1) \
290 /* Harmony proxies */ \
291 F(CreateJSProxy, 2, 1) \
292 F(CreateJSFunctionProxy, 4, 1) \
294 F(IsJSFunctionProxy, 1, 1) \
295 F(GetHandler, 1, 1) \
296 F(GetCallTrap, 1, 1) \
297 F(GetConstructTrap, 1, 1) \
301 F(SetInitialize, 1, 1) \
307 F(MapInitialize, 1, 1) \
311 /* Harmony weakmaps */ \
312 F(WeakMapInitialize, 1, 1) \
313 F(WeakMapGet, 2, 1) \
314 F(WeakMapSet, 3, 1) \
317 F(NewClosure, 3, 1) \
319 F(NewObjectFromBound, 1, 1) \
320 F(FinalizeInstanceSize, 1, 1) \
323 F(ThrowReferenceError, 1, 1) \
324 F(StackGuard, 0, 1) \
325 F(PromoteScheduledException, 0, 1) \
328 F(NewFunctionContext, 1, 1) \
329 F(PushWithContext, 2, 1) \
330 F(PushCatchContext, 3, 1) \
331 F(PushBlockContext, 2, 1) \
332 F(DeleteContextSlot, 2, 1) \
333 F(LoadContextSlot, 2, 2) \
334 F(LoadContextSlotNoReferenceError, 2, 2) \
335 F(StoreContextSlot, 4, 1) \
337 /* Declarations and initialization */ \
338 F(DeclareGlobals, 3, 1) \
339 F(DeclareContextSlot, 4, 1) \
340 F(InitializeVarGlobal, -1 /* 3 or 4 */, 1) \
341 F(InitializeConstGlobal, 3, 1) \
342 F(InitializeConstContextSlot, 3, 1) \
343 F(OptimizeObjectForAddingMultipleProperties, 2, 1) \
346 F(DebugPrint, 1, 1) \
347 F(DebugTrace, 0, 1) \
348 F(TraceElementsKindTransition, 5, 1) \
349 F(TraceEnter, 0, 1) \
357 F(GetFromCache, 2, 1) \
359 /* Message objects */ \
360 F(NewMessageObject, 2, 1) \
361 F(MessageGetType, 1, 1) \
362 F(MessageGetArguments, 1, 1) \
363 F(MessageGetStartPosition, 1, 1) \
364 F(MessageGetScript, 1, 1) \
366 /* Pseudo functions - handled as macros by parser */ \
369 /* expose boolean functions from objects-inl.h */ \
370 F(HasFastSmiOnlyElements, 1, 1) \
371 F(HasFastElements, 1, 1) \
372 F(HasFastDoubleElements, 1, 1) \
373 F(HasDictionaryElements, 1, 1) \
374 F(HasExternalPixelElements, 1, 1) \
375 F(HasExternalArrayElements, 1, 1) \
376 F(HasExternalByteElements, 1, 1) \
377 F(HasExternalUnsignedByteElements, 1, 1) \
378 F(HasExternalShortElements, 1, 1) \
379 F(HasExternalUnsignedShortElements, 1, 1) \
380 F(HasExternalIntElements, 1, 1) \
381 F(HasExternalUnsignedIntElements, 1, 1) \
382 F(HasExternalFloatElements, 1, 1) \
383 F(HasExternalDoubleElements, 1, 1) \
384 F(TransitionElementsSmiToDouble, 1, 1) \
385 F(TransitionElementsDoubleToObject, 1, 1) \
386 F(HaveSameMap, 2, 1) \
388 F(ProfilerResume, 0, 1) \
389 F(ProfilerPause, 0, 1)
392 #ifdef ENABLE_DEBUGGER_SUPPORT
393 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \
394 /* Debugger support*/ \
395 F(DebugBreak, 0, 1) \
396 F(SetDebugEventListener, 2, 1) \
398 F(DebugGetPropertyDetails, 2, 1) \
399 F(DebugGetProperty, 2, 1) \
400 F(DebugPropertyTypeFromDetails, 1, 1) \
401 F(DebugPropertyAttributesFromDetails, 1, 1) \
402 F(DebugPropertyIndexFromDetails, 1, 1) \
403 F(DebugNamedInterceptorPropertyValue, 2, 1) \
404 F(DebugIndexedInterceptorElementValue, 2, 1) \
405 F(CheckExecutionState, 1, 1) \
406 F(GetFrameCount, 1, 1) \
407 F(GetFrameDetails, 2, 1) \
408 F(GetScopeCount, 2, 1) \
409 F(GetScopeDetails, 4, 1) \
410 F(DebugPrintScopes, 0, 1) \
411 F(GetThreadCount, 1, 1) \
412 F(GetThreadDetails, 2, 1) \
413 F(SetDisableBreak, 1, 1) \
414 F(GetBreakLocations, 1, 1) \
415 F(AllowBreakPointRelocation, 0, 1) \
416 F(SetFunctionBreakPoint, 3, 1) \
417 F(SetScriptBreakPoint, 3, 1) \
418 F(ClearBreakPoint, 1, 1) \
419 F(ChangeBreakOnException, 2, 1) \
420 F(IsBreakOnException, 1, 1) \
421 F(PrepareStep, 3, 1) \
422 F(ClearStepping, 0, 1) \
423 F(DebugEvaluate, 6, 1) \
424 F(DebugEvaluateGlobal, 4, 1) \
425 F(DebugGetLoadedScripts, 0, 1) \
426 F(DebugReferencedBy, 3, 1) \
427 F(DebugConstructedBy, 2, 1) \
428 F(DebugGetPrototype, 1, 1) \
429 F(SystemBreak, 0, 1) \
430 F(DebugDisassembleFunction, 1, 1) \
431 F(DebugDisassembleConstructor, 1, 1) \
432 F(FunctionGetInferredName, 1, 1) \
433 F(LiveEditFindSharedFunctionInfosForScript, 1, 1) \
434 F(LiveEditGatherCompileInfo, 2, 1) \
435 F(LiveEditReplaceScript, 3, 1) \
436 F(LiveEditReplaceFunctionCode, 2, 1) \
437 F(LiveEditFunctionSourceUpdated, 1, 1) \
438 F(LiveEditFunctionSetScript, 2, 1) \
439 F(LiveEditReplaceRefToNestedFunction, 3, 1) \
440 F(LiveEditPatchFunctionPositions, 2, 1) \
441 F(LiveEditCheckAndDropActivations, 2, 1) \
442 F(LiveEditCompareStrings, 2, 1) \
443 F(GetFunctionCodePositionFromSource, 2, 1) \
444 F(ExecuteInDebugContext, 2, 1) \
447 F(CollectGarbage, 1, 1) \
448 F(GetHeapUsage, 0, 1) \
450 /* LiveObjectList support*/ \
451 F(HasLOLEnabled, 0, 1) \
452 F(CaptureLOL, 0, 1) \
456 F(GetLOLObjId, 1, 1) \
457 F(GetLOLObjRetainers, 6, 1) \
458 F(GetLOLPath, 3, 1) \
460 F(PrintLOLObj, 1, 1) \
462 F(SummarizeLOL, 3, 1)
465 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F)
469 #define RUNTIME_FUNCTION_LIST_DEBUG(F) \
473 #define RUNTIME_FUNCTION_LIST_DEBUG(F)
476 // ----------------------------------------------------------------------------
477 // RUNTIME_FUNCTION_LIST defines all runtime functions accessed
478 // either directly by id (via the code generator), or indirectly
479 // via a native call by name (from within JS code).
481 #define RUNTIME_FUNCTION_LIST(F) \
482 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \
483 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \
484 RUNTIME_FUNCTION_LIST_DEBUG(F) \
485 RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F)
487 // ----------------------------------------------------------------------------
488 // INLINE_FUNCTION_LIST defines all inlined functions accessed
489 // with a native call of the form %_name from within JS code.
490 // Entries have the form F(name, number of arguments, number of return values).
491 #define INLINE_FUNCTION_LIST(F) \
493 F(IsNonNegativeSmi, 1, 1) \
496 F(CallFunction, -1 /* receiver + n args + function */, 1) \
497 F(ArgumentsLength, 0, 1) \
500 F(SetValueOf, 2, 1) \
501 F(StringCharFromCode, 1, 1) \
502 F(StringCharAt, 2, 1) \
503 F(ObjectEquals, 2, 1) \
504 F(RandomHeapNumber, 0, 1) \
506 F(IsFunction, 1, 1) \
507 F(IsUndetectableObject, 1, 1) \
508 F(IsSpecObject, 1, 1) \
509 F(IsStringWrapperSafeForDefaultValueOf, 1, 1) \
515 F(IsRegExpEquivalent, 2, 1) \
516 F(HasCachedArrayIndex, 1, 1) \
517 F(GetCachedArrayIndex, 1, 1) \
518 F(FastAsciiArrayJoin, 2, 1)
521 // ----------------------------------------------------------------------------
522 // INLINE_AND_RUNTIME_FUNCTION_LIST defines all inlined functions accessed
523 // with a native call of the form %_name from within JS code that also have
524 // a corresponding runtime function, that is called for slow cases.
525 // Entries have the form F(name, number of arguments, number of return values).
526 #define INLINE_RUNTIME_FUNCTION_LIST(F) \
527 F(IsConstructCall, 0, 1) \
529 F(StringCharCodeAt, 2, 1) \
533 F(StringCompare, 2, 1) \
534 F(RegExpExec, 4, 1) \
535 F(RegExpConstructResult, 3, 1) \
536 F(GetFromCache, 2, 1) \
537 F(NumberToString, 1, 1) \
538 F(SwapElements, 3, 1)
541 //---------------------------------------------------------------------------
542 // Runtime provides access to all C++ runtime functions.
546 StaticResource<StringInputBuffer>* string_input_buffer() {
547 return &string_input_buffer_;
549 unibrow::Mapping<unibrow::ToUppercase, 128>* to_upper_mapping() {
550 return &to_upper_mapping_;
552 unibrow::Mapping<unibrow::ToLowercase, 128>* to_lower_mapping() {
553 return &to_lower_mapping_;
555 StringInputBuffer* string_input_buffer_compare_bufx() {
556 return &string_input_buffer_compare_bufx_;
558 StringInputBuffer* string_input_buffer_compare_bufy() {
559 return &string_input_buffer_compare_bufy_;
561 StringInputBuffer* string_locale_compare_buf1() {
562 return &string_locale_compare_buf1_;
564 StringInputBuffer* string_locale_compare_buf2() {
565 return &string_locale_compare_buf2_;
570 // Non-reentrant string buffer for efficient general use in the runtime.
571 StaticResource<StringInputBuffer> string_input_buffer_;
572 unibrow::Mapping<unibrow::ToUppercase, 128> to_upper_mapping_;
573 unibrow::Mapping<unibrow::ToLowercase, 128> to_lower_mapping_;
574 StringInputBuffer string_input_buffer_compare_bufx_;
575 StringInputBuffer string_input_buffer_compare_bufy_;
576 StringInputBuffer string_locale_compare_buf1_;
577 StringInputBuffer string_locale_compare_buf2_;
579 friend class Isolate;
580 friend class Runtime;
582 DISALLOW_COPY_AND_ASSIGN(RuntimeState);
586 class Runtime : public AllStatic {
589 #define F(name, nargs, ressize) k##name,
590 RUNTIME_FUNCTION_LIST(F)
592 #define F(name, nargs, ressize) kInline##name,
593 INLINE_FUNCTION_LIST(F)
594 INLINE_RUNTIME_FUNCTION_LIST(F)
597 kFirstInlineFunction = kInlineIsSmi
605 // Intrinsic function descriptor.
607 FunctionId function_id;
608 IntrinsicType intrinsic_type;
609 // The JS name of the function.
612 // The C++ (native) entry point. NULL if the function is inlined.
615 // The number of arguments expected. nargs is -1 if the function takes
616 // a variable number of arguments.
618 // Size of result. Most functions return a single pointer, size 1.
622 static const int kNotFound = -1;
624 // Add symbols for all the intrinsic function names to a StringDictionary.
625 // Returns failure if an allocation fails. In this case, it must be
626 // retried with a new, empty StringDictionary, not with the same one.
627 // Alternatively, heap initialization can be completely restarted.
628 MUST_USE_RESULT static MaybeObject* InitializeIntrinsicFunctionNames(
629 Heap* heap, Object* dictionary);
631 // Get the intrinsic function with the given name, which must be a symbol.
632 static const Function* FunctionForSymbol(Handle<String> name);
634 // Get the intrinsic function with the given FunctionId.
635 static const Function* FunctionForId(FunctionId id);
637 // General-purpose helper functions for runtime system.
638 static int StringMatch(Isolate* isolate,
643 static bool IsUpperCaseChar(RuntimeState* runtime_state, uint16_t ch);
645 // TODO(1240886): Some of the following methods are *not* handle safe, but
646 // accept handle arguments. This seems fragile.
648 // Support getting the characters in a string using [] notation as
649 // in Firefox/SpiderMonkey, Safari and Opera.
650 MUST_USE_RESULT static MaybeObject* GetElementOrCharAt(Isolate* isolate,
651 Handle<Object> object,
654 MUST_USE_RESULT static MaybeObject* SetObjectProperty(
656 Handle<Object> object,
658 Handle<Object> value,
659 PropertyAttributes attr,
660 StrictModeFlag strict_mode);
662 MUST_USE_RESULT static MaybeObject* ForceSetObjectProperty(
664 Handle<JSObject> object,
666 Handle<Object> value,
667 PropertyAttributes attr);
669 MUST_USE_RESULT static MaybeObject* ForceDeleteObjectProperty(
671 Handle<JSReceiver> object,
674 MUST_USE_RESULT static MaybeObject* GetObjectProperty(
676 Handle<Object> object,
679 // This function is used in FunctionNameUsing* tests.
680 static Object* FindSharedFunctionInfoInScript(Isolate* isolate,
681 Handle<Script> script,
684 // Helper functions used stubs.
685 static void PerformGC(Object* result);
689 //---------------------------------------------------------------------------
690 // Constants used by interface to runtime functions.
692 class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {};
693 class DeclareGlobalsStrictModeFlag: public BitField<StrictModeFlag, 1, 1> {};
694 class DeclareGlobalsNativeFlag: public BitField<bool, 2, 1> {};
696 } } // namespace v8::internal
698 #endif // V8_RUNTIME_H_