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

Side by Side Diff: src/runtime.cc

Issue 18509003: Keep two empty lines between declarations for cpp files (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 5 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
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 4050 matching lines...) Expand 10 before | Expand all | Expand 10 after
4061 } 4061 }
4062 j++; 4062 j++;
4063 } 4063 }
4064 if (j == pattern_length) { 4064 if (j == pattern_length) {
4065 return i; 4065 return i;
4066 } 4066 }
4067 } 4067 }
4068 return -1; 4068 return -1;
4069 } 4069 }
4070 4070
4071
4071 RUNTIME_FUNCTION(MaybeObject*, Runtime_StringLastIndexOf) { 4072 RUNTIME_FUNCTION(MaybeObject*, Runtime_StringLastIndexOf) {
4072 HandleScope scope(isolate); 4073 HandleScope scope(isolate);
4073 ASSERT(args.length() == 3); 4074 ASSERT(args.length() == 3);
4074 4075
4075 CONVERT_ARG_HANDLE_CHECKED(String, sub, 0); 4076 CONVERT_ARG_HANDLE_CHECKED(String, sub, 0);
4076 CONVERT_ARG_HANDLE_CHECKED(String, pat, 1); 4077 CONVERT_ARG_HANDLE_CHECKED(String, pat, 1);
4077 4078
4078 Object* index = args[2]; 4079 Object* index = args[2];
4079 uint32_t start_index; 4080 uint32_t start_index;
4080 if (!index->ToArrayIndex(&start_index)) return Smi::FromInt(-1); 4081 if (!index->ToArrayIndex(&start_index)) return Smi::FromInt(-1);
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
4782 CONVERT_SMI_ARG_CHECKED(unchecked, 4); 4783 CONVERT_SMI_ARG_CHECKED(unchecked, 4);
4783 RUNTIME_ASSERT((unchecked & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0); 4784 RUNTIME_ASSERT((unchecked & ~(READ_ONLY | DONT_ENUM | DONT_DELETE)) == 0);
4784 PropertyAttributes attr = static_cast<PropertyAttributes>(unchecked); 4785 PropertyAttributes attr = static_cast<PropertyAttributes>(unchecked);
4785 4786
4786 bool fast = obj->HasFastProperties(); 4787 bool fast = obj->HasFastProperties();
4787 JSObject::DefineAccessor(obj, name, getter, setter, attr); 4788 JSObject::DefineAccessor(obj, name, getter, setter, attr);
4788 if (fast) JSObject::TransformToFastProperties(obj, 0); 4789 if (fast) JSObject::TransformToFastProperties(obj, 0);
4789 return isolate->heap()->undefined_value(); 4790 return isolate->heap()->undefined_value();
4790 } 4791 }
4791 4792
4793
4792 // Implements part of 8.12.9 DefineOwnProperty. 4794 // Implements part of 8.12.9 DefineOwnProperty.
4793 // There are 3 cases that lead here: 4795 // There are 3 cases that lead here:
4794 // Step 4a - define a new data property. 4796 // Step 4a - define a new data property.
4795 // Steps 9b & 12 - replace an existing accessor property with a data property. 4797 // Steps 9b & 12 - replace an existing accessor property with a data property.
4796 // Step 12 - update an existing data property with a data or generic 4798 // Step 12 - update an existing data property with a data or generic
4797 // descriptor. 4799 // descriptor.
4798 RUNTIME_FUNCTION(MaybeObject*, Runtime_DefineOrRedefineDataProperty) { 4800 RUNTIME_FUNCTION(MaybeObject*, Runtime_DefineOrRedefineDataProperty) {
4799 HandleScope scope(isolate); 4801 HandleScope scope(isolate);
4800 ASSERT(args.length() == 4); 4802 ASSERT(args.length() == 4);
4801 CONVERT_ARG_HANDLE_CHECKED(JSObject, js_object, 0); 4803 CONVERT_ARG_HANDLE_CHECKED(JSObject, js_object, 0);
(...skipping 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after
7456 7458
7457 RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_log) { 7459 RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_log) {
7458 SealHandleScope shs(isolate); 7460 SealHandleScope shs(isolate);
7459 ASSERT(args.length() == 1); 7461 ASSERT(args.length() == 1);
7460 isolate->counters()->math_log()->Increment(); 7462 isolate->counters()->math_log()->Increment();
7461 7463
7462 CONVERT_DOUBLE_ARG_CHECKED(x, 0); 7464 CONVERT_DOUBLE_ARG_CHECKED(x, 0);
7463 return isolate->transcendental_cache()->Get(TranscendentalCache::LOG, x); 7465 return isolate->transcendental_cache()->Get(TranscendentalCache::LOG, x);
7464 } 7466 }
7465 7467
7468
7466 // Slow version of Math.pow. We check for fast paths for special cases. 7469 // Slow version of Math.pow. We check for fast paths for special cases.
7467 // Used if SSE2/VFP3 is not available. 7470 // Used if SSE2/VFP3 is not available.
7468 RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow) { 7471 RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow) {
7469 SealHandleScope shs(isolate); 7472 SealHandleScope shs(isolate);
7470 ASSERT(args.length() == 2); 7473 ASSERT(args.length() == 2);
7471 isolate->counters()->math_pow()->Increment(); 7474 isolate->counters()->math_pow()->Increment();
7472 7475
7473 CONVERT_DOUBLE_ARG_CHECKED(x, 0); 7476 CONVERT_DOUBLE_ARG_CHECKED(x, 0);
7474 7477
7475 // If the second argument is a smi, it is much faster to call the 7478 // If the second argument is a smi, it is much faster to call the
7476 // custom powi() function than the generic pow(). 7479 // custom powi() function than the generic pow().
7477 if (args[1]->IsSmi()) { 7480 if (args[1]->IsSmi()) {
7478 int y = args.smi_at(1); 7481 int y = args.smi_at(1);
7479 return isolate->heap()->NumberFromDouble(power_double_int(x, y)); 7482 return isolate->heap()->NumberFromDouble(power_double_int(x, y));
7480 } 7483 }
7481 7484
7482 CONVERT_DOUBLE_ARG_CHECKED(y, 1); 7485 CONVERT_DOUBLE_ARG_CHECKED(y, 1);
7483 double result = power_helper(x, y); 7486 double result = power_helper(x, y);
7484 if (std::isnan(result)) return isolate->heap()->nan_value(); 7487 if (std::isnan(result)) return isolate->heap()->nan_value();
7485 return isolate->heap()->AllocateHeapNumber(result); 7488 return isolate->heap()->AllocateHeapNumber(result);
7486 } 7489 }
7487 7490
7491
7488 // Fast version of Math.pow if we know that y is not an integer and y is not 7492 // Fast version of Math.pow if we know that y is not an integer and y is not
7489 // -0.5 or 0.5. Used as slow case from full codegen. 7493 // -0.5 or 0.5. Used as slow case from full codegen.
7490 RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow_cfunction) { 7494 RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow_cfunction) {
7491 SealHandleScope shs(isolate); 7495 SealHandleScope shs(isolate);
7492 ASSERT(args.length() == 2); 7496 ASSERT(args.length() == 2);
7493 isolate->counters()->math_pow()->Increment(); 7497 isolate->counters()->math_pow()->Increment();
7494 7498
7495 CONVERT_DOUBLE_ARG_CHECKED(x, 0); 7499 CONVERT_DOUBLE_ARG_CHECKED(x, 0);
7496 CONVERT_DOUBLE_ARG_CHECKED(y, 1); 7500 CONVERT_DOUBLE_ARG_CHECKED(y, 1);
7497 if (y == 0) { 7501 if (y == 0) {
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
8845 // (edx:eax on ia32, r1:r0 on ARM). 8849 // (edx:eax on ia32, r1:r0 on ARM).
8846 // In AMD-64 calling convention a struct of two pointers is returned in rdx:rax. 8850 // In AMD-64 calling convention a struct of two pointers is returned in rdx:rax.
8847 // In Win64 calling convention, a struct of two pointers is returned in memory, 8851 // In Win64 calling convention, a struct of two pointers is returned in memory,
8848 // allocated by the caller, and passed as a pointer in a hidden first parameter. 8852 // allocated by the caller, and passed as a pointer in a hidden first parameter.
8849 #ifdef V8_HOST_ARCH_64_BIT 8853 #ifdef V8_HOST_ARCH_64_BIT
8850 struct ObjectPair { 8854 struct ObjectPair {
8851 MaybeObject* x; 8855 MaybeObject* x;
8852 MaybeObject* y; 8856 MaybeObject* y;
8853 }; 8857 };
8854 8858
8859
8855 static inline ObjectPair MakePair(MaybeObject* x, MaybeObject* y) { 8860 static inline ObjectPair MakePair(MaybeObject* x, MaybeObject* y) {
8856 ObjectPair result = {x, y}; 8861 ObjectPair result = {x, y};
8857 // Pointers x and y returned in rax and rdx, in AMD-x64-abi. 8862 // Pointers x and y returned in rax and rdx, in AMD-x64-abi.
8858 // In Win64 they are assigned to a hidden first argument. 8863 // In Win64 they are assigned to a hidden first argument.
8859 return result; 8864 return result;
8860 } 8865 }
8861 #else 8866 #else
8862 typedef uint64_t ObjectPair; 8867 typedef uint64_t ObjectPair;
8863 static inline ObjectPair MakePair(MaybeObject* x, MaybeObject* y) { 8868 static inline ObjectPair MakePair(MaybeObject* x, MaybeObject* y) {
8864 return reinterpret_cast<uint32_t>(x) | 8869 return reinterpret_cast<uint32_t>(x) |
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after
10226 CONVERT_ARG_CHECKED(String, string, 0); 10231 CONVERT_ARG_CHECKED(String, string, 0);
10227 ConsStringIteratorOp op; 10232 ConsStringIteratorOp op;
10228 StringCharacterStream stream(string, &op); 10233 StringCharacterStream stream(string, &op);
10229 while (stream.HasMore()) { 10234 while (stream.HasMore()) {
10230 uint16_t character = stream.GetNext(); 10235 uint16_t character = stream.GetNext();
10231 PrintF("%c", character); 10236 PrintF("%c", character);
10232 } 10237 }
10233 return string; 10238 return string;
10234 } 10239 }
10235 10240
10241
10236 // Moves all own elements of an object, that are below a limit, to positions 10242 // Moves all own elements of an object, that are below a limit, to positions
10237 // starting at zero. All undefined values are placed after non-undefined values, 10243 // starting at zero. All undefined values are placed after non-undefined values,
10238 // and are followed by non-existing element. Does not change the length 10244 // and are followed by non-existing element. Does not change the length
10239 // property. 10245 // property.
10240 // Returns the number of non-undefined elements collected. 10246 // Returns the number of non-undefined elements collected.
10241 RUNTIME_FUNCTION(MaybeObject*, Runtime_RemoveArrayHoles) { 10247 RUNTIME_FUNCTION(MaybeObject*, Runtime_RemoveArrayHoles) {
10242 SealHandleScope shs(isolate); 10248 SealHandleScope shs(isolate);
10243 ASSERT(args.length() == 2); 10249 ASSERT(args.length() == 2);
10244 CONVERT_ARG_CHECKED(JSObject, object, 0); 10250 CONVERT_ARG_CHECKED(JSObject, object, 0);
10245 CONVERT_NUMBER_CHECKED(uint32_t, limit, Uint32, args[1]); 10251 CONVERT_NUMBER_CHECKED(uint32_t, limit, Uint32, args[1]);
(...skipping 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after
11843 11849
11844 // Fill in scope details. 11850 // Fill in scope details.
11845 details->set(kScopeDetailsTypeIndex, Smi::FromInt(it->Type())); 11851 details->set(kScopeDetailsTypeIndex, Smi::FromInt(it->Type()));
11846 Handle<JSObject> scope_object = it->ScopeObject(); 11852 Handle<JSObject> scope_object = it->ScopeObject();
11847 RETURN_IF_EMPTY_HANDLE(isolate, scope_object); 11853 RETURN_IF_EMPTY_HANDLE(isolate, scope_object);
11848 details->set(kScopeDetailsObjectIndex, *scope_object); 11854 details->set(kScopeDetailsObjectIndex, *scope_object);
11849 11855
11850 return *isolate->factory()->NewJSArrayWithElements(details); 11856 return *isolate->factory()->NewJSArrayWithElements(details);
11851 } 11857 }
11852 11858
11859
11853 // Return an array with scope details 11860 // Return an array with scope details
11854 // args[0]: number: break id 11861 // args[0]: number: break id
11855 // args[1]: number: frame index 11862 // args[1]: number: frame index
11856 // args[2]: number: inlined frame index 11863 // args[2]: number: inlined frame index
11857 // args[3]: number: scope index 11864 // args[3]: number: scope index
11858 // 11865 //
11859 // The array returned contains the following information: 11866 // The array returned contains the following information:
11860 // 0: Scope type 11867 // 0: Scope type
11861 // 1: Scope object 11868 // 1: Scope object
11862 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetScopeDetails) { 11869 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetScopeDetails) {
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
12949 continue; 12956 continue;
12950 } 12957 }
12951 if (counter < buffer_size) { 12958 if (counter < buffer_size) {
12952 buffer->set(counter, shared); 12959 buffer->set(counter, shared);
12953 } 12960 }
12954 counter++; 12961 counter++;
12955 } 12962 }
12956 return counter; 12963 return counter;
12957 } 12964 }
12958 12965
12966
12959 // For a script finds all SharedFunctionInfo's in the heap that points 12967 // For a script finds all SharedFunctionInfo's in the heap that points
12960 // to this script. Returns JSArray of SharedFunctionInfo wrapped 12968 // to this script. Returns JSArray of SharedFunctionInfo wrapped
12961 // in OpaqueReferences. 12969 // in OpaqueReferences.
12962 RUNTIME_FUNCTION(MaybeObject*, 12970 RUNTIME_FUNCTION(MaybeObject*,
12963 Runtime_LiveEditFindSharedFunctionInfosForScript) { 12971 Runtime_LiveEditFindSharedFunctionInfosForScript) {
12964 HandleScope scope(isolate); 12972 HandleScope scope(isolate);
12965 CHECK(isolate->debugger()->live_edit_enabled()); 12973 CHECK(isolate->debugger()->live_edit_enabled());
12966 ASSERT(args.length() == 1); 12974 ASSERT(args.length() == 1);
12967 CONVERT_ARG_CHECKED(JSValue, script_value, 0); 12975 CONVERT_ARG_CHECKED(JSValue, script_value, 0);
12968 12976
(...skipping 25 matching lines...) Expand all
12994 } 13002 }
12995 13003
12996 Handle<JSArray> result = isolate->factory()->NewJSArrayWithElements(array); 13004 Handle<JSArray> result = isolate->factory()->NewJSArrayWithElements(array);
12997 result->set_length(Smi::FromInt(number)); 13005 result->set_length(Smi::FromInt(number));
12998 13006
12999 LiveEdit::WrapSharedFunctionInfos(result); 13007 LiveEdit::WrapSharedFunctionInfos(result);
13000 13008
13001 return *result; 13009 return *result;
13002 } 13010 }
13003 13011
13012
13004 // For a script calculates compilation information about all its functions. 13013 // For a script calculates compilation information about all its functions.
13005 // The script source is explicitly specified by the second argument. 13014 // The script source is explicitly specified by the second argument.
13006 // The source of the actual script is not used, however it is important that 13015 // The source of the actual script is not used, however it is important that
13007 // all generated code keeps references to this particular instance of script. 13016 // all generated code keeps references to this particular instance of script.
13008 // Returns a JSArray of compilation infos. The array is ordered so that 13017 // Returns a JSArray of compilation infos. The array is ordered so that
13009 // each function with all its descendant is always stored in a continues range 13018 // each function with all its descendant is always stored in a continues range
13010 // with the function itself going first. The root function is a script function. 13019 // with the function itself going first. The root function is a script function.
13011 RUNTIME_FUNCTION(MaybeObject*, Runtime_LiveEditGatherCompileInfo) { 13020 RUNTIME_FUNCTION(MaybeObject*, Runtime_LiveEditGatherCompileInfo) {
13012 HandleScope scope(isolate); 13021 HandleScope scope(isolate);
13013 CHECK(isolate->debugger()->live_edit_enabled()); 13022 CHECK(isolate->debugger()->live_edit_enabled());
13014 ASSERT(args.length() == 2); 13023 ASSERT(args.length() == 2);
13015 CONVERT_ARG_CHECKED(JSValue, script, 0); 13024 CONVERT_ARG_CHECKED(JSValue, script, 0);
13016 CONVERT_ARG_HANDLE_CHECKED(String, source, 1); 13025 CONVERT_ARG_HANDLE_CHECKED(String, source, 1);
13017 13026
13018 RUNTIME_ASSERT(script->value()->IsScript()); 13027 RUNTIME_ASSERT(script->value()->IsScript());
13019 Handle<Script> script_handle = Handle<Script>(Script::cast(script->value())); 13028 Handle<Script> script_handle = Handle<Script>(Script::cast(script->value()));
13020 13029
13021 JSArray* result = LiveEdit::GatherCompileInfo(script_handle, source); 13030 JSArray* result = LiveEdit::GatherCompileInfo(script_handle, source);
13022 13031
13023 if (isolate->has_pending_exception()) { 13032 if (isolate->has_pending_exception()) {
13024 return Failure::Exception(); 13033 return Failure::Exception();
13025 } 13034 }
13026 13035
13027 return result; 13036 return result;
13028 } 13037 }
13029 13038
13039
13030 // Changes the source of the script to a new_source. 13040 // Changes the source of the script to a new_source.
13031 // If old_script_name is provided (i.e. is a String), also creates a copy of 13041 // If old_script_name is provided (i.e. is a String), also creates a copy of
13032 // the script with its original source and sends notification to debugger. 13042 // the script with its original source and sends notification to debugger.
13033 RUNTIME_FUNCTION(MaybeObject*, Runtime_LiveEditReplaceScript) { 13043 RUNTIME_FUNCTION(MaybeObject*, Runtime_LiveEditReplaceScript) {
13034 HandleScope scope(isolate); 13044 HandleScope scope(isolate);
13035 CHECK(isolate->debugger()->live_edit_enabled()); 13045 CHECK(isolate->debugger()->live_edit_enabled());
13036 ASSERT(args.length() == 3); 13046 ASSERT(args.length() == 3);
13037 CONVERT_ARG_CHECKED(JSValue, original_script_value, 0); 13047 CONVERT_ARG_CHECKED(JSValue, original_script_value, 0);
13038 CONVERT_ARG_HANDLE_CHECKED(String, new_source, 1); 13048 CONVERT_ARG_HANDLE_CHECKED(String, new_source, 1);
13039 Handle<Object> old_script_name(args[2], isolate); 13049 Handle<Object> old_script_name(args[2], isolate);
(...skipping 27 matching lines...) Expand all
13067 RUNTIME_FUNCTION(MaybeObject*, Runtime_LiveEditReplaceFunctionCode) { 13077 RUNTIME_FUNCTION(MaybeObject*, Runtime_LiveEditReplaceFunctionCode) {
13068 HandleScope scope(isolate); 13078 HandleScope scope(isolate);
13069 CHECK(isolate->debugger()->live_edit_enabled()); 13079 CHECK(isolate->debugger()->live_edit_enabled());
13070 ASSERT(args.length() == 2); 13080 ASSERT(args.length() == 2);
13071 CONVERT_ARG_HANDLE_CHECKED(JSArray, new_compile_info, 0); 13081 CONVERT_ARG_HANDLE_CHECKED(JSArray, new_compile_info, 0);
13072 CONVERT_ARG_HANDLE_CHECKED(JSArray, shared_info, 1); 13082 CONVERT_ARG_HANDLE_CHECKED(JSArray, shared_info, 1);
13073 13083
13074 return LiveEdit::ReplaceFunctionCode(new_compile_info, shared_info); 13084 return LiveEdit::ReplaceFunctionCode(new_compile_info, shared_info);
13075 } 13085 }
13076 13086
13087
13077 // Connects SharedFunctionInfo to another script. 13088 // Connects SharedFunctionInfo to another script.
13078 RUNTIME_FUNCTION(MaybeObject*, Runtime_LiveEditFunctionSetScript) { 13089 RUNTIME_FUNCTION(MaybeObject*, Runtime_LiveEditFunctionSetScript) {
13079 HandleScope scope(isolate); 13090 HandleScope scope(isolate);
13080 CHECK(isolate->debugger()->live_edit_enabled()); 13091 CHECK(isolate->debugger()->live_edit_enabled());
13081 ASSERT(args.length() == 2); 13092 ASSERT(args.length() == 2);
13082 Handle<Object> function_object(args[0], isolate); 13093 Handle<Object> function_object(args[0], isolate);
13083 Handle<Object> script_object(args[1], isolate); 13094 Handle<Object> script_object(args[1], isolate);
13084 13095
13085 if (function_object->IsJSValue()) { 13096 if (function_object->IsJSValue()) {
13086 Handle<JSValue> function_wrapper = Handle<JSValue>::cast(function_object); 13097 Handle<JSValue> function_wrapper = Handle<JSValue>::cast(function_object);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
13141 RUNTIME_FUNCTION(MaybeObject*, Runtime_LiveEditCheckAndDropActivations) { 13152 RUNTIME_FUNCTION(MaybeObject*, Runtime_LiveEditCheckAndDropActivations) {
13142 HandleScope scope(isolate); 13153 HandleScope scope(isolate);
13143 CHECK(isolate->debugger()->live_edit_enabled()); 13154 CHECK(isolate->debugger()->live_edit_enabled());
13144 ASSERT(args.length() == 2); 13155 ASSERT(args.length() == 2);
13145 CONVERT_ARG_HANDLE_CHECKED(JSArray, shared_array, 0); 13156 CONVERT_ARG_HANDLE_CHECKED(JSArray, shared_array, 0);
13146 CONVERT_BOOLEAN_ARG_CHECKED(do_drop, 1); 13157 CONVERT_BOOLEAN_ARG_CHECKED(do_drop, 1);
13147 13158
13148 return *LiveEdit::CheckAndDropActivations(shared_array, do_drop); 13159 return *LiveEdit::CheckAndDropActivations(shared_array, do_drop);
13149 } 13160 }
13150 13161
13162
13151 // Compares 2 strings line-by-line, then token-wise and returns diff in form 13163 // Compares 2 strings line-by-line, then token-wise and returns diff in form
13152 // of JSArray of triplets (pos1, pos1_end, pos2_end) describing list 13164 // of JSArray of triplets (pos1, pos1_end, pos2_end) describing list
13153 // of diff chunks. 13165 // of diff chunks.
13154 RUNTIME_FUNCTION(MaybeObject*, Runtime_LiveEditCompareStrings) { 13166 RUNTIME_FUNCTION(MaybeObject*, Runtime_LiveEditCompareStrings) {
13155 HandleScope scope(isolate); 13167 HandleScope scope(isolate);
13156 CHECK(isolate->debugger()->live_edit_enabled()); 13168 CHECK(isolate->debugger()->live_edit_enabled());
13157 ASSERT(args.length() == 2); 13169 ASSERT(args.length() == 2);
13158 CONVERT_ARG_HANDLE_CHECKED(String, s1, 0); 13170 CONVERT_ARG_HANDLE_CHECKED(String, s1, 0);
13159 CONVERT_ARG_HANDLE_CHECKED(String, s2, 1); 13171 CONVERT_ARG_HANDLE_CHECKED(String, s2, 1);
13160 13172
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
13946 // Handle last resort GC and make sure to allow future allocations 13958 // Handle last resort GC and make sure to allow future allocations
13947 // to grow the heap without causing GCs (if possible). 13959 // to grow the heap without causing GCs (if possible).
13948 isolate->counters()->gc_last_resort_from_js()->Increment(); 13960 isolate->counters()->gc_last_resort_from_js()->Increment();
13949 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13961 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13950 "Runtime::PerformGC"); 13962 "Runtime::PerformGC");
13951 } 13963 }
13952 } 13964 }
13953 13965
13954 13966
13955 } } // namespace v8::internal 13967 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/profile-generator.cc ('k') | src/sampler.cc » ('j') | tools/presubmit.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698