Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 9281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9292 PrintF(" ** Queueing "); | 9292 PrintF(" ** Queueing "); |
| 9293 PrintName(); | 9293 PrintName(); |
| 9294 PrintF(" for concurrent recompilation.\n"); | 9294 PrintF(" for concurrent recompilation.\n"); |
| 9295 } | 9295 } |
| 9296 set_code_no_write_barrier( | 9296 set_code_no_write_barrier( |
| 9297 GetIsolate()->builtins()->builtin(Builtins::kInOptimizationQueue)); | 9297 GetIsolate()->builtins()->builtin(Builtins::kInOptimizationQueue)); |
| 9298 // No write barrier required, since the builtin is part of the root set. | 9298 // No write barrier required, since the builtin is part of the root set. |
| 9299 } | 9299 } |
| 9300 | 9300 |
| 9301 | 9301 |
| 9302 Handle<JSFunction> JSFunction::Copy(Handle<JSFunction> function) { | |
|
Toon Verwaest
2014/08/21 09:02:20
This method doesn't exactly copy a function anymor
Dmitry Lomov (no reviews)
2014/08/21 11:09:11
Done.
| |
| 9303 Isolate* isolate = function->GetIsolate(); | |
| 9304 Handle<Map> map(function->map()); | |
| 9305 Handle<SharedFunctionInfo> shared(function->shared()); | |
| 9306 Handle<Context> context(function->context()); | |
| 9307 Handle<JSFunction> clone = | |
| 9308 isolate->factory()->NewFunctionFromSharedFunctionInfo(shared, context); | |
| 9309 | |
| 9310 if (shared->bound()) { | |
| 9311 clone->set_function_bindings(function->function_bindings()); | |
| 9312 } | |
| 9313 | |
| 9314 // In typical case, __proto__ of ``function`` is the default Function | |
| 9315 // prototype, which means that SetPrototype below is a no-op. | |
| 9316 // In rare cases when that is not true, we mutate the clone's __proto__. | |
| 9317 Handle<Object> original_prototype(map->prototype(), isolate); | |
| 9318 JSObject::SetPrototype(clone, original_prototype, false).Assert(); | |
|
Toon Verwaest
2014/08/21 09:02:20
JSObject::SetPrototype isn't exactly a no-op right
Dmitry Lomov (no reviews)
2014/08/21 11:09:11
Done.
| |
| 9319 | |
| 9320 return clone; | |
| 9321 } | |
| 9322 | |
| 9323 | |
| 9302 void SharedFunctionInfo::AddToOptimizedCodeMap( | 9324 void SharedFunctionInfo::AddToOptimizedCodeMap( |
| 9303 Handle<SharedFunctionInfo> shared, | 9325 Handle<SharedFunctionInfo> shared, |
| 9304 Handle<Context> native_context, | 9326 Handle<Context> native_context, |
| 9305 Handle<Code> code, | 9327 Handle<Code> code, |
| 9306 Handle<FixedArray> literals, | 9328 Handle<FixedArray> literals, |
| 9307 BailoutId osr_ast_id) { | 9329 BailoutId osr_ast_id) { |
| 9308 Isolate* isolate = shared->GetIsolate(); | 9330 Isolate* isolate = shared->GetIsolate(); |
| 9309 DCHECK(code->kind() == Code::OPTIMIZED_FUNCTION); | 9331 DCHECK(code->kind() == Code::OPTIMIZED_FUNCTION); |
| 9310 DCHECK(native_context->IsNativeContext()); | 9332 DCHECK(native_context->IsNativeContext()); |
| 9311 STATIC_ASSERT(kEntryLength == 4); | 9333 STATIC_ASSERT(kEntryLength == 4); |
| (...skipping 7250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 16562 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16584 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 16563 static const char* error_messages_[] = { | 16585 static const char* error_messages_[] = { |
| 16564 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16586 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 16565 }; | 16587 }; |
| 16566 #undef ERROR_MESSAGES_TEXTS | 16588 #undef ERROR_MESSAGES_TEXTS |
| 16567 return error_messages_[reason]; | 16589 return error_messages_[reason]; |
| 16568 } | 16590 } |
| 16569 | 16591 |
| 16570 | 16592 |
| 16571 } } // namespace v8::internal | 16593 } } // namespace v8::internal |
| OLD | NEW |