| OLD | NEW |
| 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 // ------------------------------------------------------------------- | 5 // ------------------------------------------------------------------- |
| 6 | 6 |
| 7 (function(global, utils) { | 7 (function(global, utils) { |
| 8 | 8 |
| 9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 var Int16x8ToString; | 36 var Int16x8ToString; |
| 37 var Int32x4ToString; | 37 var Int32x4ToString; |
| 38 var Int8x16ToString; | 38 var Int8x16ToString; |
| 39 var InternalArray = utils.InternalArray; | 39 var InternalArray = utils.InternalArray; |
| 40 var internalErrorSymbol = utils.ImportNow("internal_error_symbol"); | 40 var internalErrorSymbol = utils.ImportNow("internal_error_symbol"); |
| 41 var ObjectHasOwnProperty; | 41 var ObjectHasOwnProperty; |
| 42 var ObjectToString = utils.ImportNow("object_to_string"); | 42 var ObjectToString = utils.ImportNow("object_to_string"); |
| 43 var Script = utils.ImportNow("Script"); | 43 var Script = utils.ImportNow("Script"); |
| 44 var stackTraceSymbol = utils.ImportNow("stack_trace_symbol"); | 44 var stackTraceSymbol = utils.ImportNow("stack_trace_symbol"); |
| 45 var StringIndexOf; | 45 var StringIndexOf; |
| 46 var SymbolToString; |
| 46 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); | 47 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
| 47 var Uint16x8ToString; | 48 var Uint16x8ToString; |
| 48 var Uint32x4ToString; | 49 var Uint32x4ToString; |
| 49 var Uint8x16ToString; | 50 var Uint8x16ToString; |
| 50 | 51 |
| 51 utils.Import(function(from) { | 52 utils.Import(function(from) { |
| 52 ArrayJoin = from.ArrayJoin; | 53 ArrayJoin = from.ArrayJoin; |
| 53 Bool16x8ToString = from.Bool16x8ToString; | 54 Bool16x8ToString = from.Bool16x8ToString; |
| 54 Bool32x4ToString = from.Bool32x4ToString; | 55 Bool32x4ToString = from.Bool32x4ToString; |
| 55 Bool8x16ToString = from.Bool8x16ToString; | 56 Bool8x16ToString = from.Bool8x16ToString; |
| 56 Float32x4ToString = from.Float32x4ToString; | 57 Float32x4ToString = from.Float32x4ToString; |
| 57 Int16x8ToString = from.Int16x8ToString; | 58 Int16x8ToString = from.Int16x8ToString; |
| 58 Int32x4ToString = from.Int32x4ToString; | 59 Int32x4ToString = from.Int32x4ToString; |
| 59 Int8x16ToString = from.Int8x16ToString; | 60 Int8x16ToString = from.Int8x16ToString; |
| 60 ObjectHasOwnProperty = from.ObjectHasOwnProperty; | 61 ObjectHasOwnProperty = from.ObjectHasOwnProperty; |
| 61 StringIndexOf = from.StringIndexOf; | 62 StringIndexOf = from.StringIndexOf; |
| 63 SymbolToString = from.SymbolToString; |
| 62 Uint16x8ToString = from.Uint16x8ToString; | 64 Uint16x8ToString = from.Uint16x8ToString; |
| 63 Uint32x4ToString = from.Uint32x4ToString; | 65 Uint32x4ToString = from.Uint32x4ToString; |
| 64 Uint8x16ToString = from.Uint8x16ToString; | 66 Uint8x16ToString = from.Uint8x16ToString; |
| 65 }); | 67 }); |
| 66 | 68 |
| 67 // ------------------------------------------------------------------- | 69 // ------------------------------------------------------------------- |
| 68 | 70 |
| 69 var GlobalError; | 71 var GlobalError; |
| 70 var GlobalTypeError; | 72 var GlobalTypeError; |
| 71 var GlobalRangeError; | 73 var GlobalRangeError; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 if (IS_UNDEFINED(obj)) return 'undefined'; | 110 if (IS_UNDEFINED(obj)) return 'undefined'; |
| 109 if (IS_NULL(obj)) return 'null'; | 111 if (IS_NULL(obj)) return 'null'; |
| 110 if (IS_FUNCTION(obj)) { | 112 if (IS_FUNCTION(obj)) { |
| 111 var str = %FunctionToString(obj); | 113 var str = %FunctionToString(obj); |
| 112 if (str.length > 128) { | 114 if (str.length > 128) { |
| 113 str = %_SubString(str, 0, 111) + "...<omitted>..." + | 115 str = %_SubString(str, 0, 111) + "...<omitted>..." + |
| 114 %_SubString(str, str.length - 2, str.length); | 116 %_SubString(str, str.length - 2, str.length); |
| 115 } | 117 } |
| 116 return str; | 118 return str; |
| 117 } | 119 } |
| 118 if (IS_SYMBOL(obj)) return %SymbolDescriptiveString(obj); | 120 if (IS_SYMBOL(obj)) return %_Call(SymbolToString, obj); |
| 119 if (IS_SIMD_VALUE(obj)) { | 121 if (IS_SIMD_VALUE(obj)) { |
| 120 switch (typeof(obj)) { | 122 switch (typeof(obj)) { |
| 121 case 'float32x4': return %_Call(Float32x4ToString, obj); | 123 case 'float32x4': return %_Call(Float32x4ToString, obj); |
| 122 case 'int32x4': return %_Call(Int32x4ToString, obj); | 124 case 'int32x4': return %_Call(Int32x4ToString, obj); |
| 123 case 'int16x8': return %_Call(Int16x8ToString, obj); | 125 case 'int16x8': return %_Call(Int16x8ToString, obj); |
| 124 case 'int8x16': return %_Call(Int8x16ToString, obj); | 126 case 'int8x16': return %_Call(Int8x16ToString, obj); |
| 125 case 'uint32x4': return %_Call(Uint32x4ToString, obj); | 127 case 'uint32x4': return %_Call(Uint32x4ToString, obj); |
| 126 case 'uint16x8': return %_Call(Uint16x8ToString, obj); | 128 case 'uint16x8': return %_Call(Uint16x8ToString, obj); |
| 127 case 'uint8x16': return %_Call(Uint8x16ToString, obj); | 129 case 'uint8x16': return %_Call(Uint8x16ToString, obj); |
| 128 case 'bool32x4': return %_Call(Bool32x4ToString, obj); | 130 case 'bool32x4': return %_Call(Bool32x4ToString, obj); |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 utils.Export(function(to) { | 763 utils.Export(function(to) { |
| 762 to.ErrorToString = ErrorToString; | 764 to.ErrorToString = ErrorToString; |
| 763 to.MakeError = MakeError; | 765 to.MakeError = MakeError; |
| 764 to.MakeRangeError = MakeRangeError; | 766 to.MakeRangeError = MakeRangeError; |
| 765 to.MakeSyntaxError = MakeSyntaxError; | 767 to.MakeSyntaxError = MakeSyntaxError; |
| 766 to.MakeTypeError = MakeTypeError; | 768 to.MakeTypeError = MakeTypeError; |
| 767 to.MakeURIError = MakeURIError; | 769 to.MakeURIError = MakeURIError; |
| 768 }); | 770 }); |
| 769 | 771 |
| 770 }); | 772 }); |
| OLD | NEW |