1 // Copyright 2012 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) \
73 F(GetOwnProperty, 2, 1) \
75 F(IsExtensible, 1, 1) \
76 F(PreventExtensions, 1, 1)\
79 F(CheckIsBootstrapping, 0, 1) \
81 F(Call, -1 /* >= 2 */, 1) \
83 F(GetFunctionDelegate, 1, 1) \
84 F(GetConstructorDelegate, 1, 1) \
85 F(NewArgumentsFast, 3, 1) \
86 F(NewStrictArgumentsFast, 3, 1) \
87 F(LazyCompile, 1, 1) \
88 F(LazyRecompile, 1, 1) \
89 F(NotifyDeoptimized, 1, 1) \
91 F(DeoptimizeFunction, 1, 1) \
92 F(ClearFunctionTypeFeedback, 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) \
102 F(DebugCallbackSupportsStepping, 1, 1) \
103 F(DebugPrepareStepInIfStepping, 1, 1) \
105 /* Array join support */ \
106 F(PushIfAbsent, 2, 1) \
107 F(ArrayConcat, 1, 1) \
113 F(StringToNumber, 1, 1) \
114 F(StringFromCharCodeArray, 1, 1) \
115 F(StringParseInt, 2, 1) \
116 F(StringParseFloat, 1, 1) \
117 F(StringToLowerCase, 1, 1) \
118 F(StringToUpperCase, 1, 1) \
119 F(StringSplit, 3, 1) \
120 F(CharFromCode, 1, 1) \
122 F(URIUnescape, 1, 1) \
123 F(QuoteJSONString, 1, 1) \
124 F(QuoteJSONStringComma, 1, 1) \
125 F(QuoteJSONStringArray, 1, 1) \
127 F(NumberToString, 1, 1) \
128 F(NumberToStringSkipCache, 1, 1) \
129 F(NumberToInteger, 1, 1) \
130 F(NumberToIntegerMapMinusZero, 1, 1) \
131 F(NumberToJSUint32, 1, 1) \
132 F(NumberToJSInt32, 1, 1) \
133 F(NumberToSmi, 1, 1) \
134 F(AllocateHeapNumber, 0, 1) \
136 /* Arithmetic operations */ \
142 F(NumberUnaryMinus, 1, 1) \
143 F(NumberAlloc, 0, 1) \
146 F(StringBuilderConcat, 3, 1) \
147 F(StringBuilderJoin, 3, 1) \
148 F(SparseJoinWithSeparator, 3, 1) \
150 /* Bit operations */ \
161 F(NumberEquals, 2, 1) \
162 F(StringEquals, 2, 1) \
164 F(NumberCompare, 3, 1) \
165 F(SmiLexicographicCompare, 2, 1) \
166 F(StringCompare, 2, 1) \
172 F(Math_atan2, 2, 1) \
176 F(Math_floor, 1, 1) \
179 F(Math_pow_cfunction, 2, 1) \
180 F(RoundNumber, 1, 1) \
185 /* Regular expressions */ \
186 F(RegExpCompile, 3, 1) \
187 F(RegExpExec, 4, 1) \
188 F(RegExpExecMultiple, 4, 1) \
189 F(RegExpInitializeObject, 5, 1) \
190 F(RegExpConstructResult, 3, 1) \
196 F(StringCharCodeAt, 2, 1) \
197 F(StringIndexOf, 3, 1) \
198 F(StringLastIndexOf, 3, 1) \
199 F(StringLocaleCompare, 2, 1) \
201 F(StringReplaceRegExpWithString, 4, 1) \
202 F(StringReplaceOneCharWithString, 3, 1) \
203 F(StringMatch, 3, 1) \
204 F(StringTrim, 3, 1) \
205 F(StringToArray, 2, 1) \
206 F(NewStringWrapper, 1, 1) \
209 F(NumberToRadixString, 2, 1) \
210 F(NumberToFixed, 2, 1) \
211 F(NumberToExponential, 2, 1) \
212 F(NumberToPrecision, 2, 1)
214 #define RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \
216 F(FunctionSetInstanceClassName, 2, 1) \
217 F(FunctionSetLength, 2, 1) \
218 F(FunctionSetPrototype, 2, 1) \
219 F(FunctionSetReadOnlyPrototype, 1, 1) \
220 F(FunctionGetName, 1, 1) \
221 F(FunctionSetName, 2, 1) \
222 F(FunctionNameShouldPrintAsAnonymous, 1, 1) \
223 F(FunctionMarkNameShouldPrintAsAnonymous, 1, 1) \
224 F(FunctionBindArguments, 4, 1) \
225 F(BoundFunctionGetBindings, 1, 1) \
226 F(FunctionRemovePrototype, 1, 1) \
227 F(FunctionGetSourceCode, 1, 1) \
228 F(FunctionGetScript, 1, 1) \
229 F(FunctionGetScriptSourcePosition, 1, 1) \
230 F(FunctionGetPositionForOffset, 2, 1) \
231 F(FunctionIsAPIFunction, 1, 1) \
232 F(FunctionIsBuiltin, 1, 1) \
234 F(CollectStackTrace, 3, 1) \
235 F(GetV8Version, 0, 1) \
239 F(SetExpectedNumberOfProperties, 2, 1) \
241 F(CreateApiFunction, 1, 1) \
242 F(IsTemplate, 1, 1) \
243 F(GetTemplateField, 2, 1) \
244 F(DisableAccessChecks, 1, 1) \
245 F(EnableAccessChecks, 1, 1) \
248 F(DateCurrentTime, 0, 1) \
249 F(DateParseString, 2, 1) \
250 F(DateLocalTimezone, 1, 1) \
252 F(DateMakeDay, 2, 1) \
253 F(DateSetValue, 3, 1) \
258 F(CompileString, 1, 1) \
259 F(GlobalPrint, 1, 1) \
262 F(GlobalReceiver, 1, 1) \
263 F(ResolvePossiblyDirectEval, 6, 2) \
265 F(SetProperty, -1 /* 4 or 5 */, 1) \
266 F(DefineOrRedefineDataProperty, 4, 1) \
267 F(DefineOrRedefineAccessorProperty, 5, 1) \
268 F(IgnoreAttributesAndSetProperty, -1 /* 3 or 4 */, 1) \
271 F(RemoveArrayHoles, 2, 1) \
272 F(GetArrayKeys, 2, 1) \
273 F(MoveArrayContents, 2, 1) \
274 F(EstimateNumberOfElements, 1, 1) \
276 /* Getters and Setters */ \
277 F(LookupAccessor, 3, 1) \
280 F(MaterializeRegExpLiteral, 4, 1)\
281 F(CreateObjectLiteral, 4, 1) \
282 F(CreateObjectLiteralShallow, 4, 1) \
283 F(CreateArrayLiteral, 3, 1) \
284 F(CreateArrayLiteralShallow, 3, 1) \
286 /* Harmony proxies */ \
287 F(CreateJSProxy, 2, 1) \
288 F(CreateJSFunctionProxy, 4, 1) \
290 F(IsJSFunctionProxy, 1, 1) \
291 F(GetHandler, 1, 1) \
292 F(GetCallTrap, 1, 1) \
293 F(GetConstructTrap, 1, 1) \
297 F(SetInitialize, 1, 1) \
303 F(MapInitialize, 1, 1) \
307 /* Harmony weakmaps */ \
308 F(WeakMapInitialize, 1, 1) \
309 F(WeakMapGet, 2, 1) \
310 F(WeakMapSet, 3, 1) \
313 F(NewClosure, 3, 1) \
315 F(NewObjectFromBound, 1, 1) \
316 F(FinalizeInstanceSize, 1, 1) \
319 F(ThrowReferenceError, 1, 1) \
320 F(StackGuard, 0, 1) \
322 F(PromoteScheduledException, 0, 1) \
325 F(NewFunctionContext, 1, 1) \
326 F(PushWithContext, 2, 1) \
327 F(PushCatchContext, 3, 1) \
328 F(PushBlockContext, 2, 1) \
329 F(PushModuleContext, 2, 1) \
330 F(DeleteContextSlot, 2, 1) \
331 F(LoadContextSlot, 2, 2) \
332 F(LoadContextSlotNoReferenceError, 2, 2) \
333 F(StoreContextSlot, 4, 1) \
335 /* Declarations and initialization */ \
336 F(DeclareGlobals, 3, 1) \
337 F(DeclareContextSlot, 4, 1) \
338 F(InitializeVarGlobal, -1 /* 3 or 4 */, 1) \
339 F(InitializeConstGlobal, 3, 1) \
340 F(InitializeConstContextSlot, 3, 1) \
341 F(OptimizeObjectForAddingMultipleProperties, 2, 1) \
344 F(DebugPrint, 1, 1) \
345 F(DebugTrace, 0, 1) \
346 F(TraceEnter, 0, 1) \
354 F(GetFromCache, 2, 1) \
356 /* Message objects */ \
357 F(NewMessageObject, 2, 1) \
358 F(MessageGetType, 1, 1) \
359 F(MessageGetArguments, 1, 1) \
360 F(MessageGetStartPosition, 1, 1) \
361 F(MessageGetScript, 1, 1) \
363 /* Pseudo functions - handled as macros by parser */ \
366 /* expose boolean functions from objects-inl.h */ \
367 F(HasFastSmiOnlyElements, 1, 1) \
368 F(HasFastElements, 1, 1) \
369 F(HasFastDoubleElements, 1, 1) \
370 F(HasDictionaryElements, 1, 1) \
371 F(HasExternalPixelElements, 1, 1) \
372 F(HasExternalArrayElements, 1, 1) \
373 F(HasExternalByteElements, 1, 1) \
374 F(HasExternalUnsignedByteElements, 1, 1) \
375 F(HasExternalShortElements, 1, 1) \
376 F(HasExternalUnsignedShortElements, 1, 1) \
377 F(HasExternalIntElements, 1, 1) \
378 F(HasExternalUnsignedIntElements, 1, 1) \
379 F(HasExternalFloatElements, 1, 1) \
380 F(HasExternalDoubleElements, 1, 1) \
381 F(TransitionElementsSmiToDouble, 1, 1) \
382 F(TransitionElementsDoubleToObject, 1, 1) \
383 F(HaveSameMap, 2, 1) \
385 F(ProfilerResume, 0, 1) \
386 F(ProfilerPause, 0, 1)
389 #ifdef ENABLE_DEBUGGER_SUPPORT
390 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \
391 /* Debugger support*/ \
392 F(DebugBreak, 0, 1) \
393 F(SetDebugEventListener, 2, 1) \
395 F(DebugGetPropertyDetails, 2, 1) \
396 F(DebugGetProperty, 2, 1) \
397 F(DebugPropertyTypeFromDetails, 1, 1) \
398 F(DebugPropertyAttributesFromDetails, 1, 1) \
399 F(DebugPropertyIndexFromDetails, 1, 1) \
400 F(DebugNamedInterceptorPropertyValue, 2, 1) \
401 F(DebugIndexedInterceptorElementValue, 2, 1) \
402 F(CheckExecutionState, 1, 1) \
403 F(GetFrameCount, 1, 1) \
404 F(GetFrameDetails, 2, 1) \
405 F(GetScopeCount, 2, 1) \
406 F(GetScopeDetails, 4, 1) \
407 F(GetFunctionScopeCount, 1, 1) \
408 F(GetFunctionScopeDetails, 2, 1) \
409 F(DebugPrintScopes, 0, 1) \
410 F(GetThreadCount, 1, 1) \
411 F(GetThreadDetails, 2, 1) \
412 F(SetDisableBreak, 1, 1) \
413 F(GetBreakLocations, 1, 1) \
414 F(SetFunctionBreakPoint, 3, 1) \
415 F(SetScriptBreakPoint, 3, 1) \
416 F(ClearBreakPoint, 1, 1) \
417 F(ChangeBreakOnException, 2, 1) \
418 F(IsBreakOnException, 1, 1) \
419 F(PrepareStep, 3, 1) \
420 F(ClearStepping, 0, 1) \
421 F(DebugEvaluate, 6, 1) \
422 F(DebugEvaluateGlobal, 4, 1) \
423 F(DebugGetLoadedScripts, 0, 1) \
424 F(DebugReferencedBy, 3, 1) \
425 F(DebugConstructedBy, 2, 1) \
426 F(DebugGetPrototype, 1, 1) \
427 F(DebugSetScriptSource, 2, 1) \
428 F(SystemBreak, 0, 1) \
429 F(DebugDisassembleFunction, 1, 1) \
430 F(DebugDisassembleConstructor, 1, 1) \
431 F(FunctionGetInferredName, 1, 1) \
432 F(LiveEditFindSharedFunctionInfosForScript, 1, 1) \
433 F(LiveEditGatherCompileInfo, 2, 1) \
434 F(LiveEditReplaceScript, 3, 1) \
435 F(LiveEditReplaceFunctionCode, 2, 1) \
436 F(LiveEditFunctionSourceUpdated, 1, 1) \
437 F(LiveEditFunctionSetScript, 2, 1) \
438 F(LiveEditReplaceRefToNestedFunction, 3, 1) \
439 F(LiveEditPatchFunctionPositions, 2, 1) \
440 F(LiveEditCheckAndDropActivations, 2, 1) \
441 F(LiveEditCompareStrings, 2, 1) \
442 F(GetFunctionCodePositionFromSource, 2, 1) \
443 F(ExecuteInDebugContext, 2, 1) \
446 F(CollectGarbage, 1, 1) \
447 F(GetHeapUsage, 0, 1) \
449 /* LiveObjectList support*/ \
450 F(HasLOLEnabled, 0, 1) \
451 F(CaptureLOL, 0, 1) \
455 F(GetLOLObjId, 1, 1) \
456 F(GetLOLObjRetainers, 6, 1) \
457 F(GetLOLPath, 3, 1) \
459 F(PrintLOLObj, 1, 1) \
461 F(SummarizeLOL, 3, 1)
464 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F)
468 #define RUNTIME_FUNCTION_LIST_DEBUG(F) \
472 #define RUNTIME_FUNCTION_LIST_DEBUG(F)
475 // ----------------------------------------------------------------------------
476 // RUNTIME_FUNCTION_LIST defines all runtime functions accessed
477 // either directly by id (via the code generator), or indirectly
478 // via a native call by name (from within JS code).
480 #define RUNTIME_FUNCTION_LIST(F) \
481 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \
482 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \
483 RUNTIME_FUNCTION_LIST_DEBUG(F) \
484 RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F)
486 // ----------------------------------------------------------------------------
487 // INLINE_FUNCTION_LIST defines all inlined functions accessed
488 // with a native call of the form %_name from within JS code.
489 // Entries have the form F(name, number of arguments, number of return values).
490 #define INLINE_FUNCTION_LIST(F) \
492 F(IsNonNegativeSmi, 1, 1) \
495 F(IsConstructCall, 0, 1) \
496 F(CallFunction, -1 /* receiver + n args + function */, 1) \
497 F(ArgumentsLength, 0, 1) \
500 F(SetValueOf, 2, 1) \
501 F(DateField, 2 /* date object, field index */, 1) \
502 F(StringCharFromCode, 1, 1) \
503 F(StringCharAt, 2, 1) \
504 F(ObjectEquals, 2, 1) \
505 F(RandomHeapNumber, 0, 1) \
507 F(IsFunction, 1, 1) \
508 F(IsUndetectableObject, 1, 1) \
509 F(IsSpecObject, 1, 1) \
510 F(IsStringWrapperSafeForDefaultValueOf, 1, 1) \
517 F(IsRegExpEquivalent, 2, 1) \
518 F(HasCachedArrayIndex, 1, 1) \
519 F(GetCachedArrayIndex, 1, 1) \
520 F(FastAsciiArrayJoin, 2, 1)
523 // ----------------------------------------------------------------------------
524 // INLINE_AND_RUNTIME_FUNCTION_LIST defines all inlined functions accessed
525 // with a native call of the form %_name from within JS code that also have
526 // a corresponding runtime function, that is called for slow cases.
527 // Entries have the form F(name, number of arguments, number of return values).
528 #define INLINE_RUNTIME_FUNCTION_LIST(F) \
530 F(StringCharCodeAt, 2, 1) \
534 F(StringCompare, 2, 1) \
535 F(RegExpExec, 4, 1) \
536 F(RegExpConstructResult, 3, 1) \
537 F(GetFromCache, 2, 1) \
538 F(NumberToString, 1, 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 static Handle<String> StringReplaceOneCharWithString(Isolate* isolate,
638 Handle<String> subject,
639 Handle<String> search,
640 Handle<String> replace,
642 int recursion_limit);
644 // General-purpose helper functions for runtime system.
645 static int StringMatch(Isolate* isolate,
650 static bool IsUpperCaseChar(RuntimeState* runtime_state, uint16_t ch);
652 // TODO(1240886): Some of the following methods are *not* handle safe, but
653 // accept handle arguments. This seems fragile.
655 // Support getting the characters in a string using [] notation as
656 // in Firefox/SpiderMonkey, Safari and Opera.
657 MUST_USE_RESULT static MaybeObject* GetElementOrCharAt(Isolate* isolate,
658 Handle<Object> object,
661 MUST_USE_RESULT static MaybeObject* SetObjectProperty(
663 Handle<Object> object,
665 Handle<Object> value,
666 PropertyAttributes attr,
667 StrictModeFlag strict_mode);
669 MUST_USE_RESULT static MaybeObject* ForceSetObjectProperty(
671 Handle<JSObject> object,
673 Handle<Object> value,
674 PropertyAttributes attr);
676 MUST_USE_RESULT static MaybeObject* ForceDeleteObjectProperty(
678 Handle<JSReceiver> object,
681 MUST_USE_RESULT static MaybeObject* GetObjectProperty(
683 Handle<Object> object,
686 // This function is used in FunctionNameUsing* tests.
687 static Object* FindSharedFunctionInfoInScript(Isolate* isolate,
688 Handle<Script> script,
691 // Helper functions used stubs.
692 static void PerformGC(Object* result);
694 // Used in runtime.cc and hydrogen's VisitArrayLiteral.
695 static Handle<Object> CreateArrayLiteralBoilerplate(
697 Handle<FixedArray> literals,
698 Handle<FixedArray> elements);
702 //---------------------------------------------------------------------------
703 // Constants used by interface to runtime functions.
705 class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {};
706 class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {};
707 class DeclareGlobalsLanguageMode: public BitField<LanguageMode, 2, 2> {};
709 } } // namespace v8::internal
711 #endif // V8_RUNTIME_H_